paseo-follow-up 2.4.0-beta.0 → 2.4.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.tsx +27 -14
  2. package/client/header.tsx +9 -4
  3. package/client/home-list.tsx +8 -7
  4. package/client/home-view.ts +11 -2
  5. package/client/home.tsx +30 -9
  6. package/client/inbox.tsx +5 -5
  7. package/client/merge-button.tsx +1 -1
  8. package/client/morning-brief-settings.tsx +266 -0
  9. package/client/needs-you.tsx +4 -3
  10. package/client/pr-stats-settings.tsx +228 -0
  11. package/client/pr-stats.tsx +360 -0
  12. package/client/questions.tsx +34 -19
  13. package/client/settings.tsx +7 -0
  14. package/index.client.tsx +7 -1
  15. package/index.server.ts +247 -11
  16. package/package.json +2 -1
  17. package/server/agent-actions.ts +34 -2
  18. package/server/agent-hook.mjs +35 -6
  19. package/server/agent-parity.ts +37 -0
  20. package/server/check-watches.ts +145 -0
  21. package/server/dispatch.ts +420 -0
  22. package/server/engine.ts +13 -2
  23. package/server/github.ts +15 -2
  24. package/server/hook-source.ts +35 -6
  25. package/server/linear-issues.ts +121 -0
  26. package/server/linear-queue.ts +224 -0
  27. package/server/mcp-source.ts +34 -10
  28. package/server/mcp.mjs +34 -10
  29. package/server/morning-brief.ts +233 -0
  30. package/server/obligations.ts +25 -3
  31. package/server/overseer-prompt-source.ts +1 -1
  32. package/server/overseer-prompt.md +1 -1
  33. package/server/overseer.ts +46 -2
  34. package/server/pr-stats-gate.ts +102 -0
  35. package/server/pr-stats-store.ts +196 -0
  36. package/server/pr-stats-sync.ts +228 -0
  37. package/server/pr-stats.ts +309 -0
  38. package/server/questions.ts +57 -12
  39. package/server/ranker.ts +33 -69
  40. package/server/wait-for-checks.ts +108 -0
  41. package/shared/attention.ts +6 -5
  42. package/shared/brief.ts +1 -1
  43. package/shared/chat.ts +3 -2
  44. package/shared/check-watch.ts +129 -0
  45. package/shared/contracts.ts +56 -2
  46. package/shared/dispatch.ts +429 -0
  47. package/shared/home.ts +28 -10
  48. package/shared/inbox.ts +38 -3
  49. package/shared/linear-issues.ts +137 -0
  50. package/shared/linear-queue.ts +315 -0
  51. package/shared/list-entries.ts +5 -0
  52. package/shared/model.ts +22 -2
  53. package/shared/morning-brief.ts +346 -0
  54. package/shared/poll.ts +9 -2
  55. package/shared/pr-stats-page.ts +110 -0
  56. package/shared/pr-stats-records.ts +169 -0
  57. package/shared/pr-stats-settings.ts +217 -0
  58. package/shared/pr-stats.ts +377 -0
  59. package/shared/questions.ts +136 -1
  60. package/shared/queue.ts +1 -1
  61. package/shared/ranker.ts +32 -25
  62. package/shared/settings-nav.ts +2 -1
  63. package/shared/status-invariants.ts +69 -3
  64. package/shared/task-status.ts +10 -3
  65. package/shared/workweek.ts +24 -0
package/client/brief.tsx CHANGED
@@ -16,7 +16,7 @@ const word = (kind: Brief["kind"]) => HEADLINE_WORD[briefKey(kind)];
16
16
  import { answerQuestionRpc, briefActionRpc, browserStatusRpc, inboxBriefRpc } from "../shared/contracts";
17
17
  import { errorText, mootNote } from "../shared/errors";
18
18
  import { PRIMARY_FORM } from "./dock";
19
- import { OTHER, OTHER_LABEL, OWN_ANSWER_HINT, briefAnswerStatus, isOther, type Question } from "../shared/questions";
19
+ import { OTHER, OTHER_LABEL, OWN_ANSWER_HINT, briefAnswerStatus, isDoneOnly, isOpen, isOther, TASK_DONE, type Question } from "../shared/questions";
20
20
  import type { ListQuestion, ListWorkspace } from "../shared/list";
21
21
  import { useDetailGate, useWorkspace } from "./workspace-data";
22
22
  import { SubmitScope, focusRing, submitHint, text, useNow } from "./kit";
