paseo-follow-up 2.6.0-beta.1 → 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 (65) hide show
  1. package/client/brief-since.tsx +4 -3
  2. package/client/catch-up.tsx +56 -15
  3. package/client/header.tsx +5 -3
  4. package/client/home-data.ts +3 -1
  5. package/client/home-list.tsx +19 -11
  6. package/client/home-view.ts +8 -1
  7. package/client/home.tsx +13 -2
  8. package/client/keys.ts +2 -0
  9. package/client/kit.tsx +5 -2
  10. package/client/large.tsx +5 -3
  11. package/client/merge-button.tsx +3 -2
  12. package/client/messages.tsx +5 -1
  13. package/client/more-context.tsx +17 -4
  14. package/client/morning-brief-settings.tsx +5 -4
  15. package/client/needs-you.tsx +5 -4
  16. package/client/new-settings.tsx +7 -6
  17. package/client/now-lines.tsx +60 -0
  18. package/client/onboarding.tsx +5 -5
  19. package/client/paged-list.tsx +115 -0
  20. package/client/panel.tsx +22 -7
  21. package/client/pr-stats-settings.tsx +3 -2
  22. package/client/pr-stats.tsx +10 -10
  23. package/client/questions.tsx +63 -40
  24. package/client/release-notes.tsx +10 -9
  25. package/client/reviewers.tsx +8 -3
  26. package/client/row-open.ts +28 -0
  27. package/client/section-search.tsx +5 -3
  28. package/client/settings.tsx +11 -8
  29. package/client/shipping.tsx +5 -4
  30. package/client/stacks.tsx +11 -3
  31. package/client/tasks.tsx +5 -1
  32. package/client/your-questions.tsx +375 -0
  33. package/index.client.tsx +10 -2
  34. package/index.server.ts +133 -32
  35. package/package.json +1 -1
  36. package/server/agent-actions.ts +23 -14
  37. package/server/agent-hook.mjs +2 -2
  38. package/server/agent-parity.ts +21 -6
  39. package/server/brief-timeline.ts +47 -0
  40. package/server/context-requests.ts +90 -21
  41. package/server/directory.ts +6 -0
  42. package/server/discovery.ts +2 -0
  43. package/server/engine.ts +3 -0
  44. package/server/hook-source.ts +2 -2
  45. package/server/inbox-classifier.ts +17 -0
  46. package/server/inbox.ts +9 -3
  47. package/server/mcp-source.ts +22 -14
  48. package/server/mcp.mjs +22 -14
  49. package/server/obligations.ts +4 -1
  50. package/server/turn-end.ts +4 -1
  51. package/shared/activity.ts +2 -1
  52. package/shared/catch-up.ts +65 -20
  53. package/shared/chat.ts +2 -2
  54. package/shared/contracts.ts +52 -8
  55. package/shared/history.ts +160 -0
  56. package/shared/home-keys.ts +1 -0
  57. package/shared/home.ts +54 -8
  58. package/shared/list.ts +4 -1
  59. package/shared/model.ts +8 -0
  60. package/shared/now.ts +228 -0
  61. package/shared/paged.ts +96 -0
  62. package/shared/sort.ts +8 -1
  63. package/shared/status.ts +3 -1
  64. package/shared/your-questions.ts +133 -0
  65. package/skills/follow-up/SKILL.md +1 -1
@@ -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";
@@ -53,6 +55,7 @@ import { CatchUp, CatchUpButton, KeysSheet } from "./catch-up";
53
55
  import { searchEnter } from "../shared/list-keys";
54
56
  import { HOME_KEYS } from "../shared/home-keys";
55
57
  import { deckCards } from "../shared/catch-up";
58
+ import { questionsByWorkspace } from "../shared/your-questions";
56
59
  import { ResizableSplit } from "./split";
57
60
  import type { SearchKey } from "./search-key";
58
61
 
@@ -158,7 +161,9 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
158
161
  const tracked = useSyncExternalStore(deps.sources.live.subscribe, deps.sources.live.version, deps.sources.live.version);
159
162
  const rows = useInbox(inbox, () => inbox.rows());
160
163
  // Go through's count is its cards (one per ask), the same deck the mode opens on.
161
- 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]);
162
167
  const pane = useMemo(() => briefPane({ model, rows, tracked: deps.sources.live.all(), now: Date.now() }), [model, rows, tracked, deps.sources.live]);
163
168
  const rank = useSyncExternalStore(deps.sources.extras.subscribe, deps.sources.extras.rank, deps.sources.extras.rank);
164
169
  const overseerStatus = useSyncExternalStore(deps.sources.extras.subscribe, deps.sources.extras.overseer, deps.sources.extras.overseer);
@@ -676,6 +681,7 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
676
681
  // Only a real ask joins it (shared briefAsks): a done brief on a row flagged for something else stays out of the count.
