paseo-follow-up 2.5.0 → 2.6.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/OVERVIEW.md +1 -1
  2. package/README.md +0 -1
  3. package/client/brief-since.tsx +4 -3
  4. package/client/catch-up.tsx +56 -15
  5. package/client/header.tsx +5 -3
  6. package/client/home-data.ts +3 -1
  7. package/client/home-list.tsx +19 -11
  8. package/client/home-view.ts +8 -1
  9. package/client/home.tsx +29 -10
  10. package/client/keys.ts +2 -0
  11. package/client/kit.tsx +5 -2
  12. package/client/large.tsx +5 -3
  13. package/client/live.tsx +4 -3
  14. package/client/merge-button.tsx +3 -2
  15. package/client/messages.tsx +5 -1
  16. package/client/more-context.tsx +17 -4
  17. package/client/morning-brief-settings.tsx +5 -4
  18. package/client/needs-you.tsx +5 -4
  19. package/client/new-settings.tsx +8 -7
  20. package/client/now-lines.tsx +60 -0
  21. package/client/onboarding.tsx +55 -123
  22. package/client/paged-list.tsx +115 -0
  23. package/client/panel.tsx +24 -8
  24. package/client/pr-stats-settings.tsx +3 -2
  25. package/client/pr-stats.tsx +10 -10
  26. package/client/questions.tsx +63 -40
  27. package/client/release-notes.tsx +10 -9
  28. package/client/reviewers.tsx +8 -3
  29. package/client/row-open.ts +28 -0
  30. package/client/section-search.tsx +5 -3
  31. package/client/settings.tsx +11 -8
  32. package/client/setup-dialog.tsx +168 -0
  33. package/client/setup-gate.tsx +69 -0
  34. package/client/setup-ui.ts +27 -0
  35. package/client/shipping.tsx +5 -4
  36. package/client/stacks.tsx +11 -3
  37. package/client/tasks.tsx +5 -1
  38. package/client/your-questions.tsx +375 -0
  39. package/index.client.tsx +11 -3
  40. package/index.server.ts +162 -32
  41. package/package.json +1 -1
  42. package/server/agent-actions.ts +23 -14
  43. package/server/agent-hook.mjs +7 -5
  44. package/server/agent-parity.ts +21 -6
  45. package/server/ai-jobs.ts +26 -5
  46. package/server/brief-timeline.ts +47 -0
  47. package/server/context-requests.ts +90 -21
  48. package/server/directory.ts +6 -0
  49. package/server/discovery.ts +2 -0
  50. package/server/engine.ts +3 -0
  51. package/server/hook-source.ts +7 -5
  52. package/server/inbox-classifier.ts +17 -0
  53. package/server/inbox.ts +9 -3
  54. package/server/job-agent.ts +13 -2
  55. package/server/mcp-source.ts +23 -15
  56. package/server/mcp.mjs +23 -15
  57. package/server/obligations.ts +4 -1
  58. package/server/session-prompt.ts +30 -3
  59. package/server/turn-end.ts +133 -0
  60. package/server/wait-jobs.ts +18 -2
  61. package/server/wait.ts +17 -12
  62. package/shared/activity.ts +2 -1
  63. package/shared/agent-settings.ts +9 -8
  64. package/shared/catch-up.ts +65 -20
  65. package/shared/chat.ts +2 -2
  66. package/shared/compass.ts +5 -4
  67. package/shared/contracts.ts +52 -8
  68. package/shared/history.ts +160 -0
  69. package/shared/home-keys.ts +1 -0
  70. package/shared/home.ts +54 -8
  71. package/shared/job-rows.ts +2 -2
  72. package/shared/list.ts +4 -1
  73. package/shared/message-sender.ts +2 -0
  74. package/shared/model.ts +8 -0
  75. package/shared/new-name.ts +4 -1
  76. package/shared/now.ts +228 -0
  77. package/shared/onboarding.ts +17 -13
  78. package/shared/paged.ts +96 -0
  79. package/shared/provider-support.ts +83 -34
  80. package/shared/recommend.ts +1 -1
  81. package/shared/settings-nav.ts +3 -1
  82. package/shared/setup-popup.ts +28 -0
  83. package/shared/sort.ts +8 -1
  84. package/shared/status.ts +3 -1
  85. package/shared/wait.ts +2 -2
  86. package/shared/your-questions.ts +133 -0
  87. package/skills/follow-up/SKILL.md +1 -1
package/OVERVIEW.md CHANGED
@@ -22,7 +22,7 @@ you, in one place, ranked.
22
22
  It answers, or passes your words to the agent doing the work.
23
23
  - **Catch up** after a meeting or a morning away, one card at a time, on the desktop or your phone.
24
24
  - **PR statistics** show who opens, merges and reviews PRs, and how long PRs wait for a first review.
25
- - **Any provider:** agents on Claude Code, Codex, OpenCode, Pi, Copilot, Cursor and more get Follow-up's tools.
25
+ - **Any provider:** agents on Claude Code, Codex, OpenCode, Pi, Copilot, Cursor and more get every Follow-up feature.
26
26
 
27
27
  It never merges, requests reviewers, archives, answers a question for you or wakes a resting agent on its own.
28
28
 