@@ -157,7 +157,9 @@ export function NoteLink({ icon, label, a11y, disabled, onPress, c, compact }: {
157
157
  * The card's body: decisions, error text, details, context, facts and links, and the agent's extra ask. Shared by the
158
158
  * open card and by a past card's read-only "Show full question", so a past question reads exactly as it was asked.
159
159
  */
160
- function BriefBody({ b, c, compact, tight, embedded, height, mode, picks, onPick, busy, onSend, words = {}, onWords, onSendOther, notes = {}, notesOpen = {}, onNote, onNoteOpen }: {
160
+ function BriefBody({ b, c, compact, tight, embedded, height, mode, picks, onPick, busy, onSend, words = {}, onWords, onSendOther, notes = {}, notesOpen = {}, onNote, onNoteOpen, doneIds = [] }: {
161
+ /** one-done-button: decisions answered by the card's Done button (an action card), drawn without option rows. */
162
+ doneIds?: readonly string[];
161
163
  b: Brief; c: Colors; compact: boolean; tight: boolean; embedded: boolean; height: number;
162
164
  mode: "send" | "select" | "readonly"; picks: Record<string, string>; onPick: (decisionId: string, letter: string) => void; busy: string | null; onSend?: (key: string) => void;
163
165
  words?: Record<string, string>; onWords?: (decisionId: string, text: string) => void; onSendOther?: (decisionId: string) => void;
@@ -178,15 +180,15 @@ function BriefBody({ b, c, compact, tight, embedded, height, mode, picks, onPick
178
180
  const showExtra = readonly || !tight || details || extrasFit(b, height);
179
181
  const numbered = b.decisions.length > 1;
180
182
  return <>
181
- {b.decisions.map((d, i) => <View key={d.id} accessibilityRole={mode === "select" ? "radiogroup" : undefined} accessibilityLabel={mode === "select" ? d.question : undefined} style={{ gap: 8 }}>
183
+ {b.decisions.map((d, i) => { const done = !readonly && doneIds.includes(d.id); return <View key={d.id} accessibilityRole={mode === "select" ? "radiogroup" : undefined} accessibilityLabel={mode === "select" ? d.question : undefined} style={{ gap: 8 }}>
182
184
  {(numbered || d.question.trim() !== b.ask.trim()) && <RichText style={{ color: c.foreground, fontSize: 14, lineHeight: 20, fontWeight: numbered ? "600" : "400" }}>{`${numbered ? `${i + 1}. ` : ""}${d.question}`}</RichText>}
183
185
  {d.options.length > 0 && <View style={{ gap: 6 }}>
184
- {d.options.map(o => <OptionRow key={o.letter} option={o} recommended={d.recommend === o.letter} mode={mode} answerLabel={answerLabel} selected={readonly ? d.chosen === o.letter : picks[d.id] === o.letter} answered={readonly && !!d.chosen}
186
+ {!done && d.options.map(o => <OptionRow key={o.letter} option={o} recommended={d.recommend === o.letter} mode={mode} answerLabel={answerLabel} selected={readonly ? d.chosen === o.letter : picks[d.id] === o.letter} answered={readonly && !!d.chosen}
185
187
  sending={busy === `${d.id}:${o.letter}`} disabled={!!busy} tight={tight && !readonly} withNote={!!notesOpen[d.id] && !!notes[d.id]?.trim()}
186
188
  open={!!open[`${d.id}:${o.letter}`]} onToggle={() => setOpen(v => ({ ...v, [`${d.id}:${o.letter}`]: !v[`${d.id}:${o.letter}`] }))}
187
189
  onPress={() => mode === "send" ? onSend?.(`${d.id}:${o.letter}`) : onPick(d.id, o.letter)} c={c} compact={compact} />)}
188
190
  {/* Built in after the agent's options on every decision: the developer's own answer. */}
189
- {(!readonly || isOther(d.chosen)) && <OptionRow other option={{ letter: "", label: OTHER_LABEL, consequence: readonly ? `"${d.words ?? ""}"` : null }} recommended={false} mode={mode} answerLabel={answerLabel}
191
+ {!done && (!readonly || isOther(d.chosen)) && <OptionRow other option={{ letter: "", label: OTHER_LABEL, consequence: readonly ? `"${d.words ?? ""}"` : null }} recommended={false} mode={mode} answerLabel={answerLabel}
190
192
  selected={readonly ? isOther(d.chosen) : isOther(picks[d.id])} answered={readonly && !!d.chosen} sending={busy === `${d.id}:${OTHER}`} disabled={!!busy} tight={false} open={false} onToggle={() => undefined}
191
193
  onPress={() => onPick(d.id, OTHER)} c={c} compact={compact} />}
192
194
  {/* Something else's field with its Send answer, kept on screen together while typing (DockedPane). */}
@@ -206,16 +208,16 @@ function BriefBody({ b, c, compact, tight, embedded, height, mode, picks, onPick
206
208
  placeholderTextColor={c.foregroundMuted} autoFocus={focusNote === d.id} multiline maxLength={2000} value={notes[d.id] ?? ""} editable={!busy} onChangeText={t => onNote?.(d.id, t)}
207
209
  style={{ minHeight: compact ? 66 : 58, paddingHorizontal: 10, paddingVertical: 8, borderRadius: 8, borderWidth: 1, borderColor: c.border, color: c.foreground, backgroundColor: c.surface0, fontSize: 14, lineHeight: 20, textAlignVertical: "top" }} />
208
210
  <NoteLink icon="X" label="Remove note" a11y={`Remove the note${numbered ? ` on decision ${i + 1}` : ""}`} disabled={!!busy} onPress={() => { onNote?.(d.id, ""); onNoteOpen?.(d.id, false); setFocusNote(null); }} c={c} compact={compact} />
209
- </View> : <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", columnGap: 14 }}>
211
+ </View> : done ? null : <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", columnGap: 14 }}>
210
212
  <NoteLink icon="MessageSquarePlus" label="Add note" a11y={numbered ? `Add note to decision ${i + 1}` : "Add note"} disabled={!!busy} onPress={() => { setFocusNote(d.id); onNoteOpen?.(d.id, true); }} c={c} compact={compact} />
211
- {mode === "send" && !tight && !embedded && <Text style={{ flexShrink: 1, color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>{`Or type ${letters(d)} in the composer.`}</Text>}
213
+ {mode === "send" && !tight && !embedded && !done && <Text style={{ flexShrink: 1, color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>{`Or type ${letters(d)} in the composer.`}</Text>}
212
214
  </View>)}
213
215
  </View>}
214
216
  {readonly && !!d.chosen && !isOther(d.chosen) && !!d.words && <RichText selectable linkColor={c.foreground} style={{ color: c.foregroundMuted, fontSize: 13, lineHeight: 18 }}>{`Note: ${d.words}`}</RichText>}
215
217
  {readonly && b.state === "answered" && d.options.length > 0 && !d.chosen && numbered && <Text style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>Skipped</Text>}
216
218
  {!readonly && mode === "send" && !tight && !d.options.length && <Text style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>{embedded ? "Reply below." : "Reply in the composer."}</Text>}
217
219
  {!readonly && (mode === "select" || tight) && !d.options.length && <Text style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>{embedded ? "Reply below." : "Reply in the composer."}</Text>}
218
- </View>)}
220
+ </View>; })}
219
221
 
220
222
  {!!b.mono && !b.ask.endsWith(b.mono) && <View style={{ borderRadius: 8, backgroundColor: withAlpha(c.statusDanger, isLight(c) ? 0.07 : 0.1), paddingHorizontal: 10, paddingVertical: 8 }}>
221
223
  <RichText selectable numberOfLines={tight && !readonly ? 3 : undefined} style={{ color: c.foreground, fontFamily: mono(), fontSize: 12, lineHeight: 18 }}>{b.mono}</RichText>
@@ -441,11 +443,15 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
441
443
  };
442
444
  // Done: "Done: <ask>" can't be unsent, so it goes out when the toast's Undo window ends (runUndoable). A failure
443
445
  // reopens the card with the reason; the toast keeps Retry, and Open brings the agent's chat back.
446
+ // one-done-button: the brief points at a task's action card, so its Done answers that card (A), the one answer path
447
+ // (a-question-is-answered-once); "Done: <ask>" goes out only for an action brief with no card behind it.
448
+ const doneQ = b.decisions.length === 1 && workspace ? workspace.questions.find(q => q.id === b.decisions[0].id && b.questionIds.includes(q.id) && isOpen(q) && isDoneOnly(q)) ?? null : null;
444
449
  const markDone = () => {
445
450
  if (busy || marked) return;
446
451
  setError(null); setSent(false); setMarked(new Date().toISOString());
447
452
  const doneId = newAnswerId();
448
- const id = runUndoable("Telling the agent it's done", { label: "Done", toast, run: () => act({ agentId, briefId: b.id, move: "done", answerId: doneId }), success: "Marked done. The agent has it.",
453
+ const id = runUndoable("Telling the agent it's done", { label: "Done", toast, run: async (): Promise<unknown> => doneQ && workspace ? answerQuestion({ workspaceId: workspace.id, questionId: doneQ.id, choice: TASK_DONE.letter, ...(notesOpen[doneQ.id] && notes[doneQ.id]?.trim() ? { words: notes[doneQ.id].trim() } : {}), action: "send" })
454
+ : act({ agentId, briefId: b.id, move: "done", answerId: doneId }), success: "Marked done. The agent has it.",
449
455
  failure: "Done not sent", open: () => deps.openAgent(agentId), onSuccess: () => setSent(true), onError: e => { setMarked(null); setError(errorText(e)); }, reconcile: e => { setMarked(null); reconcile(e); } }, () => setMarked(null), `done:${b.id}`, () => deps.endDone?.(agentId));
450
456
  // The pill's Undo is this toast's Undo: it closes the toast (so nothing is sent) and reopens the card.
451
457
  if (id !== null) deps.noteDone?.(agentId, () => { dismissToast(id); setMarked(null); });
@@ -466,7 +472,9 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
466
472
  else if (m.kind === "open_subagent" && m.agentId) deps.openAgent(m.agentId);
467
473
  };
468
474
  // A merge runs Follow-up's own merge flow, so it needs the tracked workspace; without one it isn't offered.
469
- const moves = b.moves.filter(m => (m.kind !== "merge" && m.kind !== "add_reviewers") || !!b.workspaceId);
475
+ const tracked = b.moves.filter(m => (m.kind !== "merge" && m.kind !== "add_reviewers") || !!b.workspaceId);
476
+ // A decision brief that folded into an action card still gets the card's one Done, first.
477
+ const moves: BriefMove[] = doneQ && !tracked.some(m => m.kind === "done") ? [{ kind: "done", label: "Done", prKey: null, url: null, agentId: null }, ...tracked] : tracked;
470
478
 
471
479
  // F7: "Nothing needed" is one muted line, no buttons. Paseo's own running and idle state says the rest.
472
480
  if (b.kind === "done" && b.source === "agent" && !b.flagged) return <View accessibilityRole="summary" accessibilityLabel={nothingNeededLine(b.ask)}
@@ -519,7 +527,9 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
519
527
  const sendAll = () => void run("answers", async answerId => { await answer(cardPicks(sendable, words, openNotes), answerId); clearCard(b.id); });
520
528
  // The keyboard's Send: every pick on a multi-decision card, or a single card's Something else once it has words.
521
529
  const otherId = !multi ? askedDecisions(b).find(d => isOther(picks[d.id]))?.id : undefined;
522
- const keySend = multi ? (sendBar(b, sendable).ready ? () => sendAll() : null) : otherId && words[otherId]?.trim() ? () => sendOther(otherId) : null;
530
+ // one-done-button: on an action card the keyboard sends Done (with its note), as the panel's card does.
531
+ const doneMove = doneQ && !multi && !isOther(picks[doneQ.id]) && moves[0]?.kind === "done" ? moves[0] : null;
532
+ const keySend = multi ? (sendBar(b, sendable).ready ? () => sendAll() : null) : otherId && words[otherId]?.trim() ? () => sendOther(otherId) : doneMove ? () => press(doneMove) : null;
523
533
  const sendOther = (decisionId: string) => { const text = words[decisionId]?.trim(); if (text) void run(`${decisionId}:${OTHER}`, async answerId => { await answer([{ decisionId, choice: OTHER, words: text }], answerId); clearCard(b.id); }); };
524
534
  return <RevealScope accessibilityRole="summary" accessibilityLabel={`${acts ? "Needs you" : flaggedAct ? "Later" : word(b.kind)}: ${askText}`}
525
535
  style={[{ marginVertical: embedded ? 0 : 10, borderRadius: 12, borderWidth: 1, borderColor: border, backgroundColor: c.surface1, overflow: "hidden" }, bare && BARE]}>
@@ -549,12 +559,15 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
549
559
  <BriefBody b={b} c={c} compact={compact} tight={tight} embedded={embedded} height={height} mode={multi ? "select" : "send"} picks={picks}
550
560
  onPick={(decisionId, letter) => { if (!busy) pickStore.set(b.id, decisionId, letter); }} busy={busy} onSend={sendOne}
551
561
  words={words} onWords={(decisionId, t) => wordStore.set(b.id, decisionId, t)} onSendOther={sendOther}
552
- notes={notes} notesOpen={notesOpen} onNote={(decisionId, t) => noteStore.set(b.id, decisionId, t)} onNoteOpen={(decisionId, open) => noteOpenStore.set(b.id, decisionId, open ? "1" : "")} />
562
+ notes={notes} notesOpen={notesOpen} onNote={(decisionId, t) => noteStore.set(b.id, decisionId, t)} onNoteOpen={(decisionId, open) => noteOpenStore.set(b.id, decisionId, open ? "1" : "")} doneIds={doneQ ? [doneQ.id] : []} />
553
563
 
554
564
  {multi && <SendBar b={b} picks={sendable} noted={notedCount(sendable, openNotes)} busy={busy} error={error} onSend={sendAll} c={c} compact={compact} />}
555
565
 
556
- {!embedded && moves.length > 0 && <View style={{ flexDirection: "row", flexWrap: "wrap", gap: 8 }}>
557
- {moves.map((m, i) => <Btn key={m.kind} label={moveLabel(m)} icon={MOVE_ICON[m.kind]} primary={i === 0 && !multi} disabled={!!busy || m.kind === "merge" && !!m.prKey && !!merges.view(m.prKey)?.running} onPress={() => press(m)} c={c} compact={compact} hint={MOVE_HINT[m.kind]} />)}
566
+ {!embedded && moves.length > 0 && <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8, columnGap: 14 }}>
567
+ {moves.map((m, i) => <Btn key={m.kind} shortcut={m === doneMove} label={moveLabel(m)} icon={MOVE_ICON[m.kind]} primary={i === 0 && !multi} disabled={!!busy || m.kind === "merge" && !!m.prKey && !!merges.view(m.prKey)?.running} onPress={() => press(m)} c={c} compact={compact} hint={MOVE_HINT[m.kind]} />)}
568
+ {/* one-done-button: the quiet choices sit beside Done, never above the context, away from it. */}
569
+ {doneQ && !notesOpen[doneQ.id] && !isOther(picks[doneQ.id]) && <NoteLink icon="MessageSquarePlus" label="Add note" a11y="Add a note, sent with Done" disabled={!!busy} onPress={() => noteOpenStore.set(b.id, doneQ.id, "1")} c={c} compact={compact} />}
570
+ {doneQ && !isOther(picks[doneQ.id]) && <NoteLink icon="Reply" label="Reply instead" a11y="Write a reply instead of Done" disabled={!!busy} onPress={() => pickStore.set(b.id, doneQ.id, OTHER)} c={c} compact={compact} />}
558
571
  </View>}
559
572
 
560
573
  {!!error && !multi && <Text accessibilityRole="alert" style={{ color: c.statusDanger, fontSize: 13, lineHeight: 18 }}>{error}</Text>}
package/client/header.tsx CHANGED
@@ -17,12 +17,17 @@ export const STALE_MS = 10 * 60_000;
17
17
 
18
18
  /**
19
19
  * One mark per PR in stack order, coloured by state; past STACK_BAR_BUDGET PRs, runs or slices of the stack as wide as
20
- * their share (`barMarks`, stack-bar-reads-at-any-size). The signature of the panel; a mark opens its loudest PR.
20
+ * their share (`barMarks`, stack-bar-reads-at-any-size). The signature of the panel. A mark opens its loudest PR on
21
+ * desktop only: on a phone the marks are 6-8 pt wide and 2 pt apart, far under the 44 pt touch rule, and the Pull
22
+ * requests card's rows right below open every PR, so the compact header draws it without `onOpen` (one progress bar,
23
+ * no buttons).
21
24
  */
22
25
  export function StackBar({ workspace, theme, height = 6, onOpen }: { workspace: Pick<Workspace, "prs">; theme: Theme; height?: number; onOpen?: (key: string) => void }) {
23
26
  const bar = stackBar(workspace);
24
27
  if (!bar.total) return null;
25
- return <View accessibilityRole="progressbar" accessibilityLabel={`${bar.merged} of ${bar.total} PRs merged`} accessibilityValue={{ min: 0, max: bar.total, now: bar.merged }}
28
+ // The label says what the marks show, so a phone's bar (no per-mark buttons) still tells a screen reader what is red (failed checks or a conflict: the header's "to fix").
29
+ const failing = bar.segments.filter(s => s.tone === "danger").length;
30
+ return <View accessibilityRole="progressbar" accessibilityLabel={`${bar.merged} of ${bar.total} PRs merged${failing ? `, ${failing} to fix` : ""}`} accessibilityValue={{ min: 0, max: bar.total, now: bar.merged }}
26
31
  style={{ flexDirection: "row", gap: 2, height, borderRadius: height / 2, overflow: onOpen ? "visible" : "hidden" }}>
27
32
  {barMarks(bar.segments).map((s, i, marks) => {
28
33
  const paint = segmentPaint(theme.colors, s.tone);
@@ -110,7 +115,7 @@ export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings,
110
115
  <Text accessibilityLiveRegion="polite" style={[t.ask, { color: c.foregroundMuted }]}>
111
116
  {parts.map((part, i) => <Text key={part.text} style={toneOf(part.tone) ? { color: toneOf(part.tone) } : { color: c.foreground }}>{i ? <Text style={{ color: c.foregroundMuted, fontWeight: "400" }}>{" · "}</Text> : null}{part.text}</Text>)}
112
117
  </Text>
113
- <StackBar workspace={w} theme={theme} onOpen={onOpenPr} />
118
+ <StackBar workspace={w} theme={theme} onOpen={compact ? undefined : onOpenPr} />
114
119
  {tail}
115
120
  </View>;
116
121
  return <View style={{ paddingHorizontal: pad, paddingTop: compact ? 14 : 12, paddingBottom: 10, gap: 6, borderBottomWidth: 1, borderBottomColor: c.border }}>
@@ -127,7 +132,7 @@ export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings,
127
132
  <Text accessibilityLiveRegion="polite" style={[t.meta, { color: c.foregroundMuted, marginTop: 2 }]}>
128
133
  {parts.map((part, i) => <Text key={part.text} style={toneOf(part.tone) ? { color: toneOf(part.tone), fontWeight: "600" } : { color: c.foreground }}>{i ? <Text style={{ color: c.foregroundMuted, fontWeight: "400" }}>{" · "}</Text> : null}{part.text}</Text>)}
129
134
  </Text>
130
- <StackBar workspace={w} theme={theme} onOpen={onOpenPr} />
135
+ <StackBar workspace={w} theme={theme} onOpen={compact ? undefined : onOpenPr} />
131
136
  {tail}
132
137
  </View>;
133
138
  }
@@ -2,7 +2,7 @@ import { memo, useCallback, useEffect, useMemo, useRef, useState, type ReactNode
2
2
  import { View, type FlatList as NativeFlatList } from "react-native";
3
3
  import { Pressable, Text } from "./text";
4
4
  import { Icon, FlatList } from "@getpaseo/plugin/client/ui";
5
- import { type Badge, type HomeGroupId, type HomeModel, type Workstream, railChips } from "../shared/home";
5
+ import { type Badge, type HomeGroupId, type HomeModel, type Workstream, prChipSpoken, railChips } from "../shared/home";
6
6
  import { ASK_KEY, excerpt, FIELD_LABEL, type OmniboxItem, type Range, type RowHit, type SearchHit } from "../shared/search";
7
7
  import { AskRow, PriorityLine } from "./home-chrome";
8
8
  import { age, wakeLabel, wakeShort } from "../shared/inbox";
@@ -136,7 +136,7 @@ export function HomeList({ model, theme, dense = false, touch, selectedKey, onSe
136
136
  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 })} />;
137
137
  case "brief": return <BriefRow theme={theme} line={briefLine ?? ""} selected={!touch && (selectedKey === null || selectedKey === BRIEF_KEY)} touch={touch} onSelect={onSelect} />;
138
138
  case "overseer": return overseer ? <OverseerRow theme={theme} o={overseer} selected={selectedKey === OVERSEER_KEY} touch={touch} stacked={stackOverseer} onSelect={onSelect} selectedBg={selectedBg} /> : null;
139
- case "header": return <GroupHeader theme={theme} title={item.title} count={item.count} open={item.open} tone={item.group === "needs" && item.count ? c.statusWarning : undefined} dense={dense} touch={touch} onPress={() => toggle(item.group)} />;
139
+ case "header": return <GroupHeader theme={theme} title={item.title} count={item.count} open={item.open} tone={item.group === "needs" && item.count ? c.statusWarning : undefined} dense={dense} touch={touch} folds={item.group === "older" || item.group === "quiet"} onPress={() => toggle(item.group)} />;
140
140
  case "fold": return <Pressable accessibilityRole="button" aria-expanded={item.open} accessibilityState={{ expanded: item.open }} accessibilityLabel={`${item.project}, ${item.count}. ${item.open ? "Collapse" : "Expand"}`} onPress={() => toggleProject(item.project)}
141
141
  style={state => ({ flexDirection: "row", alignItems: "center", gap: 8, minHeight: touch ? 44 : dense ? 28 : 34, paddingHorizontal: dense ? 8 : 16, backgroundColor: (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
142
142
  <Icon name={item.open ? "ChevronDown" : "ChevronRight"} size={13} color={c.foregroundMuted} />
@@ -188,7 +188,7 @@ export function HomeList({ model, theme, dense = false, touch, selectedKey, onSe
188
188
  return <View ref={rootRef} style={{ flex: 1, minHeight: 0 }}>{top}{list}{overlay}</View>;
189
189
  }
190
190
 
191
- function GroupHeader({ theme, title, count, open, tone, dense, touch, onPress }: { theme: Theme; title: string; count: number; open: boolean; tone?: string; dense: boolean; touch: boolean; onPress: () => void }) {
191
+ function GroupHeader({ theme, title, count, open, tone, dense, touch, folds = false, onPress }: { theme: Theme; title: string; count: number; open: boolean; tone?: string; dense: boolean; touch: boolean; folds?: boolean; onPress: () => void }) {
192
192
  const c = theme.colors;
193
193
  return <Pressable accessibilityRole="button" aria-expanded={open} accessibilityState={{ expanded: open }} accessibilityLabel={`${title}, ${count}. ${open ? "Collapse" : "Expand"}`} onPress={onPress}
194
194
  style={{ flexDirection: "row", alignItems: "center", gap: 6, minHeight: touch ? 44 : dense ? 28 : 34, paddingHorizontal: touch ? 16 : dense ? 8 : 16, paddingTop: touch ? 8 : dense ? 4 : 8 }}>
@@ -196,7 +196,8 @@ function GroupHeader({ theme, title, count, open, tone, dense, touch, onPress }:
196
196
  {/* Phones: sentence case at 13, the section role; desktop keeps the small caps. */}
197
197
  <Text accessibilityRole="header" style={touch ? { color: tone ?? c.foregroundMuted, fontSize: 13, lineHeight: 18, fontWeight: "600" } : { color: tone ?? c.foregroundMuted, fontSize: 11, lineHeight: 14, fontWeight: "600", letterSpacing: 0.6, textTransform: "uppercase" }}>{touch ? title.charAt(0) + title.slice(1).toLowerCase() : title}</Text>
198
198
  <Text style={{ color: tone ?? c.foregroundMuted, fontSize: touch ? 13 : 11, lineHeight: touch ? 18 : 14, fontVariant: ["tabular-nums"] }}>{count}</Text>
199
- {!dense && !open && <Icon name="ChevronRight" size={12} color={c.foregroundMuted} />}
199
+ {/* A group that starts folded keeps its fold control when open, so it can be folded again. */}
200
+ {!dense && (!open || folds) && <Icon name={open ? "ChevronDown" : "ChevronRight"} size={12} color={c.foregroundMuted} />}
200
201
  </Pressable>;
201
202
  }
202
203
 
@@ -260,7 +261,7 @@ export function BadgeView({ b, c }: { b: Badge; c: Colors }) {
260
261
  export function PrChipView({ s, c }: { s: Workstream; c: Colors }) {
261
262
  if (!s.pr) return null;
262
263
  const checks = s.pr.checks;
263
- return <View testID="follow-up-row-chip" style={{ flexShrink: 1, minWidth: 0, flexDirection: "row", alignItems: "center", gap: 4, paddingHorizontal: 6, height: 20, borderRadius: 4, borderWidth: 1, borderColor: c.border }}>
264
+ return <View testID="follow-up-row-chip" role="img" aria-label={prChipSpoken(s.pr)} style={{ flexShrink: 1, minWidth: 0, flexDirection: "row", alignItems: "center", gap: 4, paddingHorizontal: 6, height: 20, borderRadius: 4, borderWidth: 1, borderColor: c.border }}>
264
265
  <Icon name="GitPullRequest" size={11} color={toneColor(c, s.pr.tone)} />
265
266
  <Text numberOfLines={1} style={{ flexShrink: 0, color: c.foreground, fontSize: 11, lineHeight: 14, fontVariant: ["tabular-nums"] }}>{s.pr.label}</Text>
266
267
  {checks && <Text numberOfLines={1} style={{ flexShrink: 1, minWidth: 0, color: checks.tone === "muted" ? c.foregroundMuted : badgeColor({ text: "", tone: checks.tone }, c), fontSize: 11, lineHeight: 14 }}>{checks.text}</Text>}
@@ -326,7 +327,7 @@ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMe
326
327
  const archived = s.icon === "Archive" && s.sig.startsWith("archived:");
327
328
  const color = archived ? c.foregroundMuted : glyphColor(s, c, touch);
328
329
  const blocking = s.group === "needs" && s.tier === 0;
329
- const muted = s.group === "quiet" || s.group === "later";
330
+ const muted = s.group === "quiet" || s.group === "later" || s.group === "older";
330
331
  // Desktop rows are one line beside badges and the PR chip: the ask and the "<Field> · excerpt" line are cut around the
331
332
  // match (about 44 characters, the match near the start), so the highlight is never past the "…". Phones and the
332
333
  // sidebar view wrap to two lines and keep more.
@@ -343,7 +344,7 @@ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMe
343
344
  const waited = s.group === "later" && s.at ? age(s.at, Date.now()) : "";
344
345
  const label = [s.title + (s.agent ? ` › ${s.agent}` : ""), s.word, s.line, hit?.via && `${FIELD_LABEL[hit.via.field]}: ${hit.via.text}`,
345
346
  // Every chip, even one a narrow row hides (row-chips-never-cover-the-time).
346
- ...s.badges.map(b => b.text), s.pr && `Pull request ${s.pr.label}${s.pr.checks ? ` ${s.pr.checks.text}` : ""}`, wake && `Later until ${wake}`, waited && (waited === "now" ? "just now" : `waiting ${waited}`)].filter(Boolean).join(". ");
347
+ ...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(". ");
347
348
  return <Pressable ref={trigger.ref} nativeID={rowDomId(s.key)} accessibilityRole="button" accessibilityState={{ selected }} accessibilityLabel={label} accessibilityHint={quickActionsHint(touch)}
348
349
  onPress={() => onSelect(s.key)} onLongPress={trigger.onLongPress} delayLongPress={450}
349
350
  style={state => ({ ...focusRing((state as { focused?: boolean }).focused, c, true), flexDirection: "row", alignItems: dense ? "flex-start" : "center", gap: touch ? 10 : dense ? 8 : 10, minHeight: touch ? 56 : dense ? 36 : 38, paddingLeft: touch ? 14 : dense ? 8 : 16, paddingRight: touch ? 16 : dense ? 8 : 16, paddingVertical: touch ? 12 : dense ? 6 : 0,
@@ -1,5 +1,5 @@
1
1
  import type { PluginClientContext } from "@getpaseo/plugin/client";
2
- import { contextAskRpc, contextListRpc, displayFeed, homeFeed, overseerAskRpc, overseerRestartRpc, overseerStartRpc, overseerStatusRpc, prioritiesRpc, rankNowRpc, rankStatusRpc, usageRpc } from "../shared/contracts";
2
+ import { contextAskRpc, contextListRpc, displayFeed, homeFeed, overseerAskRpc, overseerRestartRpc, overseerStartRpc, overseerStatusRpc, prioritiesRpc, prStatsSettingsRpc, rankNowRpc, rankStatusRpc, usageRpc } from "../shared/contracts";
3
3
  import { openFeed } from "./feeds";
4
4
  import type { RpcInput, RpcOutput } from "@getpaseo/plugin";
5
5
  import type { Priority } from "../shared/priorities";
@@ -44,6 +44,8 @@ export function createHomeExtras(client: PluginClientContext) {
44
44
  let rank: RpcOutput<typeof rankStatusRpc> | null = null;
45
45
  /** Catch up's More context asks: pushed on the home feed; read when Catch up opens or moves, never on a timer of their own. */
46
46
  let context: ContextRequest[] = [];
47
+ /** Whether any repository has PR statistics: Home's PR stats icon. Pushed on the home feed; on 0.15, read once at start. */
48
+ let prStatsOn = false;
47
49
  const setContext = (next: ContextRequest[]) => { if (JSON.stringify(next) === JSON.stringify(context)) return false; context = next; return true; };
48
50
  const readContext = async () => setContext((await client.rpc(contextListRpc, {})).requests);
49
51
  const agents = new Map<string, AgentLite>();
@@ -118,6 +120,7 @@ export function createHomeExtras(client: PluginClientContext) {
118
120
  if (stopped) return;
119
121
  priorities = event.priorities; rank = event.rank; overseer = event.overseer;
120
122
  if (event.context) setContext(event.context);
123
+ if (event.prStats !== undefined) prStatsOn = event.prStats;
121
124
  if (event.usage) usage = { ...event.usage, resources: usage.resources };
122
125
  if (!event.rank.running) { for (const done of rankWaiters) done(); rankWaiters.clear(); }
123
126
  // Smart Session's files can't be watched: read the meters once a minute instead.
@@ -137,7 +140,11 @@ export function createHomeExtras(client: PluginClientContext) {
137
140
  if (home) {
138
141
  void readSort().then(changed => { if (changed) emit(); }).catch(() => undefined);
139
142
  void client.rpc(usageRpc, {}).then(next => { usage = { ...next, accounts: usage.accounts.length ? usage.accounts : next.accounts }; emit(); }).catch(() => undefined);
140
- } else { homePolls = pollHome(); sortPolls = pollSort(); }
143
+ } else {
144
+ homePolls = pollHome(); sortPolls = pollSort();
145
+ // 0.15 (no home feed): whether Home shows the PR stats icon, read once when the app starts (Settings' read; no poll).
146
+ void client.rpc(prStatsSettingsRpc, {}).then(v => { const on = v.repos.some(r => r.state !== "off"); if (on !== prStatsOn) { prStatsOn = on; emit(); } }).catch(() => undefined);
147
+ }
141
148
 
142
149
  const putAgent = (a: AgentEntry["agent"]) => {
143
150
  if (!a?.id) return;
@@ -231,6 +238,8 @@ export function createHomeExtras(client: PluginClientContext) {
231
238
  async restartOverseer() { overseer = await client.rpc(overseerRestartRpc, {}); emit(); return overseer; },
232
239
  /** Catch up's More context asks and their answers. */
233
240
  context: () => context,
241
+ /** Whether Home shows the PR stats icon (some repository has PR statistics). */
242
+ prStatsOn: () => prStatsOn,
234
243
  /** Reads the asks once (Catch up opening or moving on, so a 0.15 host or a dropped feed is never stale for long). */
235
244
  async refreshContext() { if (await readContext().catch(() => false)) emit(); },
236
245
  /** Asks the Overseer or the card's agent; the ask shows at once, its answer arrives on the feed. */
package/client/home.tsx CHANGED
@@ -8,7 +8,7 @@ import { useQuery } from "@tanstack/react-query";
8
8
  import { browserStatusRpc, controlRpc, inboxBriefRpc, sendRpc } from "../shared/contracts";
9
9
  import { needsYou, workspaceSnoozed } from "../shared/attention";
10
10
  import { briefAsks, briefCardShown, liveBrief } from "../shared/brief";
11
- import { briefPane, followUpLog, lastWorkdayEnd, nextNeeds, paneButtons, sameText, sinceLabel, tailSteps, type HomeGroupId, type HomeModel, type LogLine, type TailStep, type Workstream } from "../shared/home";
11
+ import { briefPane, followUpLog, lastWorkdayEnd, nextNeeds, paneButtons, prChipSpoken, sameText, sinceLabel, tailSteps, type HomeGroupId, type HomeModel, type LogLine, type TailStep, type Workstream } from "../shared/home";
12
12
  import { age, backLabel, snoozeUntil, type InboxRow } from "../shared/inbox";
13
13
  import { errorText } from "../shared/errors";
14
14
  import { isLoaded, type LoadSignals } from "../shared/agent-load";
@@ -22,7 +22,9 @@ import type { DockState } from "./dock";
22
22
  import { NeedsYouBlock } from "./needs-you";
23
23
  import { HeldMerges } from "./merge-button";
24
24
  import { PrSheet } from "./pr-sheet";
25
+ import { StatsPage, type StatsParams } from "./pr-stats";
25
26
  import { QuestionSheet } from "./questions";
27
+ import { isDoneOnly } from "../shared/questions";
26
28
  import { DismissReveal } from "./dismiss";
27
29
  import { Age, BadgeView, BRIEF_KEY, glyphColor, HomeList, OVERSEER_KEY, PrChipView, PrSummaryText, type OverseerRowState } from "./home-list";
28
30
  import { answerLine, overseerRowState } from "../shared/overseer";
@@ -70,6 +72,8 @@ export type HomeDeps = {
70
72
  openLog(): void;
71
73
  /** Catch up: Needs you one card at a time (`?view=catchup`). */
72
74
  openCatchUp?(): void;
75
+ /** The PR stats page (`?view=stats`, docs/pr-stats.md#the-page); a phone's person opens as its own screen. */
76
+ openStats?(params?: StatsParams): void;
73
77
  openHome(): void;
74
78
  /** Phones: open one Home item as its own screen, so the host's ← (and Android back) returns to the list. */
75
79
  openItem?(key: string, extra?: { question?: string }): void;
@@ -104,7 +108,7 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
104
108
  const omnibox = useOmnibox(model, deps.sources);
105
109
  const searchKey = deps.searchKey;
106
110
  const anywhereKey = useSyncExternalStore(searchKey?.subscribe ?? noSubscribe, searchKey?.label ?? noLabel, searchKey?.label ?? noLabel);
107
- useSlashToFocus(omnibox, params.view !== "log" && params.view !== "catchup");
111
+ useSlashToFocus(omnibox, params.view !== "log" && params.view !== "catchup" && params.view !== "stats");
108
112
  const [filter, setFilter] = useState<HomeGroupId | null>(null);
109
113
  const [selected, setSelected] = useState<string | null>(() => params.item ?? (params.select ? `agent:${params.select}` : null));
110
114
  const openAgentRow = useMemo(() => navigation ? (row: InboxRow) => navigation.openAgent({ agentId: row.agentId }) : undefined, [navigation]);
@@ -113,7 +117,8 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
113
117
  navigation.openWorkspace({ workspaceId });
114
118
  if (compact) deps.openPanel(workspaceId); else setTimeout(() => deps.openPanel(workspaceId), 900);
115
119
  } : undefined, [navigation, compact, deps]);
116
- useNextRelay(inbox, params, openAgentRow, openWorkspaceRelay);
120
+ const archivedIds = useCallback(() => new Set(deps.sources.live.archived().map(w => w.id)), [deps.sources.live]);
121
+ useNextRelay(inbox, params, openAgentRow, openWorkspaceRelay, archivedIds);
117
122
  useEffect(() => { if (params.select) setSelected(`agent:${params.select}`); }, [params.select]);
118
123
  // An already-open Home asked to show an item (the sidebar view's Overseer row: Start and Restart live here). `at` makes
119
124
  // the same item twice a second request.
@@ -132,6 +137,8 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
132
137
  const pane = useMemo(() => briefPane({ model, rows, tracked: deps.sources.live.all(), now: Date.now() }), [model, rows, tracked, deps.sources.live]);
133
138
  const rank = useSyncExternalStore(deps.sources.extras.subscribe, deps.sources.extras.rank, deps.sources.extras.rank);
134
139
  const overseerStatus = useSyncExternalStore(deps.sources.extras.subscribe, deps.sources.extras.overseer, deps.sources.extras.overseer);
140
+ const prStatsOn = useSyncExternalStore(deps.sources.extras.subscribe, deps.sources.extras.prStatsOn, deps.sources.extras.prStatsOn);
141
+ const openStats = prStatsOn && deps.openStats ? () => deps.openStats!() : undefined;
135
142
  const overseerInbox = useInbox(inbox, () => inbox.overseer());
136
143
  const overseer = overseerRowState(overseerStatus, overseerInbox);
137
144
  const toast = useToast();
@@ -211,6 +218,11 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
211
218
  <CatchUp theme={theme} compact={compact} deps={{ sources: deps.sources, briefDeps: deps.briefDeps, openHome: deps.openHome, openPanel: deps.openPanel }} navigation={navigation as never} onExit={deps.openHome} />
212
219
  {updateSheets}
213
220
  </View>;
221
+ if (params.view === "stats") return <View style={{ flex: 1 }}>
222
+ <StatsPage key={params.n ?? "stats"} theme={theme} compact={compact} params={{ repo: params.repo, period: params.period, person: params.person, sort: params.sort }}
223
+ deps={{ onHome: deps.openHome, openSettings: () => deps.openSettings("following"), openStats: p => deps.openStats?.(p) }} />
224
+ {updateSheets}
225
+ </View>;
214
226
  if (params.view === "log") return <LogView theme={theme} compact={compact} sources={deps.sources} onHome={deps.openHome} onOpen={key => { setSelected(key); deps.openHome(); }} />;
215
227
 
216
228
  const detail = selected === OVERSEER_KEY && overseer
@@ -241,12 +253,13 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
241
253
  // Phones: the setup offer goes after the Needs-you group when there is one, so the first ask stays high.
242
254
  afterNeeds={compact && model.needs > 0 ? <SetupOffer theme={theme} compact view={props.onboarding} /> : undefined}
243
255
  emptyAction={compact ? <Button theme={theme} compact kind="secondary" icon="Settings" title="Project settings" onPress={deps.openSettings} /> : undefined}
244
- top={<ListTop theme={theme} dense={compact} title={compact ? undefined : <ListHeader theme={theme} compact={compact} onSettings={deps.openSettings} onKeys={() => setKeysOpen(v => !v)} />}>
256
+ top={<ListTop theme={theme} dense={compact} title={compact ? undefined : <ListHeader theme={theme} compact={compact} onSettings={deps.openSettings} onKeys={() => setKeysOpen(v => !v)} onStats={openStats} />}>
245
257
  {/* zIndex: on web every View is its own stacking context, so the sort menu only paints and hit-tests above the
246
258
  strip and meters below if this row sits above them. */}
247
259
  <View style={{ zIndex: 2, flexDirection: "row", alignItems: "center", gap: compact ? 2 : 6, paddingLeft: compact ? 16 : 16, paddingRight: compact ? 6 : 16 }}>
248
260
  <SearchField theme={theme} omnibox={omnibox} dense={compact} onEnter={item => void pick(item)} anywhereKey={anywhereKey} />
249
261
  {!(compact && nothing) && <SortMenu theme={theme} mode={model.sort} onChange={deps.sources.extras.setSort} rankedAt={model.rankedAt} touch={compact} rank={rank} onRerank={deps.sources.extras.rankNow} />}
262
+ {compact && openStats && <IconButton theme={theme} compact icon="ChartNoAxesColumn" label="PR stats" onPress={openStats} />}
250
263
  {compact && <IconButton theme={theme} compact icon="Settings" label="Follow-up settings" onPress={deps.openSettings} />}
251
264
  </View>
252
265
  <View style={{ paddingHorizontal: 16 }}><LayoutNotice theme={theme} query={omnibox.layoutHint} dense={compact} /></View>
@@ -321,7 +334,7 @@ export function DisplaySplit({ theme, main, side, field, defaultFraction, range,
321
334
  const HOME_DETAIL_MIN_PX = 360;
322
335
  const HOME_LIST_MIN_PX = 480;
323
336
 
324
- function ListHeader({ theme, compact, onSettings, onKeys }: { theme: Theme; compact: boolean; onSettings: () => void; onKeys?: () => void }) {
337
+ function ListHeader({ theme, compact, onSettings, onKeys, onStats }: { theme: Theme; compact: boolean; onSettings: () => void; onKeys?: () => void; onStats?: () => void }) {
325
338
  const c = theme.colors;
326
339
  return <View style={{ flexDirection: "row", alignItems: "center", gap: 8, paddingHorizontal: 16 }}>
327
340
  {/* Home first, the version second: a muted caption on the title's line, never a control beside the cog. */}
@@ -331,6 +344,8 @@ function ListHeader({ theme, compact, onSettings, onKeys }: { theme: Theme; comp
331
344
  </View>
332
345
  {/* The keys sheet's way in for the mouse (S from the keyboard); desktop web, where the keys are. */}
333
346
  {onKeys && Platform.OS === "web" && <IconButton theme={theme} compact={compact} icon="Keyboard" label="Keys (S)" tooltip onPress={onKeys} />}
347
+ {/* Shown once a repository has PR statistics (docs/pr-stats.md#where-it-opens-from). */}
348
+ {onStats && <IconButton theme={theme} compact={compact} icon="ChartNoAxesColumn" label="PR stats" tooltip onPress={onStats} />}
334
349
  <IconButton theme={theme} compact={compact} icon="Settings" label="Follow-up settings" onPress={onSettings} />
335
350
  </View>;
336
351
  }
@@ -459,7 +474,12 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
459
474
  const [laterSheet, setLaterSheet] = useState(false);
460
475
  // A snoozed row keeps its moves: Sign off is a normal end for something put off, and Later changes the time.
461
476
  const flagged = !!row?.needs;
462
- const plan = paneButtons({ permissions: agent.permissions.length, decisions: !!b?.decisions.some(d => d.options.length), items, flagged, hasAgent: !!s.agentId });
477
+ // one-done-button: while an action card waits here, Done tells the agent and Sign off doesn't, so Sign off yields:
478
+ // never the primary, and the row's ✕ instead of a ✓ that would read as Done.
479
+ const actionOpen = !!w && asks.some(i => i.kind === "question" && w.questions.some(q => q.id === i.questionId && isDoneOnly(q)));
480
+ const signOffIcon = actionOpen ? "X" : "Check";
481
+ const planned = paneButtons({ permissions: agent.permissions.length, decisions: !!b?.decisions.some(d => d.options.length), items, flagged, hasAgent: !!s.agentId });
482
+ const plan = actionOpen && planned.primary === "sign_off" ? { ...planned, primary: "item" as const } : planned;
463
483
  const run = async (key: string, work: () => Promise<unknown>, done?: string) => {
464
484
  if (busy) return; setBusy(key);
465
485
  try { await work(); if (done) toast.show(done, { variant: "success" }); inbox.refresh(); } catch (e) { toast.error(errorText(e)); } finally { setBusy(null); }
@@ -489,7 +509,8 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
489
509
  {!writing && s.workspaceId && w && <View style={{ marginTop: 6 }}><ReferencesLine key={`refs:${s.workspaceId}`} workspace={w} theme={theme} compact /></View>}
490
510
  {!writing && <View style={{ flexDirection: "row", alignItems: "center", gap: 6, minHeight: 44 }}>
491
511
  <Icon name={s.icon} size={14} color={color} />
492
- <Text numberOfLines={1} style={[t.meta, { flex: 1, minWidth: 0 }]}>
512
+ {/* Read as one line, with the PR summary in words: a nested Text can't carry its own label. */}
513
+ <Text numberOfLines={1} accessibilityLabel={[s.word, metaRest, s.pr && prChipSpoken(s.pr)].filter(Boolean).join(" · ")} style={[t.meta, { flex: 1, minWidth: 0 }]}>
493
514
  {!!s.word && <Text style={{ color, fontWeight: "600" }}>{s.word}</Text>}
494
515
  {metaRest ? (s.word ? ` · ${metaRest}` : metaRest) : ""}
495
516
  <PrSummaryText s={s} c={c} lead=" · " />
@@ -516,7 +537,7 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
516
537
  const canMove = plan.buttons.includes("sign_off") || plan.buttons.includes("later");
517
538
  const actionBar = !compact && (plan.buttons.includes("sign_off") || plan.buttons.includes("later")) && <View style={{ gap: 8 }}>
518
539
  <View style={{ flexDirection: "row", flexWrap: "wrap", gap: 8 }}>
519
- <Button nativeID={PANE_PRIMARY} theme={theme} compact={compact} kind={plan.primary === "sign_off" ? "primary" : "secondary"} icon="Check" title="Sign off" loading={busy === "sign_off"}
540
+ <Button nativeID={PANE_PRIMARY} theme={theme} compact={compact} kind={plan.primary === "sign_off" ? "primary" : "secondary"} icon={signOffIcon} title="Sign off" loading={busy === "sign_off"}
520
541
  onPress={() => void run("sign_off", () => inbox.signOff([s.agentId!]))} />
521
542
  <Button theme={theme} compact={compact} icon="ArrowRight" title="Sign off & next" onPress={() => signOffNext(s)} />
522
543
  <Button theme={theme} compact={compact} icon="AlarmClock" title="Later…" onPress={() => setLaterOpen(v => !v)} />
@@ -550,7 +571,7 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
550
571
  const narrow = useWindowDimensions().width < 380;
551
572
  // The dock's extras step aside while a field in the pane has focus (DockedPane, a-focused-field-and-its-send-stay-in-view).
552
573
  const moves = compact && canMove && <View style={{ flexDirection: "row", gap: 8, paddingHorizontal: 12, paddingTop: 10 }}>
553
- <View style={{ flex: 1 }}><Button nativeID={PANE_PRIMARY} theme={theme} compact grow kind={plan.primary === "sign_off" && !itemFirst ? "primary" : "secondary"} icon={narrow ? undefined : "Check"} title="Sign off" loading={busy === "sign_off"}
574
+ <View style={{ flex: 1 }}><Button nativeID={PANE_PRIMARY} theme={theme} compact grow kind={plan.primary === "sign_off" && !itemFirst ? "primary" : "secondary"} icon={narrow ? undefined : signOffIcon} title="Sign off" loading={busy === "sign_off"}
554
575
  onPress={() => void run("sign_off", () => inbox.signOff([s.agentId!]))} /></View>
555
576
  <View style={{ flex: 1.3 }}><Button theme={theme} compact grow icon={narrow ? undefined : "ArrowRight"} title="Sign off & next" onPress={() => signOffNext(s)} /></View>
556
577
  <IconButton theme={theme} compact icon="AlarmClock" label="Later…" onPress={() => setLaterSheet(true)} />
package/client/inbox.tsx CHANGED
@@ -100,8 +100,8 @@ export function contributeInboxCommands(client: PluginClientContext, store: Inbo
100
100
  }
101
101
 
102
102
  /** "Sign off & next" target, honouring D9 and skipping the agent just signed off. */
103
- export function nextTarget(store: InboxStore, from: string | null): InboxRow | null {
104
- return nextAfter(store.rows(), from, Date.now());
103
+ export function nextTarget(store: InboxStore, from: string | null, archived?: ReadonlySet<string>): InboxRow | null {
104
+ return nextAfter(store.rows(), from, Date.now(), archived);
105
105
  }
106
106
 
107
107
  /**
@@ -109,7 +109,7 @@ export function nextTarget(store: InboxStore, from: string | null): InboxRow | n
109
109
  * items get no navigation, so the brief card and the created-agent card relay "open this agent" (`open`) and the
110
110
  * created-workspace card "open this workspace" (`openWorkspace`, which lands on that workspace's Follow-up panel).
111
111
  */
112
- export function useNextRelay(store: InboxStore, params: Record<string, string>, openAgent: ((row: InboxRow) => void) | undefined, openWorkspace?: (workspaceId: string) => void) {
112
+ export function useNextRelay(store: InboxStore, params: Record<string, string>, openAgent: ((row: InboxRow) => void) | undefined, openWorkspace?: (workspaceId: string) => void, archived?: () => ReadonlySet<string>) {
113
113
  const done = useRef<string | null>(null);
114
114
  const ready = useInbox(store, () => !!store.data());
115
115
  useEffect(() => {
@@ -119,7 +119,7 @@ export function useNextRelay(store: InboxStore, params: Record<string, string>,
119
119
  if (!openAgent || !ready) return;
120
120
  done.current = token;
121
121
  if (params.open) { openAgent({ agentId: params.open } as InboxRow); return; }
122
- const target = nextTarget(store, params.from ?? null);
122
+ const target = nextTarget(store, params.from ?? null, archived?.());
123
123
  if (target) openAgent(target);
124
- }, [params.next, params.from, params.open, params.openWorkspace, ready, openAgent, openWorkspace, store]);
124
+ }, [params.next, params.from, params.open, params.openWorkspace, ready, openAgent, openWorkspace, archived, store]);
125
125
  }
@@ -88,7 +88,7 @@ export function useMergeButtons(w: Workspace | undefined): MergeButtons {
88
88
  }
89
89
 
90
90
  /**
91
- * "#143 approved · waits on #142 (checks failing)": an approved PR that Merge isn't offered on because a PR under it
91
+ * "#143 approved · waits on #142 (checks failed)": an approved PR that Merge isn't offered on because a PR under it
92
92
  * can't merge yet (heldMerges). Quiet, not an ask; both numbers open their PRs. The panel's Pull requests card and
93
93
  * Home's detail pane draw it, so an approved PR never goes invisible.
94
94
  */