677
682
  const inBlock = !!w && !!showBrief && !later && briefAsks(b, row);
678
683
 
684
+ const running = useWorkspaceRunning(deps.sources.paseo, w?.id ?? "");
679
685
  // Home's detail pane is the selected workspace: every x in it shows without hover (client/dismiss.tsx).
680
686
  return <DismissReveal.Provider value="always"><DockedPane compact={compact} header={header} style={{ backgroundColor: c.surface0 }} contentContainerStyle={{ padding: compact ? 16 : 20, gap: 16, paddingBottom: 24 }}
681
687
  dock={({ yields, typingInContent }) => s.agentId && !typingInContent && <View nativeID={compact ? TOAST_ANCHOR : undefined} style={[{ borderTopWidth: 1, borderTopColor: c.border, backgroundColor: c.surface0 }, bottomInset(compact)]}>
@@ -694,6 +700,8 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
694
700
  {w && <NeedsYouBlock workspace={w} theme={theme} compact={compact} now={Date.now()} style={{ marginHorizontal: 0, marginTop: 0 }}
695
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])} />}
696
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} />}
697
705
  {w && <HeldMerges workspace={w} theme={theme} compact={compact} />}
698
706
  {actionBar}
699
707
  {laterBlock}
@@ -974,6 +982,8 @@ function LogView({ theme, compact, sources, onHome, onOpen }: { theme: Theme; co
974
982
  const since = useMemo(() => days ? Date.now() - days * 86_400_000 : lastWorkdayEnd(Date.now()), [days]);
975
983
  const lines = useMemo(() => followUpLog(sources.live.all(), since), [version, since, sources.live]);
976
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" });
977
987
  return <ScrollView style={{ flex: 1, backgroundColor: c.surface0 }} contentContainerStyle={{ padding: compact ? 16 : 28, gap: 12, maxWidth: 820, width: "100%", alignSelf: "center" }}>
978
988
  <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
979
989
  <Button theme={theme} compact={compact} kind="ghost" icon="House" title="Home" onPress={onHome} />
@@ -985,7 +995,8 @@ function LogView({ theme, compact, sources, onHome, onOpen }: { theme: Theme; co
985
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>
986
996
  <Icon name="ChevronRight" size={14} color={c.foregroundMuted} />
987
997
  </Pressable>
988
- {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}
989
1000
  {!days && <Button theme={theme} compact={compact} kind="ghost" title="Show the last 7 days" onPress={() => setDays(7)} />}
990
1001
  </ScrollView>;
991
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. */
package/client/kit.tsx CHANGED
@@ -182,7 +182,9 @@ export function Card({ theme, icon, title, tone = "plain", count, right, childre
182
182
  const accent = tone === "attention" ? c.statusWarning : tone === "success" ? c.statusSuccess : null;
183
183
  const head = { flexDirection: "row", alignItems: "center", gap: compact ? 8 : 7, paddingHorizontal: compact ? 14 : 12, paddingTop: 10, paddingBottom: fold && !fold.open ? 10 : 8, minHeight: compact ? 44 : undefined } as const;
184
184
  const inner = <>
185
- {typeof icon === "string" ? <Icon name={icon} size={compact ? 16 : 14} color={accent ?? c.foregroundMuted} /> : <Icon icon={icon} size={compact ? 16 : 14} color={accent ?? c.foregroundMuted} />}
185
+ {/* The icon never shrinks: a header whose title, tabs and search run wider than the card (Activity on a narrow
186
+ panel) squeezed it to a sliver, a stray mark before the title. */}
187
+ <View style={{ flexShrink: 0 }}>{typeof icon === "string" ? <Icon name={icon} size={compact ? 16 : 14} color={accent ?? c.foregroundMuted} /> : <Icon icon={icon} size={compact ? 16 : 14} color={accent ?? c.foregroundMuted} />}</View>
186
188
  {search ?? <>
187
189
  <Text accessibilityRole="header" style={{ color: accent ?? c.foreground, fontSize: compact ? 14 : 13, lineHeight: compact ? 20 : 18, fontWeight: "600" }}>{title}</Text>
188
190
  {count !== undefined && count !== "" && <Chip theme={theme} color={accent ?? c.foregroundMuted} label={String(count)} />}
@@ -191,7 +193,8 @@ export function Card({ theme, icon, title, tone = "plain", count, right, childre
191
193
  {fold && <Icon name={fold.open ? "ChevronUp" : "ChevronDown"} size={14} color={c.foregroundMuted} />}
192
194
  </>}
193
195
  </>;
194
- return <View style={[{ marginHorizontal: compact ? 16 : 12, marginTop: 12, borderRadius: 8, overflow: "hidden", backgroundColor: c.surface0 },
196
+ // dataSet: a paged list inside turns its page back to this card's header (client/paged-list.tsx, toListStart).
197
+ return <View {...({ dataSet: { pagedTop: "1" } } as object)} style={[{ marginHorizontal: compact ? 16 : 12, marginTop: 12, borderRadius: 8, overflow: "hidden", backgroundColor: c.surface0 },
195
198
  accent ? { borderWidth: 1, borderColor: withAlpha(accent, 0.7) } : raised(c), style]}>
196
199
  {fold ? <Pressable accessibilityRole="button" aria-expanded={fold.open} accessibilityState={{ expanded: fold.open }} accessibilityLabel={`${title}: ${fold.label}. ${fold.open ? "Hide" : "Show"} them`} onPress={fold.onToggle}
197
200
  style={state => ({ ...head, backgroundColor: state.pressed ? c.surface2 : (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>{inner}</Pressable>
package/client/large.tsx CHANGED
@@ -1,9 +1,11 @@
1
+ import type { InboxStore } from "./inbox-store";
1
2
  import { useEffect } from "react";
2
3
  import { Platform, View } from "react-native";
3
4
  import { Text } from "./text";
4
5
  import { type PluginScreenProps } from "@getpaseo/plugin/client";
5
6
  import { useWorkspace } from "./workspace-data";
6
7
  import type { LiveStore } from "./live";
8
+ import type { PaseoWorkspaces } from "./home-data";
7
9
  import { Button, Card, CardRow, errorText, text } from "./kit";
8
10
  import { Skeleton } from "./motion";
9
11
  import { FOLLOW_UP_ICON } from "./follow-up-icon";
@@ -15,7 +17,7 @@ export const LARGE_SCREEN = "follow-up-workspace";
15
17
  * The panel opened as a Paseo screen: the host supplies the page, header and close button, and the
16
18
  * layout switches to two columns. Collapse (or Esc) returns to the workspace, where the panel still is.
17
19
  */
18
- export function FollowLarge(props: PluginScreenProps & PanelLinks & { live?: LiveStore }) {
20
+ export function FollowLarge(props: PluginScreenProps & PanelLinks & { live?: LiveStore; /** Paseo's workspace list: the running state Your questions shows. */ paseo?: PaseoWorkspaces; inbox?: InboxStore }) {
19
21
  const { theme, layout, params, navigation } = props;
20
22
  const workspaceId = params.workspaceId ?? "";
21
23
  const c = theme.colors;
@@ -52,9 +54,9 @@ export function FollowLarge(props: PluginScreenProps & PanelLinks & { live?: Liv
52
54
  </CardRow>
53
55
  </Card>
54
56
  </View>;
55
- return <WorkspaceView theme={theme} layout={layout} host={props.host} navigation={navigation} workspace={w} large
57
+ return <WorkspaceView theme={theme} layout={layout} host={props.host} navigation={navigation} workspace={w} large inbox={props.inbox}
56
58
  loadError={query.error ? "Refresh failed. Showing the last saved state." : query.loadError}
57
- openSettings={props.openSettings} openOverview={props.openOverview} folds={folds}
59
+ openSettings={props.openSettings} openOverview={props.openOverview} folds={folds} paseo={props.paseo}
58
60
  top={<PanelTop theme={theme} compact={layout.compact} openOverview={props.openOverview} openSettings={props.openSettings} />}
59
61
  resize={navigation ? { icon: "Minimize2", label: "Back to the workspace (Esc)", onPress: back } : null} />;
60
62
  }
@@ -1,4 +1,5 @@
1
1
  import { useState, type ReactNode } from "react";
2
+ import { PagedRows } from "./paged-list";
2
3
  import { useRpc } from "@getpaseo/plugin/client";
3
4
  import { useToast } from "@getpaseo/plugin/client/ui";
4
5
  import { useMutation, useQueryClient } from "@tanstack/react-query";
@@ -97,9 +98,9 @@ export function HeldMerges({ workspace: w, theme, compact, now = Date.now(), fra
97
98
  if (!held.length) return null;
98
99
  const c = theme.colors; const t = text(c, compact);
99
100
  return <PrLinksProvider prs={prLinksByNumber(w.prs)}><View accessibilityRole="summary" style={framed ? { paddingHorizontal: 12, paddingVertical: 8, borderTopWidth: 1, borderTopColor: c.border, gap: 6 } : { gap: 6 }}>
100
- {held.map(h => <View key={h.pr.key} style={{ flexDirection: "row", gap: 8 }}>
101
+ <PagedRows items={held} theme={theme} compact={compact} noun="PRs" row={h => <View key={h.pr.key} style={{ flexDirection: "row", gap: 8 }}>
101
102
  <View style={{ paddingTop: 2 }}><Icon name="Clock" size={13} color={c.foregroundMuted} /></View>
102
103
  <RichText linkColor={c.foreground} style={[t.meta, { flex: 1 }]}>{h.line}</RichText>
103
- </View>)}
104
+ </View>} />
104
105
  </View></PrLinksProvider>;
105
106
  }