package/README.md CHANGED
@@ -131,7 +131,6 @@ Steve Castaneda (questions with lettered options; MIT, see [THIRD_PARTY_NOTICES.
131
131
 
132
132
  [Defer](https://github.com/tomgrin10/paseo-defer),
133
133
  [Send to Paseo](https://github.com/tomgrin10/send-to-paseo),
134
- [Session Guard](https://github.com/tomgrin10/paseo-session-guard),
135
134
  [Smart Session](https://github.com/tomgrin10/paseo-smart-session),
136
135
  [Transcript Search](https://github.com/tomgrin10/paseo-transcript-search),
137
136
  [Transfer](https://github.com/tomgrin10/paseo-transfer),
@@ -1,4 +1,5 @@
1
1
  import { useCallback, useEffect, useRef, useState } from "react";
2
+ import { PagedRows } from "./paged-list";
2
3
  import { Platform, View } from "react-native";
3
4
  import { Pressable, Text } from "./text";
4
5
  import { useRpc } from "@getpaseo/plugin/client";
@@ -261,7 +262,7 @@ export function QueueScreen({ theme, compact, onHome, navigation }: { theme: The
261
262
  {view && !view.groups.length && <Text style={t.meta}>{filter === "all" ? "Nothing is assigned to you in the queue's states." : filter === "changed" ? "Nothing changed since you last read the brief." : "Every issue in your queue has a workspace."}</Text>}
262
263
  {view?.groups.map(g => <View key={g.priority} style={{ gap: 0 }}>
263
264
  <Text accessibilityRole="header" style={[t.section, { marginTop: 8 }]}>{g.name} · {g.count}</Text>
264
- {g.issues.map(i => <QueueRow key={i.key} i={i} change={changes.get(i.key)} c={c} compact={compact} timeZone={tz} navigation={navigation} />)}
265
+ <PagedRows items={g.issues} resetKey={filter} theme={theme} compact={compact} noun="issues" row={i => <QueueRow key={i.key} i={i} change={changes.get(i.key)} c={c} compact={compact} timeZone={tz} navigation={navigation} />} />
265
266
  </View>)}
266
267
  </ScrollView>;
267
268
  }
@@ -281,7 +282,7 @@ export function NobodyRows({ theme, compact, data, onDismissed }: { theme: Theme
281
282
  // pushes the new list on the home feed; without the feed, onDismissed reads it once.
282
283
  const dismiss = useDismiss(onDismissed);
283
284
  const now = Date.now();
284
- return <>{data.needs.map(r => {
285
+ return <PagedRows items={data.needs} theme={theme} compact={compact} noun="issues" row={r => {
285
286
  const row = nobodyRow(r, now, data.timeZone);
286
287
  const first = r.reasons[0]!;
287
288
  const reason = <PriorityLine reason={first.line} source={first.from === "compass" ? { kind: "compass", label: first.source } : { kind: "linear", label: first.source }} c={c} size={compact ? 12 : 11} lines={compact ? 2 : 1} />;
@@ -317,5 +318,5 @@ export function NobodyRows({ theme, compact, data, onDismissed }: { theme: Theme
317
318
  </View>
318
319
  </>}
319
320
  </RevealScope>;
320
- })}</>;
321
+ }} />;
321
322
  }
@@ -2,6 +2,7 @@
2
2
  // renders the same components the panel and Home use (QuestionBody, NeedsYouList, BriefCard, the permission block), so
3
3
  // the answer flow is the shared one, never a fork (one-answer-flow-for-every-question). The deck's order and every
4
4
  // move are the pure session in shared/catch-up.ts (context-never-blocks-the-deck, the-card-on-screen-never-moves).
5
+ import { usePagedList } from "./paged-list";
5
6
  import { useEffect, useMemo, useRef, useState, useSyncExternalStore, type ReactNode } from "react";
6
7
  import { Animated, PanResponder, Platform, View } from "react-native";
7
8
  import { Pressable, Text } from "./text";
@@ -19,7 +20,7 @@ import { CATCH_UP_RAIL_DEFAULT, CATCH_UP_RAIL_MAX, CATCH_UP_RAIL_MIN } from "../
19
20
  import { CATCH_UP_KEYS, MODE, catchUpKey, contextFor, keyLabel, deckCards, groupOf, openInWorkspace, park, prevPos, applySwipe, skipWorkspace, swipeLock, swipeOutcome, settle as settleCard, startSession, statsOf, sync, type ContextRequest, type DeckCard, type Outcome, type Session } from "../shared/catch-up";
20
21
  import type { Workspace } from "../shared/model";
21
22
  import type { ListWorkspace } from "../shared/list";
22
- import { bottomInset, Button, focusSoon, IconButton, SubmitScope, text, type Theme } from "./kit";
23
+ import { bottomInset, Button, errorText, focusSoon, IconButton, SubmitScope, text, type Theme } from "./kit";
23
24
  import { glyphColor } from "./home-list";
24
25
  import { useHomeModel, type HomeSources } from "./home-data";
25
26
  import { useInbox } from "./inbox";
@@ -39,6 +40,8 @@ import { ownsKey, surfaceVisible } from "../shared/list-keys";
39
40
  import { useReducedMotion } from "./motion";
40
41
  import { PRIMARY_FORM } from "./dock";
41
42
  import { MorePanel, MoveResult, ContextAnswer } from "./more-context";
43
+ import { AnswerActions, AnswerView, ReplyForm, useQuestionActs } from "./your-questions";
44
+ import { questionLine, questionsByWorkspace } from "../shared/your-questions";
42
45
 
43
46
  export { MorePanel, MoveResult, ContextAnswer };
44
47
 
@@ -58,13 +61,18 @@ export function cardLabel(card: DeckCard, w: ListWorkspace | undefined): string
58
61
  if (card.kind === "question") { const q = w?.questions.find(x => x.id === card.questionId); return q ? `${q.id} · ${q.title}` : card.questionId ?? "Question"; }
59
62
  if (card.kind === "item" && card.item) return card.item.title;
60
63
  if (card.kind === "brief") return card.s.line || card.s.word || "Ask";
64
+ if (card.kind === "answer") return card.ask || "Your question";
61
65
  return card.s.line || "Finished";
62
66
  }
63
67
  /** The card's own word: a workspace row's word names its first item, the card names its own. */
68
+ /** "4m ago", or "just now" (never "now ago"); empty when there's no time. */
69
+ const agoText = (a: string) => !a ? "" : a === "now" ? "just now" : `${a} ago`;
70
+
64
71
  function cardWord(card: DeckCard): string {
65
72
  if (card.kind === "permission") return "Permission";
66
73
  if (card.kind === "question") return card.item?.kind === "question" && card.item.state === "stopped" ? "Agent stopped" : "Question";
67
74
  if (card.kind === "finished") return "Finished";
75
+ if (card.kind === "answer") return "Your question";
68
76
  if (card.kind === "brief") return card.s.word ?? "Ask";
69
77
  switch (card.item?.kind) {
70
78
  case "merge": return "Merge"; case "reviewers": return "Add reviewers"; case "send": return "Send"; case "answer": return "Your answer";
@@ -73,14 +81,14 @@ function cardWord(card: DeckCard): string {
73
81
  default: return card.s.word ?? "Needs you";
74
82
  }
75
83
  }
76
- const cardIcon = (card: DeckCard) => card.kind === "permission" ? "ShieldQuestion" : card.kind === "question" ? "MessageCircleQuestion"
84
+ const cardIcon = (card: DeckCard) => card.kind === "permission" ? "ShieldQuestion" : card.kind === "question" ? "MessageCircleQuestion" : card.kind === "answer" ? "MessageSquareReply"
77
85
  : card.item?.kind === "merge" ? "GitMerge" : card.item?.kind === "reviewers" ? "UserPlus" : card.item?.kind === "person" ? "UserRound" : card.item?.kind === "send" ? "Send" : card.kind === "finished" ? "Flag" : card.s.icon;
78
86
  /**
79
87
  * The card Skip names what it skips, so it never reads as the workspace (Tom, beta.3: "at first I thought it skips the
80
88
  * workspace"): the card's kind where one word says it, else "card", the deck's own word ("N skipped" counts cards).
81
89
  */
82
90
  export function skipNoun(card: Pick<DeckCard, "kind" | "item">): string {
83
- return card.kind === "question" ? "question" : card.kind === "permission" ? "permission" : card.item?.kind === "merge" ? "merge" : "card";
91
+ return card.kind === "question" ? "question" : card.kind === "answer" ? "answer" : card.kind === "permission" ? "permission" : card.item?.kind === "merge" ? "merge" : "card";
84
92
  }
85
93
  /** The card Skip's tooltip and accessible name: what it does and that the card comes back. */
86
94
  export const skipCardHint = (noun: string) => `Skip this ${noun}. It comes back after the rest`;
@@ -96,8 +104,10 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
96
104
  const version = useSyncExternalStore(live.subscribe, live.version, live.version);
97
105
  const context = useSyncExternalStore(extras.subscribe, extras.context, extras.context);
98
106
  // Everything comes from what the client already holds: Home's model, the inbox rows, the listed workspaces.
99
- const liveCards = useMemo(() => deckCards({ model, rows, items: id => { const w = live.get(id); return w ? needsYou(w as unknown as Workspace) : []; } }),
100
- [model, rows, version, live]); // eslint-disable-line react-hooks/exhaustive-deps
107
+ // Your questions: each unread answer is a card, last in its workstream (shared deckCards).
108
+ const unread = useMemo(() => questionsByWorkspace(context), [context]);
109
+ const liveCards = useMemo(() => deckCards({ model, rows, items: id => { const w = live.get(id); return w ? needsYou(w as unknown as Workspace) : []; }, answers: id => unread.get(id)?.unread ?? [] }),
110
+ [model, rows, version, live, unread]); // eslint-disable-line react-hooks/exhaustive-deps
101
111
  const byKey = useMemo(() => new Map(liveCards.map(x => [x.key, x])), [liveCards]);
102
112
  // A card that left Needs you keeps its last copy, so it can say "Handled elsewhere" in place.
103
113
  const seen = useRef(new Map<string, DeckCard>());
@@ -163,7 +173,7 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
163
173
  if (!r || !ownsKey({ inside: !!el && r.contains(el), onBody, claimBody: true, visible: onBody && surfaceVisible(r, doc) })) return;
164
174
  const typing = !!el && (el.tagName === "INPUT" || el.tagName === "TEXTAREA" || !!el.isContentEditable);
165
175
  const hit = catchUpKey({ key: e.key, meta: e.metaKey, ctrl: e.ctrlKey, alt: e.altKey, shift: e.shiftKey, composing: e.isComposing, mac },
166
- { typing, inMore: !!el?.closest?.("[data-catch-up-more]"), moreOpen: more, inRail: !!el?.closest?.("[data-catch-up-rail]") });
176
+ { typing, inMore: !!el?.closest?.("[data-catch-up-more]"), moreOpen: more, inRail: !!el?.closest?.("[data-catch-up-rail]"), answer: card?.kind === "answer" });
167
177
  if (!hit || finished && !["back", "keys", "leave", "rail"].includes(hit.action)) return;
168
178
  const click = (q: string) => { const b = r.querySelector(q); b?.click?.(); return !!b; };
169
179
  switch (hit.action) {
@@ -197,6 +207,10 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
197
207
  // Its sheet or popover takes focus itself (MoveResult).
198
208
  case "later": if (!click('[aria-label="Later (L)"]')) return; break;
199
209
  case "chat": if (!click('[aria-label="Open chat (O)"]')) return; break;
210
+ // An answer card's own buttons (AnswerActions), so the key does exactly what the click does.
211
+ case "done": if (!click('[data-catch-up-card] [aria-label="Done (D)"]')) return; break;
212
+ case "reply": if (!click('[data-catch-up-card] [aria-label="Reply (W)"]')) return; break;
213
+ case "task": if (!click('[data-catch-up-card] [aria-label="Make a task (T)"]')) return; break;
200
214
  case "chip": r.querySelectorAll("[data-catch-up-more] [role=\"radio\"]")[Number(hit.arg) - 1]?.click?.(); break;
201
215
  case "ask": if (!click('[data-catch-up-more] [data-ask-agent] [role="button"]')) return; break;
202
216
  case "rail": {
@@ -226,6 +240,8 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
226
240
  const reduced = useReducedMotion();
227
241
  const drag = useRef(new Animated.Value(0)).current;
228
242
  const [dragDir, setDragDir] = useState<"skip-workspace" | "back" | null>(null);
243
+ // The desktop rail pages (client/paged-list.tsx) and follows the card on screen: a deck of hundreds draws one page.
244
+ const railPage = usePagedList({ items: session.order, resetKey: String(session.pos), follow: session.pos, theme, compact, noun: "cards" });
229
245
  const width = useRef(390);
230
246
  const lock = useRef<"x" | "y" | null>(null);
231
247
  // The finger's own offset from where it went down: react-native-web's accumulated gestureState.dx runs ahead of a
@@ -293,12 +309,13 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
293
309
  onSkipped={() => setSession(s => ({ ...s, pos: s.order.findIndex(k => s.outcomes[k] === "skipped"), lapped: true }))} />
294
310
  // The card on screen is the selected one: its x shows without hover (dismissing-anything-in-needs-you-sends-the-agent-nothing).
295
311
  : <DismissReveal.Provider value="always"><CardView key={card.key} card={card} w={w} theme={theme} compact={compact} deps={deps} navigation={navigation} gone={gone} more={more} setMore={setMore}
296
- request={askFor(context, card)} waiting={!!session.parked[card.s.key]} onAsk={ask}
312
+ request={askFor(context, card)} answer={card.requestId ? context.find(r => r.id === card.requestId) ?? null : null} waiting={!!session.parked[card.s.key]} onAsk={ask}
297
313
  sameWorkspace={session.order.filter(k => cardOf(k)?.s.key === card.s.key)}
298
314
  onDone={() => settle("done")} onSkip={skip} onSkipWorkspace={wsLeft > 1 ? skipWs : undefined} wsLeft={wsLeft} onBack={session.pos > 0 ? back : undefined} onLater={() => settle("later")} /></DismissReveal.Provider>;
299
315
 
300
316
  const rail = <ScrollView {...({ dataSet: { catchUpRail: "1" } } as object)} contentContainerStyle={{ paddingVertical: 8 }}>
301
- {session.order.map((k, i) => {
317
+ {railPage.shown.map((k, at) => {
318
+ const i = (railPage.info?.from ?? 0) + at;
302
319
  const x = cardOf(k); if (!x) return null;
303
320
  const xw = x.s.workspaceId ? live.get(x.s.workspaceId) : undefined;
304
321
  const o = session.outcomes[k]; const here = i === session.pos;
@@ -316,6 +333,7 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
316
333
  </Pressable>
317
334
  </View>;
318
335
  })}
336
+ {railPage.footer}
319
337
  </ScrollView>;
320
338
 
321
339
  // Under the dragged card: the one the release would show, so the drag says where it goes.
@@ -351,9 +369,9 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
351
369
  }
352
370
 
353
371
  /** One card: who and what, the ask through its own surface's component, then the deck's moves pinned to the bottom. */
354
- function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMore, request, waiting, onAsk, sameWorkspace, onDone, onSkip, onSkipWorkspace, wsLeft, onBack, onLater }: {
372
+ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMore, request, answer, waiting, onAsk, sameWorkspace, onDone, onSkip, onSkipWorkspace, wsLeft, onBack, onLater }: {
355
373
  card: DeckCard; w: ListWorkspace | undefined; theme: Theme; compact: boolean; deps: CatchUpDeps; navigation: Nav; gone: boolean; more: boolean; setMore: (v: boolean | ((v: boolean) => boolean)) => void;
356
- request: ContextRequest | null; waiting: boolean; onAsk: (words: string, images?: ImageUpload[]) => Promise<void>;
374
+ request: ContextRequest | null; /** An `answer` card's question (Your questions). */ answer: ContextRequest | null; waiting: boolean; onAsk: (words: string, images?: ImageUpload[]) => Promise<void>;
357
375
  sameWorkspace: string[]; onDone: () => void; onSkip: () => void; onSkipWorkspace?: () => void; wsLeft: number; onBack?: () => void; onLater: () => void;
358
376
  }) {
359
377
  const c = theme.colors; const t = text(c, compact);
@@ -377,7 +395,7 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
377
395
  <Icon name={cardIcon(card)} size={14} color={color} />
378
396
  <Text numberOfLines={1} style={[t.meta, { flex: 1 }]}>
379
397
  <Text style={{ color, fontWeight: "600" }}>{word}</Text>
380
- {[s.at ? `${age(s.at, Date.now())} ago` : "", s.project].filter(Boolean).map(x => ` · ${x}`).join("")}
398
+ {[s.at ? agoText(age(s.at, Date.now())) : "", s.project].filter(Boolean).map(x => ` · ${x}`).join("")}
381
399
  {sameWorkspace.length > 1 ? ` · ${nth + 1} of ${sameWorkspace.length} here` : ""}
382
400
  </Text>
383
401
  </View>
@@ -406,7 +424,27 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
406
424
  <Button theme={theme} compact={compact} kind="primary" icon="ArrowRight" title="Next" onPress={onSkip} />
407
425
  </View>;
408
426
 
409
- const askBlock = card.kind === "question" && q && ws
427
+ const isAnswer = card.kind === "answer";
428
+ const acts = useQuestionActs();
429
+ const [replying, setReplying] = useState(false);
430
+ const [answerBusy, setAnswerBusy] = useState<"done" | "task" | "again" | null>(null);
431
+ const [answerError, setAnswerError] = useState<string | null>(null);
432
+ const answerRun = (what: "done" | "task" | "again", work: () => Promise<unknown>) => {
433
+ setAnswerBusy(what); setAnswerError(null);
434
+ work().then(onDone, e => setAnswerError(errorText(e))).finally(() => setAnswerBusy(null));
435
+ };
436
+ const answerChat = answer?.askedOf && navigation ? () => navigation.openAgent({ agentId: answer.askedOf! }) : openChat;
437
+ const answerActions = (bar: boolean) => answer && <AnswerActions r={answer} theme={theme} compact={compact} keys bar={bar} busy={answerBusy} openChat={bar ? answerChat : undefined}
438
+ onDone={() => answerRun("done", () => acts.act(answer.id, "done"))} onReply={() => setReplying(true)}
439
+ onTask={() => answerRun("task", () => acts.act(answer.id, "task"))}
440
+ onAskAgain={() => answerRun("again", async () => { await acts.ask({ workspaceId: answer.workspaceId, agentId: answer.cardKey ? answer.agentId : answer.askedOf, cardKey: answer.cardKey, card: answer.card || undefined, ask: answer.ask, via: answer.via === "slash" ? "slash" : answer.cardKey ? "more" : "field" }); await acts.act(answer.id, "done"); })}
441
+ extra={bar ? <Button theme={theme} compact kind="ghost" icon="ArrowRight" title={`Skip ${noun}`} accessibilityLabel={skipCardHint(noun)} onPress={onSkip} /> : undefined} />;
442
+ const askBlock = isAnswer ? answer ? <View style={{ gap: 14 }}>
443
+ <AnswerView r={answer} theme={theme} compact={compact} now={Date.now()} mainAgentId={full?.mainAgentId ?? w?.mainAgentId ?? null} big />
444
+ {replying ? <ReplyForm r={answer} theme={theme} compact={compact} onCancel={() => setReplying(false)} onSent={onDone} /> : !compact && answerActions(false)}
445
+ {!!answerError && <Text accessibilityRole="alert" style={[t.meta, { color: c.statusDanger }]}>{answerError}</Text>}
446
+ </View> : <RichText selectable style={t.ask}>{card.ask || "Your question"}</RichText>
447
+ : card.kind === "question" && q && ws
410
448
  ? <View style={{ gap: 8 }}>
411
449
  <View style={{ flexDirection: "row", alignItems: "flex-start", gap: 8 }}>
412
450
  <RichText plain style={[compact ? t.ask : [t.body, { fontSize: 15, lineHeight: 21, fontWeight: "600" }], { flex: 1, minWidth: 0 }]}>{`${q.id} · ${q.title}`}</RichText>
@@ -428,7 +466,7 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
428
466
  </View>;
429
467
 
430
468
  // Add context without answering: every card that isn't a question has the agent's reply box (a question has its note).
431
- const reply = card.kind !== "question" && s.agentId && <NoteRow theme={theme} compact={compact} agentId={s.agentId} />;
469
+ const reply = card.kind !== "question" && !isAnswer && s.agentId && <NoteRow theme={theme} compact={compact} agentId={s.agentId} />;
432
470
  const contextBlock = request && <ContextAnswer theme={theme} compact={compact} request={request} waiting={waiting} agent={agentName} openChat={openChat} openAgent={navigation ? id => navigation.openAgent({ agentId: id }) : undefined} />;
433
471
  // a-move-bar-action-opens-in-view (MOVE_OPENS): More context and Later open where the eye is, a sheet above the
434
472
  // phone's bar or a popover on their button on desktop, never appended below the card.
@@ -451,9 +489,11 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
451
489
  const send = ready && (compact
452
490
  ? <View style={{ flex: 1 }}><Button theme={theme} compact grow kind="primary" icon="Send" title="Send" accessibilityLabel="Send to agent" shortcut disabled={ready.busy} onPress={ready.send} /></View>
453
491
  : <Button theme={theme} kind="primary" icon="Send" title="Send to agent" shortcut disabled={ready.busy} onPress={ready.send} />);
454
- const moves = <View {...({ dataSet: { catchUpCardMoves: "1" } } as object)} style={{ flexDirection: "row", alignItems: "center", gap: 8, paddingHorizontal: compact ? 12 : 0, paddingTop: compact ? 10 : 4 }}>
492
+ // An answer on a phone: its own actions are the thumb bar (Done, Reply, Task, ⋯ with Open chat and Skip); swipes still move.
493
+ const moves = compact && isAnswer && answer && !replying ? <View {...({ dataSet: { catchUpCardMoves: "1" } } as object)} style={{ paddingHorizontal: 12, paddingTop: 10 }}>{answerActions(true)}</View>
494
+ : <View {...({ dataSet: { catchUpCardMoves: "1" } } as object)} style={{ flexDirection: "row", alignItems: "center", gap: 8, paddingHorizontal: compact ? 12 : 0, paddingTop: compact ? 10 : 4 }}>
455
495
  <IconButton theme={theme} compact={compact} icon="ChevronLeft" label={compact ? "Back" : "Back (K or ←)"} tooltip={!compact} disabled={!onBack} onPress={() => onBack?.()} />
456
- {compact ? <IconButton theme={theme} compact icon="Sparkles" label="More context" onPress={toggleMore} />
496
+ {isAnswer ? null : compact ? <IconButton theme={theme} compact icon="Sparkles" label="More context" onPress={toggleMore} />
457
497
  : <View>{popover(moreBlock, "More context", 560)}<Tip label="More context (M)"><Button theme={theme} icon="Sparkles" title="More context" accessibilityHint="M" nativeID="catch-up-more" onPress={toggleMore} /></Tip></View>}
458
498
  <View>{!compact && popover(laterBlock, "Later", 380)}<IconButton theme={theme} compact={compact} icon="AlarmClock" label={compact ? "Later" : "Later (L)"} tooltip={!compact} disabled={!s.agentId} onPress={toggleLater} /></View>
459
499
  <IconButton theme={theme} compact={compact} icon="MessageSquare" label={compact ? "Open chat" : "Open chat (O)"} tooltip={!compact} disabled={!navigation} onPress={openChat} />
@@ -553,6 +593,7 @@ export function KeysSheet({ theme, onClose, label = "Catch up keys", sections: g
553
593
  /** Catch up's sheet: the dictation key only where the host has a mic. */
554
594
  const catchUpSections = (dictation: boolean): readonly KeySection[] => [
555
595
  { title: "On a card", keys: CATCH_UP_KEYS.filter(k => !k.when && (!k.needs || dictation)) },
596
+ { title: "On an answer to your question", keys: CATCH_UP_KEYS.filter(k => k.when === "answer") },
556
597
  { title: "In More context", keys: CATCH_UP_KEYS.filter(k => k.when === "more") },
557
598
  { title: "In the queue", keys: CATCH_UP_KEYS.filter(k => k.when === "rail") },
558
599
  ];
package/client/header.tsx CHANGED
@@ -57,7 +57,7 @@ function LiveGlyph({ icon, colors }: { icon: LiveIcon; colors: Colors }) {
57
57
  }
58
58
  }
59
59
 
60
- export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings, onRefresh, refreshing, onAuto, autoPending, notice, onOpenPr, resize, hideTitle = false, onHome, more, openAgent }: {
60
+ export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings, onRefresh, refreshing, onAuto, autoPending, notice, onOpenPr, resize, hideTitle = false, onHome, more, openAgent, agentLines = false }: {
61
61
  workspace: Workspace; theme: Theme; compact: boolean; now: number; onSettings: (category?: SettingsCategory) => void; onRefresh: () => void; refreshing: boolean; onAuto: (next: boolean) => void; autoPending: boolean; notice: string | null; onOpenPr?: (key: string) => void;
62
62
  /** Expand to the larger view, or collapse back to the panel. Absent where the panel is already as wide as it gets. */
63
63
  resize?: { icon: "Maximize2" | "Minimize2"; label: string; onPress: () => void } | null;
@@ -69,6 +69,8 @@ export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings,
69
69
  more?: ReactNode;
70
70
  /** Why it matters' Ask the Overseer opens the Overseer's chat with the draft in it. */
71
71
  openAgent?: (agentId: string) => void;
72
+ /** Each agent's line is drawn below (client/now-lines.tsx), so "Main agent is working (on 1 repair)" isn't said twice. */
73
+ agentLines?: boolean;
72
74
  }) {
73
75
  const c = theme.colors; const t = text(c, compact);
74
76
  const parts = headline(w, now);
@@ -83,12 +85,12 @@ export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings,
83
85
  <IconButton icon="Settings" label="Follow-up settings" onPress={() => onSettings()} theme={theme} compact={compact} />
84
86
  </View>;
85
87
  const tail = <>
86
- <View style={{ flexDirection: "row", gap: 6, marginTop: 2 }}>
88
+ {!(agentLines && (live.icon === "spinner" || live.icon === "sent")) && <View style={{ flexDirection: "row", gap: 6, marginTop: 2 }}>
87
89
  <View style={{ paddingTop: 3 }}><IconSwap swapKey={live.icon} size={12}><LiveGlyph icon={live.icon} colors={c} /></IconSwap></View>
88
90
  <Text accessibilityLiveRegion="polite" style={[t.meta, { flex: 1, color: live.icon === "spinner" || live.icon === "sent" ? c.foreground : c.foregroundMuted }]}>
89
91
  {live.text}{live.since ? <Text style={{ color: c.foregroundMuted }}>{` · ${ago(live.since, now)}`}</Text> : null}
90
92
  </Text>
91
- </View>
93
+ </View>}
92
94
  {notice && <View accessibilityRole="alert" style={{ flexDirection: "row", gap: 6 }}>
93
95
  <View style={{ paddingTop: 3 }}><Icon name="TriangleAlert" size={12} color={c.statusWarning} /></View>
94
96
  <Text style={[t.meta, { flex: 1, color: c.statusWarning }]}>{notice}</Text>
@@ -88,7 +88,9 @@ export function useHomeModel(sources: HomeSources): HomeModel {
88
88
  // feed), so Home's header, strip and brief line and the sidebar badge (client/live.tsx) agree (nobody-s-on-it-is-needs-you).
89
89
  const raised = useSyncExternalStore(extras.subscribe, () => extras.queue().needs.length, () => 0);
90
90
  const compass = useSyncExternalStore(extras.subscribe, extras.compass, extras.compass);
91
- return useMemo(() => buildHome({ rows: inbox.rows(), tracked: live.all(), paseo: paseo.all(), now: Date.now(), sort, priorities, hidden: overseer ? [overseer] : [], hold, compass, raised }), [a, b, c, now, sort, priorities, inbox, live, paseo, overseer, hold, raised, compass]);
91
+ // Your questions: an unread answer is a Needs-you row; a question asking is its row's line (the home feed's context).
92
+ const questions = useSyncExternalStore(extras.subscribe, extras.context, extras.context);
93
+ return useMemo(() => buildHome({ rows: inbox.rows(), tracked: live.all(), paseo: paseo.all(), now: Date.now(), sort, priorities, hidden: overseer ? [overseer] : [], hold, compass, raised, questions }), [a, b, c, now, sort, priorities, inbox, live, paseo, overseer, hold, raised, compass, questions]);
92
94
  }
93
95
 
94
96
  /** Rebuilds a value at most every `ms` while mounted (used for the brief pane's source ages). */
@@ -13,6 +13,7 @@ import { marked } from "./rich-text";
13
13
  import { Spinner } from "./motion";
14
14
  import { Button, focusRing, rowDomId, type Theme } from "./kit";
15
15
  import { useListKeys } from "./list-keys";
16
+ import { bindRowDoubleClick, useRowOpen } from "./row-open";
16
17
  import { walkOrder } from "../shared/list-keys";
17
18
  import { BRIEF_KEY, OVERSEER_KEY, QUIET_PAGE, listEntries, type Entry } from "../shared/list-entries";
18
19
  import { RowMenu, useRowMenuTrigger, type OpenRowMenu, type RowMenuOpen } from "./row-menu";
@@ -98,6 +99,7 @@ export const TOUCH_ROW_TEXT = 14 + 18 + 10;
98
99
 
99
100
  export function HomeList({ model, theme, dense = false, touch, selectedKey, onSelect, briefLine, renderExpanded, header, footer, top, afterNeeds, raised, emptyAction, results, hits = null, activeResult = 0, onResult, filter = null, overseer = null, stackOverseer = false, asking = false, menu, onSendNow, keys, selectedBg }: HomeListProps) {
100
101
  const c = theme.colors;
102
+ const onOpen = useRowOpen(keys?.onOpen);
101
103
  const [openMenu, setOpenMenu] = useState<RowMenuOpen | null>(null);
102
104
  const build = menu.build;
103
105
  const onMenu = useMemo<OpenRowMenu>(() => (s, anchor, node, keyboard) => {
@@ -139,7 +141,7 @@ export function HomeList({ model, theme, dense = false, touch, selectedKey, onSe
139
141
  case "hold": return <HoldLine theme={theme} text={item.text} dense={dense} touch={touch} />;
140
142
  // The list's own Row (search-row-is-the-list-row); the keyboard-active result wears the selected style.
141
143
  case "result": return <Row s={item.s} sig={item.s.sig} hit={item.hit} theme={theme} dense={dense} touch={touch} selected={item.index === activeResult} menuOpen={menuKey === item.s.key}
142
- onSelect={pickResult} onMenu={item.archived ? noMenu : onMenu} />;
144
+ onSelect={pickResult} onOpen={onOpen} onMenu={item.archived ? noMenu : onMenu} />;
143
145
  case "ask": return <AskRow ask={item.ask} theme={theme} active={item.index === activeResult} dense={dense} touch={touch} sending={!!asking} onPress={() => onResult?.({ provider: "overseer", key: ASK_KEY, ask: item.ask })} />;
144
146
  case "brief": return <BriefRow theme={theme} line={briefLine ?? ""} selected={!touch && (selectedKey === null || selectedKey === BRIEF_KEY)} touch={touch} onSelect={onSelect} />;
145
147
  case "overseer": return overseer ? <OverseerRow theme={theme} o={overseer} selected={selectedKey === OVERSEER_KEY} touch={touch} stacked={stackOverseer} onSelect={onSelect} selectedBg={selectedBg} /> : null;
@@ -158,12 +160,12 @@ export function HomeList({ model, theme, dense = false, touch, selectedKey, onSe
158
160
  case "row": {
159
161
  const selected = selectedKey === item.key;
160
162
  return <View>
161
- <Row s={item.s} theme={theme} dense={dense} touch={touch} selected={selected} onSelect={onSelect} sig={item.s.sig} onMenu={onMenu} menuOpen={menuKey === item.key} hit={item.hit} onSendNow={onSendNow} selectedBg={selectedBg} />
163
+ <Row s={item.s} theme={theme} dense={dense} touch={touch} selected={selected} onSelect={onSelect} onOpen={onOpen} sig={item.s.sig} onMenu={onMenu} menuOpen={menuKey === item.key} hit={item.hit} onSendNow={onSendNow} selectedBg={selectedBg} />
162
164
  {selected && renderExpanded ? renderExpanded(item.s) : null}
163
165
  </View>;
164
166
  }
165
167
  }
166
- }, [theme, c, dense, touch, selectedKey, onSelect, briefLine, renderExpanded, toggle, toggleProject, activeResult, onResult, pickResult, model, overseer?.state, overseer?.line, overseer?.ranges, stackOverseer, asking, afterNeeds, raised, emptyAction, onMenu, menuKey, onSendNow, selectedBg]);
168
+ }, [theme, c, dense, touch, selectedKey, onSelect, briefLine, renderExpanded, toggle, toggleProject, activeResult, onResult, pickResult, model, overseer?.state, overseer?.line, overseer?.ranges, stackOverseer, asking, afterNeeds, raised, emptyAction, onMenu, menuKey, onSendNow, selectedBg, onOpen]);
167
169
 
168
170
  const listRef = useRef<NativeFlatList<Entry>>(null);
169
171
  const rootRef = useRef<View>(null);
@@ -327,10 +329,14 @@ export function marks(text: string, ranges: Range[] | null | undefined, c: Color
327
329
  * passes `hit`: the matched words are highlighted where they already are (title, "› agent", the ask line), and a match
328
330
  * in a field the row doesn't show replaces line 2 with "<Field> · excerpt", so a result is exactly as tall as the row.
329
331
  */
330
- type RowProps = { s: Workstream; sig: string; theme: Theme; dense: boolean; touch: boolean; selected: boolean; onSelect: (key: string) => void; onMenu: OpenRowMenu; menuOpen?: boolean; hit?: RowHit | null; onSendNow?: (s: Workstream) => Promise<void>; selectedBg?: string };
331
- const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMenu, menuOpen = false, hit = null, onSendNow, selectedBg }: RowProps) {
332
+ type RowProps = { s: Workstream; sig: string; theme: Theme; dense: boolean; touch: boolean; selected: boolean; onSelect: (key: string) => void; onOpen?: (key: string) => void; onMenu: OpenRowMenu; menuOpen?: boolean; hit?: RowHit | null; onSendNow?: (s: Workstream) => Promise<void>; selectedBg?: string };
333
+ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onOpen, onMenu, menuOpen = false, hit = null, onSendNow, selectedBg }: RowProps) {
332
334
  const c = theme.colors;
333
335
  const trigger = useRowMenuTrigger(s, onMenu, touch);
336
+ useEffect(() => {
337
+ if (touch || menuOpen || !onOpen) return;
338
+ return bindRowDoubleClick(trigger.ref.current as unknown as Parameters<typeof bindRowDoubleClick>[0], () => onOpen(s.key));
339
+ }, [touch, menuOpen, onOpen, s.key, trigger.ref]);
334
340
  const archived = s.icon === "Archive" && s.sig.startsWith("archived:");
335
341
  // An Older row is demoted at one level: its title muted, and its glyph and chips keep their hue at 60 % (still
336
342
  // readable as an error or a review), never full red beside a grey title.
@@ -342,11 +348,13 @@ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMe
342
348
  // match (about 44 characters, the match near the start), so the highlight is never past the "…". Phones and the
343
349
  // sidebar view wrap to two lines and keep more.
344
350
  const shownLine = hit?.lineRanges ? (() => { const e = excerpt(s.line, hit.lineRanges, touch ? 140 : dense ? 90 : 44); return marks(e.text, e.ranges, c); })() : s.line;
345
- const line: ReactNode = s.word && s.group !== "needs" ? (s.line ? <>{s.word} · {shownLine}</> : s.word) : shownLine;
351
+ // What the agent is working on (shared/now.ts) leads, in the title's colour; its place ("2 of 4") and the state stay muted.
352
+ const lead = s.lead ? <><Text style={{ color: muted ? c.foregroundMuted : c.foreground }}>{s.lead.text}</Text>{s.lead.position ? `\u00a0${s.lead.position}` : ""}{s.line ? " · " : ""}</> : null;
353
+ const line: ReactNode = s.word && s.group !== "needs" ? (s.line ? <>{s.word} · {lead}{shownLine}</> : s.word) : <>{lead}{shownLine}</>;
346
354
  const via = hit?.via ? (() => { const e = excerpt(hit.via.text, hit.via.ranges, touch ? 90 : dense ? 90 : 44); return <>{FIELD_LABEL[hit.via.field]} · {marks(e.text, e.ranges, c)}</>; })() : null;
347
355
  const title = <>{marks(s.title, hit?.titleRanges, c)}{s.agent ? <Text style={{ color: c.foregroundMuted, fontWeight: "400" }}>{" › "}{marks(s.agent, hit?.agentRanges, c)}</Text> : null}</>;
348
356
  // Phones: "Working" under every row of a "Running 9" group says nothing the header didn't; one line per row instead.
349
- const generic = touch && !s.word && s.line === "Working";
357
+ const generic = touch && !s.word && !s.lead && s.line === "Working";
350
358
  // The reason line: AI priority's, else the workspace's first live Compass note (a live note is a reason).
351
359
  const why = s.priority?.reason ? { reason: s.priority.reason, source: s.priority.source } : s.compass ? { reason: s.compass, source: { kind: "compass" as const, label: "Compass" } } : null;
352
360
  // Send now: outlined (filled is only for what waits on the developer), and only where the server would take it.
@@ -354,7 +362,7 @@ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMe
354
362
  // A Later row says when it comes back on screen; the label also keeps how long it has waited.
355
363
  const wake = s.group === "later" && s.wakeAt ? wakeLabel({ until: s.wakeAt, at: s.at ?? new Date().toISOString() }, Date.now()) : "";
356
364
  const waited = s.group === "later" && s.at ? age(s.at, Date.now()) : "";
357
- const label = [s.title + (s.agent ? ` › ${s.agent}` : ""), s.word, s.line, hit?.via && `${FIELD_LABEL[hit.via.field]}: ${hit.via.text}`,
365
+ const label = [s.title + (s.agent ? ` › ${s.agent}` : ""), s.word, s.lead && [s.lead.text, s.lead.position].filter(Boolean).join(" "), s.line, hit?.via && `${FIELD_LABEL[hit.via.field]}: ${hit.via.text}`,
358
366
  // Every chip, even one a narrow row hides (row-chips-never-cover-the-time).
359
367
  ...s.badges.map(b => b.text), s.pr && prChipSpoken(s.pr), wake && `Later until ${wake}`, waited && (waited === "now" ? "just now" : `waiting ${waited}`)].filter(Boolean).join(". ");
360
368
  return <Pressable ref={trigger.ref} nativeID={rowDomId(s.key)} accessibilityRole="button" accessibilityState={{ selected }} accessibilityLabel={label} accessibilityHint={quickActionsHint(touch)}
@@ -373,7 +381,7 @@ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMe
373
381
  <View style={{ paddingTop: 2 }}><RowTime s={s} c={c} size={12} /></View>
374
382
  </View>
375
383
  {via ? <Text numberOfLines={2} style={{ color: c.foregroundMuted, fontSize: 13, lineHeight: 18 }}>{via}</Text>
376
- : (!!s.word || !!s.line) && !generic && <Text numberOfLines={2} style={{ color: c.foregroundMuted, fontSize: 13, lineHeight: 18 }}>
384
+ : (!!s.word || !!s.line || !!s.lead) && !generic && <Text numberOfLines={2} style={{ color: c.foregroundMuted, fontSize: 13, lineHeight: 18 }}>
377
385
  {s.word && s.group === "needs" ? <Text style={{ color, fontWeight: "600" }}>{s.word}</Text> : null}{s.word && s.group === "needs" && s.line ? " · " : ""}{line}
378
386
  </Text>}
379
387
  {!!why && <PriorityLine reason={why.reason} source={why.source} c={c} size={12} lines={2} />}
@@ -382,7 +390,7 @@ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMe
382
390
  </View> : dense ? <View style={{ flex: 1, minWidth: 0, gap: 1 }}>
383
391
  <Text numberOfLines={1} style={{ color: muted ? c.foregroundMuted : c.foreground, fontSize: 13, lineHeight: 18, fontWeight: muted ? "400" : "500" }}>{title}</Text>
384
392
  {via ? <Text numberOfLines={2} style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>{via}</Text>
385
- : (!!s.word || !!s.line) && <Text numberOfLines={2} style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>
393
+ : (!!s.word || !!s.line || !!s.lead) && <Text numberOfLines={2} style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>
386
394
  {s.word && s.group === "needs" ? <Text style={{ color, fontWeight: "600" }}>{s.word}</Text> : null}{s.word && s.group === "needs" && s.line ? " · " : ""}{line}
387
395
  </Text>}
388
396
  {!!why && <PriorityLine reason={why.reason} source={why.source} c={c} size={11} lines={2} />}
@@ -404,7 +412,7 @@ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMe
404
412
  </View>{!!why && <View style={{ paddingRight: 40 }}><PriorityLine reason={why.reason} source={why.source} c={c} /></View>}</View>}
405
413
  {!touch && <RowTime s={s} c={c} size={dense ? 11 : 12} />}
406
414
  </Pressable>;
407
- }, (a, b) => a.sig === b.sig && a.selected === b.selected && a.theme === b.theme && a.dense === b.dense && a.touch === b.touch && a.onSelect === b.onSelect && a.onMenu === b.onMenu && a.menuOpen === b.menuOpen && a.hit === b.hit && a.onSendNow === b.onSendNow && a.selectedBg === b.selectedBg);
415
+ }, (a, b) => a.sig === b.sig && a.selected === b.selected && a.theme === b.theme && a.dense === b.dense && a.touch === b.touch && a.onSelect === b.onSelect && a.onOpen === b.onOpen && a.onMenu === b.onMenu && a.menuOpen === b.menuOpen && a.hit === b.hit && a.onSendNow === b.onSendNow && a.selectedBg === b.selectedBg);
408
416
 
409
417
  /** The machine-wide auto-send hold, once above Sending's rows: the same words on every width (shared/sending.ts). */
410
418
  function HoldLine({ theme, text: line, dense, touch }: { theme: Theme; text: string; dense: boolean; touch: boolean }) {
@@ -1,7 +1,7 @@
1
1
  import type { DispatchRecord } from "../shared/dispatch";
2
2
  import type { PluginClientContext } from "@getpaseo/plugin/client";
3
3
  import type { ImageUpload } from "../shared/images";
4
- import { contextAskRpc, contextListRpc, dispatchRecordsRpc, displayFeed, homeFeed, queueNeedsSchema, overseerAskRpc, overseerRestartRpc, overseerStartRpc, overseerStatusRpc, prioritiesRpc, prStatsSettingsRpc, rankNowRpc, rankStatusRpc, usageRpc } from "../shared/contracts";
4
+ import { contextAskRpc, contextListRpc, questionActionRpc, dispatchRecordsRpc, displayFeed, homeFeed, queueNeedsSchema, overseerAskRpc, overseerRestartRpc, overseerStartRpc, overseerStatusRpc, prioritiesRpc, prStatsSettingsRpc, rankNowRpc, rankStatusRpc, usageRpc } from "../shared/contracts";
5
5
  import { openFeed } from "./feeds";
6
6
  import type { RpcInput, RpcOutput } from "@getpaseo/plugin";
7
7
  import type { Priority } from "../shared/priorities";
@@ -289,6 +289,13 @@ export function createHomeExtras(client: PluginClientContext) {
289
289
  setContext([...context.filter(r => r.id !== out.request.id), out.request]); emit();
290
290
  return out;
291
291
  },
292
+ /** Your questions: Done, Reply, Make a task, Withdraw. The question (and a reply's new one) show at once. */
293
+ async questionAction(input: RpcInput<typeof questionActionRpc>) {
294
+ const out = await client.rpc(questionActionRpc, input);
295
+ const next = context.map(r => r.id === out.request.id ? out.request : r);
296
+ setContext(out.reply ? [...next.filter(r => r.id !== out.reply!.id), out.reply] : next); emit();
297
+ return out;
298
+ },
292
299
  agents: () => [...agents.values()],
293
300
  /**
294
301
  * The one owner of "put the caret in Home's search" (every-search-request-lands-in-the-visible-search): the search
package/client/home.tsx CHANGED
@@ -1,4 +1,5 @@
1
1
  import { type ReactNode, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
2
+ import { usePagedList } from "./paged-list";
2
3
  import { browserKey } from "./keys";
3
4
  import { Platform, TextInput, useWindowDimensions, View } from "react-native";
4
5
  import { AttachImageButton, ImageAttachmentsRow, ImageField, useImageAttachments } from "./image-attach";
@@ -27,6 +28,7 @@ import type { NewKey } from "./search-key";
27
28
  import { DockedPane } from "./docked-pane";
28
29
  import type { DockState } from "./dock";
29
30
  import { NeedsYouBlock } from "./needs-you";
31
+ import { YourQuestionsCard, useWorkspaceRunning } from "./your-questions";
30
32
  import { HeldMerges } from "./merge-button";
31
33
  import { PrSheet } from "./pr-sheet";
32
34
  import { StatsPage, type StatsParams } from "./pr-stats";
@@ -41,15 +43,19 @@ import { useHomeModel, useTick, type HomeSources } from "./home-data";
41
43
  import { laterLabel, useInbox, UndoBar, useNextRelay } from "./inbox";
42
44
  import { Spinner } from "./motion";
43
45
  import { Setup, SetupOffer, useOnboarding } from "./onboarding";
46
+ import { FinishSetupLine, SetupGate } from "./setup-gate";
47
+ import { reopenSetup, setupClosed } from "./setup-ui";
48
+ import { finishSetupLine } from "../shared/setup-popup";
44
49
  import type { OnboardingView } from "../shared/onboarding";
45
50
  import { withAlpha, isLight, mergedColor, type Colors } from "./theme";
46
51
  import { UpdateNotice, VersionMark } from "./updates";
47
52
  import { WhatsNewGate } from "./release-notes";
48
- import { ViewSync } from "./view-store";
53
+ import { ViewSync, useViewVersion } from "./view-store";
49
54
  import { CatchUp, CatchUpButton, KeysSheet } from "./catch-up";
50
55
  import { searchEnter } from "../shared/list-keys";
51
56
  import { HOME_KEYS } from "../shared/home-keys";
52
57
  import { deckCards } from "../shared/catch-up";
58
+ import { questionsByWorkspace } from "../shared/your-questions";
53
59
  import { ResizableSplit } from "./split";
54
60
  import type { SearchKey } from "./search-key";
55
61
 
@@ -102,13 +108,15 @@ export type HomeDeps = {
102
108
  const PANE_PRIMARY = "follow-up-pane-primary";
103
109
 
104
110
  export function FollowHome(props: PluginScreenProps & { deps: HomeDeps }) {
105
- // Getting started takes Home's place on a fresh install (or after "Set up Follow-up again") until finished or skipped.
111
+ // Setup is a popup over Home (setup-is-one-popup): Home keeps only its Finish setup line once Close puts it away.
106
112
  const onboarding = useOnboarding();
107
113
  // Opened from "Set up again": read the flow's state afresh.
108
114
  const { refetch } = onboarding;
109
- useEffect(() => { if (props.params?.setup) void refetch(); }, [props.params?.setup, refetch]);
110
- if (onboarding.data?.show) return <Setup theme={props.theme} compact={props.layout.compact} view={onboarding.data} deps={{ openSettings: props.deps.openSettings }} />;
111
- return <HomeBody {...props} onboarding={onboarding.data} />;
115
+ useEffect(() => { if (props.params?.setup) { reopenSetup(); void refetch(); } }, [props.params?.setup, refetch]);
116
+ return <>
117
+ <HomeBody {...props} onboarding={onboarding.data} />
118
+ <SetupGate surface="home" theme={props.theme} compact={props.layout.compact} deps={{ openSettings: props.deps.openSettings, openHome: props.deps.openHome }} />
119
+ </>;
112
120
  }
113
121
 
114
122
  function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: OnboardingView | undefined }) {
@@ -120,6 +128,9 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
120
128
  // them on the home feed; the model counts them (model.raised) and they head the group. Catch up's deck and
121
129
  // model.needs stay workspaces.
122
130
  const model = useHomeModel(deps.sources);
131
+ // The setup row: an existing install's offer, or Finish setup once Close has put setup's popup away.
132
+ useViewVersion();
133
+ const setupRow = !!props.onboarding?.offer || !!finishSetupLine(props.onboarding, setupClosed());
123
134
  const queue = useSyncExternalStore(deps.sources.extras.subscribe, deps.sources.extras.queue, deps.sources.extras.queue);
124
135
  const raisedKeys = useMemo(() => new Set(queue.needs.map(r => r.key)), [queue.needs]);
125
136
  const omnibox = useOmnibox(model, deps.sources);
@@ -150,7 +161,9 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
150
161
  const tracked = useSyncExternalStore(deps.sources.live.subscribe, deps.sources.live.version, deps.sources.live.version);
151
162
  const rows = useInbox(inbox, () => inbox.rows());
152
163
  // Go through's count is its cards (one per ask), the same deck the mode opens on.
153
- const deckSize = useMemo(() => deckCards({ model, rows, items: id => { const w = deps.sources.live.get(id); return w ? needsYou(w as never) : []; } }).length, [model, rows, tracked, deps.sources.live]);
164
+ // Your questions: each unread answer is a card too (shared deckCards), so the button counts what Catch up deals.
165
+ const questions = useSyncExternalStore(deps.sources.extras.subscribe, deps.sources.extras.context, deps.sources.extras.context);
166
+ const deckSize = useMemo(() => { const unread = questionsByWorkspace(questions); return deckCards({ model, rows, items: id => { const w = deps.sources.live.get(id); return w ? needsYou(w as never) : []; }, answers: id => unread.get(id)?.unread ?? [] }).length; }, [model, rows, tracked, deps.sources.live, questions]);
154
167
  const pane = useMemo(() => briefPane({ model, rows, tracked: deps.sources.live.all(), now: Date.now() }), [model, rows, tracked, deps.sources.live]);
155
168
  const rank = useSyncExternalStore(deps.sources.extras.subscribe, deps.sources.extras.rank, deps.sources.extras.rank);
156
169
  const overseerStatus = useSyncExternalStore(deps.sources.extras.subscribe, deps.sources.extras.overseer, deps.sources.extras.overseer);
@@ -289,7 +302,7 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
289
302
  : undefined}
290
303
  // Phones: the setup offer goes after the Needs-you group when there is one, so the first ask stays high.
291
304
  raised={<NobodyRows theme={theme} compact={compact} data={queue} onDismissed={deps.sources.extras.refreshQueue} />}
292
- afterNeeds={compact && model.needs > 0 && props.onboarding?.offer ? <SetupOffer theme={theme} compact view={props.onboarding} /> : undefined}
305
+ afterNeeds={compact && model.needs > 0 && setupRow ? <><SetupOffer theme={theme} compact view={props.onboarding} /><FinishSetupLine theme={theme} compact /></> : undefined}
293
306
  emptyAction={<Button theme={theme} compact={compact} kind="primary" icon="Plus" title={NEW_NAME} onPress={() => openNew()} />}
294
307
  top={<ListTop theme={theme} dense={compact} title={compact ? undefined : <ListHeader theme={theme} compact={compact} onSettings={deps.openSettings} onKeys={() => setKeysOpen(v => !v)} onStats={openStats} onNew={() => openNew()} newLabel={newLabel} />}>
295
308
  {/* zIndex: on web every View is its own stacking context, so the sort menu only paints and hit-tests above the
@@ -310,7 +323,7 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
310
323
  {!omnibox.results && dispatchRows}
311
324
  {!compact && !omnibox.results && <StatusStrip theme={theme} model={model} filter={filter} onFilter={setFilter} touch={compact} dense={compact} />}
312
325
  {!compact && !omnibox.results && <UsageMeters theme={theme} sources={deps.sources} dense={compact} hold={!!model.hold} />}
313
- {!compact && !omnibox.results && <SetupOffer theme={theme} compact={compact} view={props.onboarding} />}
326
+ {!compact && !omnibox.results && <><SetupOffer theme={theme} compact={compact} view={props.onboarding} /><FinishSetupLine theme={theme} compact={compact} /></>}
314
327
  </ListTop>}
315
328
  // Phones: only the search row stays pinned; the status chips and the setup offer scroll away with the list, so a
316
329
  // scrolled list keeps the screen instead of sitting under a 250px block.
@@ -320,7 +333,7 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
320
333
  <StatusStrip theme={theme} model={model} filter={filter} onFilter={setFilter} touch dense />
321
334
  {model.needs > 0 && deps.openCatchUp && <View style={{ paddingHorizontal: 16 }}><CatchUpButton theme={theme} compact count={deckSize} onPress={deps.openCatchUp} /></View>}
322
335
  {updateNotice}
323
- {model.needs === 0 && <SetupOffer theme={theme} compact view={props.onboarding} />}
336
+ {model.needs === 0 && <><SetupOffer theme={theme} compact view={props.onboarding} /><FinishSetupLine theme={theme} compact /></>}
324
337
  </View> : updateNotice} />;
325
338
 
326
339
  if (compact) return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
@@ -668,6 +681,7 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
668
681
  // Only a real ask joins it (shared briefAsks): a done brief on a row flagged for something else stays out of the count.
669
682
  const inBlock = !!w && !!showBrief && !later && briefAsks(b, row);
670
683
 
684
+ const running = useWorkspaceRunning(deps.sources.paseo, w?.id ?? "");
671
685
  // Home's detail pane is the selected workspace: every x in it shows without hover (client/dismiss.tsx).
672
686
  return <DismissReveal.Provider value="always"><DockedPane compact={compact} header={header} style={{ backgroundColor: c.surface0 }} contentContainerStyle={{ padding: compact ? 16 : 20, gap: 16, paddingBottom: 24 }}
673
687
  dock={({ yields, typingInContent }) => s.agentId && !typingInContent && <View nativeID={compact ? TOAST_ANCHOR : undefined} style={[{ borderTopWidth: 1, borderTopColor: c.border, backgroundColor: c.surface0 }, bottomInset(compact)]}>
@@ -686,6 +700,8 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
686
700
  {w && <NeedsYouBlock workspace={w} theme={theme} compact={compact} now={Date.now()} style={{ marginHorizontal: 0, marginTop: 0 }}
687
701
  brief={inBlock ? b : null} briefCard={inBlock && <BriefCard {...({ embedded: true, bare: true, item: { data: b }, theme, layout: { compact }, agentId: s.agentId, deps: deps.briefDeps } as unknown as Parameters<typeof BriefCard>[0])} />}
688
702
  actions={{ openPr: (key, intent) => setSheet({ key, intent }), openQuestion: setQuestion, openAgent: () => openFull(s) }} />}
703
+ {w && <YourQuestionsCard workspaceId={w.id} mainAgentId={w.mainAgentId} theme={theme} compact={compact} style={{ marginHorizontal: 0, marginTop: 0 }}
704
+ openAgent={openAgent} running={running} foldAsk={compact && !!s.agentId} />}
689
705
  {w && <HeldMerges workspace={w} theme={theme} compact={compact} />}
690
706
  {actionBar}
691
707
  {laterBlock}
@@ -966,6 +982,8 @@ function LogView({ theme, compact, sources, onHome, onOpen }: { theme: Theme; co
966
982
  const since = useMemo(() => days ? Date.now() - days * 86_400_000 : lastWorkdayEnd(Date.now()), [days]);
967
983
  const lines = useMemo(() => followUpLog(sources.live.all(), since), [version, since, sources.live]);
968
984
  const needs = sources.inbox.rows().filter(r => r.needs && !r.snooze).length;
985
+ // A week of a busy host is hundreds of lines: pages (client/paged-list.tsx), a new window starts at page 1.
986
+ const page = usePagedList({ items: lines, resetKey: String(days), theme, compact, noun: "lines" });
969
987
  return <ScrollView style={{ flex: 1, backgroundColor: c.surface0 }} contentContainerStyle={{ padding: compact ? 16 : 28, gap: 12, maxWidth: 820, width: "100%", alignSelf: "center" }}>
970
988
  <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
971
989
  <Button theme={theme} compact={compact} kind="ghost" icon="House" title="Home" onPress={onHome} />
@@ -977,7 +995,8 @@ function LogView({ theme, compact, sources, onHome, onOpen }: { theme: Theme; co
977
995
  <Text style={[t.body, { flex: 1 }]}>{needs ? `${needs} thing${needs === 1 ? "" : "s"} it left for you are on Home.` : "Nothing is waiting for you on Home."}</Text>
978
996
  <Icon name="ChevronRight" size={14} color={c.foregroundMuted} />
979
997
  </Pressable>
980
- {lines.length ? lines.map(l => <LogRow key={l.key} l={l} c={c} onOpen={() => onOpen(`agent:${l.agentId}`)} />) : <Text style={t.meta}>Nothing in this window.</Text>}
998
+ {lines.length ? page.shown.map(l => <LogRow key={l.key} l={l} c={c} onOpen={() => onOpen(`agent:${l.agentId}`)} />) : <Text style={t.meta}>Nothing in this window.</Text>}
999
+ {page.footer}
981
1000
  {!days && <Button theme={theme} compact={compact} kind="ghost" title="Show the last 7 days" onPress={() => setDays(7)} />}
982
1001
  </ScrollView>;
983
1002
  }
package/client/keys.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  /** React Query keys shared by every surface that reads Follow-up state. */
2
2
  export const workspaceKey = (id: string) => ["follow-up", "workspace", id];
3
3
  export const overviewKey = ["follow-up", "overview"];
4
+ /** One page of a workspace's Activity card (follow.activity), keyed by the workspace's revision so a change re-reads it. */
5
+ export const activityKey = (id: string, rev: string, tab: string, query: string, offset: number, limit: number) => ["follow-up", "activity", id, rev, tab, query, offset, limit];
4
6
  /** The browser extension's connection status: one shared query, read when a PR sheet, the panel or the pill opens (never polled). */
5
7
  export const browserKey = ["follow-up", "browser"];
6
8
  /** An agent's live brief (follow.inbox-brief): one query per agent, shared by every brief card in its chat. */