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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/OVERVIEW.md +1 -1
  2. package/README.md +0 -1
  3. package/client/brief-since.tsx +4 -3
  4. package/client/catch-up.tsx +56 -15
  5. package/client/header.tsx +5 -3
  6. package/client/home-data.ts +3 -1
  7. package/client/home-list.tsx +19 -11
  8. package/client/home-view.ts +8 -1
  9. package/client/home.tsx +29 -10
  10. package/client/keys.ts +2 -0
  11. package/client/kit.tsx +5 -2
  12. package/client/large.tsx +5 -3
  13. package/client/live.tsx +4 -3
  14. package/client/merge-button.tsx +3 -2
  15. package/client/messages.tsx +5 -1
  16. package/client/more-context.tsx +17 -4
  17. package/client/morning-brief-settings.tsx +5 -4
  18. package/client/needs-you.tsx +5 -4
  19. package/client/new-settings.tsx +8 -7
  20. package/client/now-lines.tsx +60 -0
  21. package/client/onboarding.tsx +55 -123
  22. package/client/paged-list.tsx +115 -0
  23. package/client/panel.tsx +24 -8
  24. package/client/pr-stats-settings.tsx +3 -2
  25. package/client/pr-stats.tsx +10 -10
  26. package/client/questions.tsx +63 -40
  27. package/client/release-notes.tsx +10 -9
  28. package/client/reviewers.tsx +8 -3
  29. package/client/row-open.ts +28 -0
  30. package/client/section-search.tsx +5 -3
  31. package/client/settings.tsx +11 -8
  32. package/client/setup-dialog.tsx +168 -0
  33. package/client/setup-gate.tsx +69 -0
  34. package/client/setup-ui.ts +27 -0
  35. package/client/shipping.tsx +5 -4
  36. package/client/stacks.tsx +11 -3
  37. package/client/tasks.tsx +5 -1
  38. package/client/your-questions.tsx +375 -0
  39. package/index.client.tsx +11 -3
  40. package/index.server.ts +162 -32
  41. package/package.json +1 -1
  42. package/server/agent-actions.ts +23 -14
  43. package/server/agent-hook.mjs +7 -5
  44. package/server/agent-parity.ts +21 -6
  45. package/server/ai-jobs.ts +26 -5
  46. package/server/brief-timeline.ts +47 -0
  47. package/server/context-requests.ts +90 -21
  48. package/server/directory.ts +6 -0
  49. package/server/discovery.ts +2 -0
  50. package/server/engine.ts +3 -0
  51. package/server/hook-source.ts +7 -5
  52. package/server/inbox-classifier.ts +17 -0
  53. package/server/inbox.ts +9 -3
  54. package/server/job-agent.ts +13 -2
  55. package/server/mcp-source.ts +23 -15
  56. package/server/mcp.mjs +23 -15
  57. package/server/obligations.ts +4 -1
  58. package/server/session-prompt.ts +30 -3
  59. package/server/turn-end.ts +133 -0
  60. package/server/wait-jobs.ts +18 -2
  61. package/server/wait.ts +17 -12
  62. package/shared/activity.ts +2 -1
  63. package/shared/agent-settings.ts +9 -8
  64. package/shared/catch-up.ts +65 -20
  65. package/shared/chat.ts +2 -2
  66. package/shared/compass.ts +5 -4
  67. package/shared/contracts.ts +52 -8
  68. package/shared/history.ts +160 -0
  69. package/shared/home-keys.ts +1 -0
  70. package/shared/home.ts +54 -8
  71. package/shared/job-rows.ts +2 -2
  72. package/shared/list.ts +4 -1
  73. package/shared/message-sender.ts +2 -0
  74. package/shared/model.ts +8 -0
  75. package/shared/new-name.ts +4 -1
  76. package/shared/now.ts +228 -0
  77. package/shared/onboarding.ts +17 -13
  78. package/shared/paged.ts +96 -0
  79. package/shared/provider-support.ts +83 -34
  80. package/shared/recommend.ts +1 -1
  81. package/shared/settings-nav.ts +3 -1
  82. package/shared/setup-popup.ts +28 -0
  83. package/shared/sort.ts +8 -1
  84. package/shared/status.ts +3 -1
  85. package/shared/wait.ts +2 -2
  86. package/shared/your-questions.ts +133 -0
  87. package/skills/follow-up/SKILL.md +1 -1
@@ -1,4 +1,5 @@
1
1
  import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";
2
+ import { usePagedList } from "./paged-list";
2
3
  import { Animated, Easing, Platform, View, type ViewStyle, type ScrollView as NativeScrollView } from "react-native";
3
4
  import { Pressable, Text } from "./text";
4
5
  import { openExternalUrl, useRpc, useSettings } from "@getpaseo/plugin/client";
@@ -10,7 +11,6 @@ import { autoSendWrites, checksSummary, providersReady, setupSteps, shownStep, t
10
11
  import { Button, IconButton, errorText, text, type Theme } from "./kit";
11
12
  import { ReviewerSettings } from "./reviewers";
12
13
  import { JobRows } from "./job-rows";
13
- import { DockedPane } from "./docked-pane";
14
14
  import { SETUP_ORDER } from "../shared/job-rows";
15
15
  import { ShippingStep, shippingKey } from "./shipping";
16
16
  import { useNewRowSetting } from "./new-entry";
@@ -19,6 +19,8 @@ import { NEW_NAME, NEW_ROW } from "../shared/new-name";
19
19
  import { UpdatesStep, useUpdates } from "./updates";
20
20
  import { Spinner, useReducedMotion } from "./motion";
21
21
  import { raised, runningColor, tint, withAlpha, type Colors } from "./theme";
22
+ import { DoneBody, FooterLink, SETUP_TITLE, SetupShell, WelcomeBody, type DoneFact } from "./setup-dialog";
23
+ import { closeSetup, setupSession, useSetupSession } from "./setup-ui";
22
24
 
23
25
  /**
24
26
  * Getting started: the steps that take a fresh install to a configured Follow-up. Shown in Home's place while the
@@ -40,9 +42,15 @@ export function useOnboarding() {
40
42
  export type SetupDeps = {
41
43
  /** Opens Follow-up's settings, on a category when given (agents, reviewers, following). */
42
44
  openSettings(category?: string): void;
45
+ /** Opens Follow-up's Home (the done page's Go to Home). */
46
+ openHome?(): void;
47
+ /** The plugin's display name, for the welcome page. */
48
+ name?: string;
49
+ /** What's new, one click away on the welcome and done pages: the installed version and how to open the notes. */
50
+ whatsNew?: { version: string; open(): void } | null;
43
51
  };
44
52
 
45
- const TITLES: Record<OnboardingStep, string> = {
53
+ export const TITLES: Record<OnboardingStep, string> = {
46
54
  intro: "Follow-up keeps your agents' PRs moving",
47
55
  checks: "Check your setup",
48
56
  defaults: "What Follow-up does without asking",
@@ -53,13 +61,6 @@ const TITLES: Record<OnboardingStep, string> = {
53
61
  tour: "Where to find things",
54
62
  };
55
63
 
56
- /** Bottom clearance on phones. TODO(rebase): kit.tsx's bottomInset from the mobile rework replaces this. */
57
- function bottomPad(compact: boolean): ViewStyle {
58
- if (!compact) return { paddingBottom: 16 };
59
- if (Platform.OS === "web") return { paddingBottom: "max(12px, env(safe-area-inset-bottom))" as unknown as number };
60
- return { paddingBottom: Platform.OS === "ios" ? 34 : 24 };
61
- }
62
-
63
64
  export function Setup({ theme, compact, view, deps }: { theme: Theme; compact: boolean; view: OnboardingView; deps: SetupDeps }) {
64
65
  const c = theme.colors; const t = text(c);
65
66
  const act = useRpc(setOnboardingRpc); const cache = useQueryClient(); const toast = useToast();
@@ -87,19 +88,22 @@ export function Setup({ theme, compact, view, deps }: { theme: Theme; compact: b
87
88
  const index = steps.indexOf(step);
88
89
  const move = useMutation({
89
90
  mutationFn: (input: Parameters<typeof act>[0]) => act(input),
90
- onSuccess: next => { if (!next.show) cache.setQueryData(onboardingKey, next); },
91
+ // Every answer goes in the cache, so the popup opened again (Finish setup) starts on the step it was left on.
92
+ onSuccess: next => cache.setQueryData(onboardingKey, next),
91
93
  onError: error => toast.error(errorText(error)),
92
94
  });
93
95
  const go = (next: OnboardingStep) => { if (step === "checks" && next !== "intro") frozen.current = steps; else if (next === "intro" || next === "checks") frozen.current = null; setStep(next); scroll.current?.scrollTo({ y: 0, animated: false }); move.mutate({ action: "step", step: next }); };
94
- const finish = () => move.mutate({ action: "finish" }, { onSuccess: () => {
95
- const n = follow.data?.workspaces.filter(w => w.enable_tracking && !w.optedOut).length ?? 0;
96
- toast.show(n ? `Set up. Following ${n} workspace${n === 1 ? "" : "s"}.` : "Set up. Follow-up starts with your next workspace.", { variant: "success" });
97
- } });
96
+ // Finish holds the done page up: the server already says setup is over, so the session keeps it (setup-ui.ts).
97
+ const finish = () => { setupSession.set({ done: true }); move.mutate({ action: "finish" }, { onError: () => setupSession.set({ done: false }) }); };
98
+ const ui = useSetupSession();
99
+ // Close only puts the popup away: say where it went, once, in words (the a11y hint says the same).
100
+ const closeUi = () => { closeSetup(); toast.show("Setup stays where you left it. Finish setup on Home opens it again."); };
101
+ const closeDone = () => { setupSession.set({ done: false }); deps.openHome?.(); };
98
102
  const skip = () => move.mutate({ action: "skip" }, { onSuccess: () => toast.show("Setup skipped. Set it up any time from Follow-up settings, General.") });
99
103
  const last = index === steps.length - 1;
100
104
  const failing = step === "checks" && checks.data ? checksSummary(checks.data.checks).state === "fail" : false;
101
105
 
102
- const body = step === "intro" ? <IntroStep theme={theme} compact={compact} follow={follow.data ?? null} />
106
+ const body = step === "intro" ? null
103
107
  : step === "checks" ? <ChecksStep theme={theme} compact={compact} checks={checks} deps={deps} />
104
108
  : step === "defaults" ? <DefaultsStep theme={theme} compact={compact} held={view.holdsAutoSends} />
105
109
  : step === "shipping" ? <ShippingStep theme={theme} compact={compact} />
@@ -109,7 +113,7 @@ export function Setup({ theme, compact, view, deps }: { theme: Theme; compact: b
109
113
  : <TourStep theme={theme} compact={compact} />;
110
114
  const lead: Record<OnboardingStep, string> = {
111
115
  intro: "It follows your agents' pull requests until the work is done, sends what needs fixing back to them as repairs, and asks you only for decisions.",
112
- checks: "Follow-up works with every agent Paseo runs. On Claude Code and Codex it also reminds agents at the end of each turn and can wait for their background jobs. GitHub is optional: with its CLI, Follow-up also follows your PRs.",
116
+ checks: "Follow-up works with every agent Paseo runs. GitHub is optional: with its CLI, Follow-up also follows your PRs.",
113
117
  defaults: "These are on now. Change anything here; it saves as you go, and Settings has the same switches.",
114
118
  shipping: "Follow-up merges and tracks PRs the way each repository already works. It picked these; change one if it's wrong.",
115
119
  reviewers: "When you press Add reviewers on a PR, Follow-up asks these people. Set a default for all repositories, or a list for one. Until then, PRs without reviewers show in Needs you.",
@@ -117,49 +121,42 @@ export function Setup({ theme, compact, view, deps }: { theme: Theme; compact: b
117
121
  helpers: "Follow-up's own agents. They read, summarise and rank. They never change code or message anyone.",
118
122
  tour: "Five places worth knowing. Everything else is in Settings.",
119
123
  };
120
- const column: ViewStyle = { width: "100%", maxWidth: 560, alignSelf: "center", paddingHorizontal: compact ? 16 : 24 };
121
124
 
122
- return <DockedPane compact={compact} scrollRef={scroll} style={{ backgroundColor: c.surface0 }} contentContainerStyle={{ paddingBottom: 24 }}
123
- header={<View style={[column, { flexDirection: "row", alignItems: "center", gap: 12, paddingTop: compact ? 8 : 20, paddingBottom: 8 }]}>
124
- <Progress theme={theme} index={index} steps={steps} onPick={i => i < index && go(steps[i])} />
125
- <Button theme={theme} compact={compact} kind="ghost" title="Skip setup" accessibilityHint="Leaves setup. Every setting keeps its current value." onPress={skip} disabled={move.isPending} />
126
- </View>}
127
- // While typing a reviewer on a phone the bar steps aside, so Continue never sits over the keyboard (DockedPane).
128
- dock={({ yields }) => !yields && <View style={[{ borderTopWidth: 1, borderTopColor: c.border, backgroundColor: c.surface0, paddingTop: 12 }, bottomPad(compact)]}>
129
- <View style={[column, { flexDirection: "row", alignItems: "center", gap: 8 }]}>
130
- {index > 0 && (compact
131
- ? <IconButton theme={theme} compact icon="ChevronLeft" label="Back" onPress={() => go(steps[index - 1])} />
132
- : <Button theme={theme} kind="ghost" icon="ChevronLeft" title="Back" onPress={() => go(steps[index - 1])} />)}
133
- {!compact && <View style={{ flex: 1 }} />}
134
- {step === "reviewers" && <Button theme={theme} compact={compact} kind="ghost" title="Skip, set later" onPress={() => go(steps[index + 1])} />}
135
- <Button theme={theme} compact={compact} grow={compact} kind="primary" icon={last ? "Check" : undefined}
136
- title={last ? "Finish" : failing ? "Continue anyway" : "Continue"} loading={last && move.isPending}
137
- onPress={() => last ? finish() : go(steps[index + 1])} />
138
- </View>
139
- </View>}>
140
- <StepFade key={step} style={[column, { gap: compact ? 14 : 16, paddingTop: compact ? 8 : 20 }]}>
125
+ const gh0 = checks.data?.checks.find(row => row.id === "gh");
126
+ const followed = follow.data?.workspaces.filter(w => w.enable_tracking && !w.optedOut).length ?? 0;
127
+ const facts: DoneFact[] = [
128
+ { icon: "Radar", tone: "success", line: followed ? `Following ${followed} workspace${followed === 1 ? "" : "s"}` : "Following the next workspace you create" },
129
+ { icon: "Send", line: follow.data?.enable_auto_sends_default ? "Repairs go to the agent on their own, once it's idle" : "Repairs wait for your click" },
130
+ { icon: "GitPullRequest", tone: gh0?.state === "ok" ? "success" : "muted", line: gh0?.state === "ok" ? "GitHub connected: Follow-up follows your PRs" : "GitHub not connected: Follow-up works without it" },
131
+ ];
132
+ const whatsNewLink = deps.whatsNew && <FooterLink theme={theme} compact={compact} icon="Gift" title={compact ? "What's new" : `What's new in ${deps.whatsNew.version}`} onPress={deps.whatsNew.open} />;
133
+ if (ui.done) return <SetupShell theme={theme} compact={compact} open page={{ kind: "cover" }} onClose={closeDone} scrollRef={scroll}
134
+ footer={<>{whatsNewLink}<View style={{ flex: 1 }} /><Button theme={theme} compact={compact} grow={compact} kind="primary" title={compact ? "Done" : "Go to Home"} onPress={closeDone} /></>}>
135
+ <StepFade key="done" style={{}}><DoneBody theme={theme} compact={compact} facts={facts} following={followed > 0} /></StepFade>
136
+ </SetupShell>;
137
+ if (step === "intro") return <SetupShell theme={theme} compact={compact} open page={{ kind: "cover" }} onClose={closeUi} scrollRef={scroll}
138
+ footer={<>{whatsNewLink}<View style={{ flex: 1 }} /><Button theme={theme} compact={compact} grow={compact} kind="primary" title={SETUP_TITLE} accessibilityHint="About two minutes. Nothing is sent on its own until you finish." onPress={() => go(steps[1])} /></>}>
139
+ <StepFade key="intro" style={{}}><WelcomeBody theme={theme} compact={compact} name={deps.name ?? "Follow-up"} /></StepFade>
140
+ </SetupShell>;
141
+ return <SetupShell theme={theme} compact={compact} open page={{ kind: "step", index: index - 1, count: steps.length - 1 }} onClose={closeUi} scrollRef={scroll}
142
+ footer={<>
143
+ {!compact && <FooterLink theme={theme} compact={compact} title="Skip setup" hint="Leaves setup. Every setting keeps its current value." onPress={skip} />}
144
+ {compact && <IconButton theme={theme} compact icon="ChevronLeft" label="Back" onPress={() => go(steps[index - 1])} />}
145
+ <View style={{ flex: compact ? 0 : 1 }} />
146
+ {!compact && <Button theme={theme} kind="ghost" icon="ChevronLeft" title="Back" onPress={() => go(steps[index - 1])} />}
147
+ {step === "reviewers" && <Button theme={theme} compact={compact} kind="ghost" title="Skip, set later" onPress={() => go(steps[index + 1])} />}
148
+ <Button theme={theme} compact={compact} grow={compact} kind="primary" icon={last ? "Check" : undefined}
149
+ title={last ? "Finish" : failing ? "Continue anyway" : "Continue"} loading={last && move.isPending}
150
+ onPress={() => last ? finish() : go(steps[index + 1])} />
151
+ </>}>
152
+ <StepFade key={step} style={{ gap: compact ? 14 : 16 }}>
141
153
  <View style={{ gap: 6 }}>
142
154
  <Text accessibilityRole="header" style={{ color: c.foreground, fontSize: 20, lineHeight: 26, fontWeight: "600" }}>{TITLES[step]}</Text>
143
- <Text style={[t.body, { color: c.foregroundMuted, maxWidth: 520 }]}>{lead[step]}</Text>
155
+ <Text style={[t.body, { color: c.foregroundMuted }]}>{lead[step]}</Text>
144
156
  </View>
145
157
  {body}
146
158
  </StepFade>
147
- </DockedPane>;
148
- }
149
-
150
- /** "2 of 5" and one short segment per step, drawn like the stack bar but in neutral ink: progress isn't a PR state. */
151
- function Progress({ theme, index, steps, onPick }: { theme: Theme; index: number; steps: readonly OnboardingStep[]; onPick: (i: number) => void }) {
152
- const c = theme.colors; const t = text(c);
153
- return <View style={{ flex: 1, flexDirection: "row", alignItems: "center", gap: 10 }} accessibilityRole="progressbar" accessibilityLabel={`Step ${index + 1} of ${steps.length}`}
154
- accessibilityValue={{ min: 1, max: steps.length, now: index + 1 }}>
155
- <Text style={[t.small, { minWidth: 34 }]}>{`${index + 1} of ${steps.length}`}</Text>
156
- <View style={{ flex: 1, maxWidth: 220, flexDirection: "row", gap: 3 }}>
157
- {steps.map((s, i) => <Pressable key={s} disabled={i >= index} onPress={() => onPick(i)} accessibilityLabel={i < index ? `Back to step ${i + 1}` : undefined}
158
- hitSlop={{ top: 12, bottom: 12 }} style={{ flex: 1, height: 14, justifyContent: "center" }}>
159
- <View style={{ height: 3, borderRadius: 2, backgroundColor: i === index ? c.foreground : i < index ? withAlpha(c.foreground, 0.4) : c.border }} />
160
- </Pressable>)}
161
- </View>
162
- </View>;
159
+ </SetupShell>;
163
160
  }
164
161
 
165
162
  /** Step change: a short fade and rise; reduced motion gets the content at once. */
@@ -198,70 +195,6 @@ const Panel = ({ c, children }: { c: Colors; children: ReactNode }) =>
198
195
 
199
196
  // ---------- 1. what it is ----------
200
197
 
201
- const EXAMPLE = [
202
- { glyph: "CircleX", tone: "danger", line: "Checks failed on #418", caption: "Follow-up notices the failed checks" },
203
- { glyph: "spinner", tone: "running", line: "Repair sent to the agent · 2m", caption: "and sends it as a repair to the agent that made the PR" },
204
- { glyph: "CircleCheck", tone: "success", dot: "warning", line: "#418 approved", caption: "then asks you only for the decision" },
205
- ] as const;
206
-
207
- function IntroStep({ theme, compact, follow }: { theme: Theme; compact: boolean; follow: { workspaces: { enable_tracking: boolean; optedOut: boolean }[] } | null }) {
208
- const c = theme.colors; const t = text(c);
209
- const reduced = useReducedMotion();
210
- // Reduced motion shows the last frame, derived in render so it holds even if the setting arrives after mount.
211
- const [step, setStep] = useState(0);
212
- useEffect(() => { if (reduced || step >= 2) return; const id = setTimeout(() => setStep(p => p + 1), 1600); return () => clearTimeout(id); }, [step, reduced]);
213
- const phase = reduced ? 2 : step;
214
- const n = follow?.workspaces.filter(w => w.enable_tracking && !w.optedOut).length ?? null;
215
- const tone = (k: string) => k === "danger" ? c.statusDanger : k === "success" ? c.statusSuccess : runningColor(c);
216
- const e = EXAMPLE[phase];
217
- return <View style={{ gap: 14 }}>
218
- <Panel c={c}>
219
- <View style={{ padding: compact ? 14 : 16, gap: 10 }}>
220
- <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
221
- <Text numberOfLines={1} style={[t.label, { flex: 1 }]}>TKT-1042 Add CSV export</Text>
222
- <Text style={[t.small, { paddingHorizontal: 6, paddingVertical: 1, borderRadius: 4, backgroundColor: c.surface2 }]}>Example</Text>
223
- </View>
224
- {/* The stack bar: #417 merged, #418 the one this example follows. */}
225
- <View style={{ flexDirection: "row", gap: 3, height: 4 }}>
226
- <View style={{ flex: 1, borderRadius: 2, backgroundColor: c.foregroundMuted, opacity: 0.55 }} />
227
- <View style={{ flex: 1, borderRadius: 2, backgroundColor: c.border, alignItems: "center", justifyContent: "center" }}>
228
- <View style={{ width: 10, height: 4, borderRadius: 2, backgroundColor: tone(e.tone) }} />
229
- </View>
230
- </View>
231
- <View accessibilityLiveRegion="polite" style={{ flexDirection: "row", alignItems: "center", gap: 8, minHeight: 20 }}>
232
- {e.glyph === "spinner" ? <Spinner color={runningColor(c)} size={14} /> : <Icon name={e.glyph} size={14} color={tone(e.tone)} />}
233
- <Text style={[t.body, { flex: 1 }]}>{e.line}</Text>
234
- {phase === 2 && <View style={{ flexDirection: "row", alignItems: "center", gap: 4, paddingHorizontal: 7, minHeight: 22, borderRadius: 11, backgroundColor: tint(c.statusWarning, c) }}>
235
- <Icon name="CircleAlert" size={12} color={c.statusWarning} />
236
- <Text style={{ color: c.statusWarning, fontSize: 12, lineHeight: 16, fontWeight: "600" }}>Needs you: Merge #418</Text>
237
- </View>}
238
- </View>
239
- </View>
240
- {/* What Follow-up did, step by step: the rail fills as the example plays. */}
241
- <View style={{ borderTopWidth: 1, borderTopColor: c.border, paddingHorizontal: compact ? 14 : 16, paddingVertical: 10, gap: 6 }}>
242
- {EXAMPLE.map((x, i) => <View key={x.line} style={{ flexDirection: "row", alignItems: "center", gap: 8, opacity: i <= phase ? 1 : 0.35 }}>
243
- <View style={{ width: 8, height: 8, borderRadius: 4, backgroundColor: i <= phase ? ("dot" in x ? c.statusWarning : tone(x.tone)) : c.border }} />
244
- <Text style={t.meta}>{x.caption}</Text>
245
- </View>)}
246
- </View>
247
- </Panel>
248
- <View style={{ gap: 4 }}>
249
- {[
250
- ["Inbox", "Needs you", "One list of what only you can decide: a merge, a question, a permission."],
251
- ["Send", "Repairs", "Review comments, conflicts and failed checks become repairs and go to the workspace's agent in one message."],
252
- ["MessageCircleQuestion", "Questions", "Agents ask you here, with options and a recommendation. Your answer goes to their chat."],
253
- ].map(([icon, title, line]) => <View key={title} style={{ flexDirection: "row", gap: 10, paddingVertical: 6 }}>
254
- <Icon name={icon} size={16} color={c.foregroundMuted} />
255
- <View style={{ flex: 1, gap: 1 }}><Text style={t.label}>{title}</Text><Text style={t.meta}>{line}</Text></View>
256
- </View>)}
257
- </View>
258
- {n !== null && <View style={{ flexDirection: "row", alignItems: "center", gap: 8, minHeight: compact ? 44 : 36, paddingHorizontal: 12, borderRadius: 8, backgroundColor: c.surface1 }}>
259
- <Icon name="Radar" size={14} color={c.foregroundMuted} />
260
- <Text style={[t.body, { flex: 1 }]}>{n ? `Already following your ${n} workspace${n === 1 ? "" : "s"}. Step 3 lists them.` : "No workspaces yet. Follow-up starts with the next one you create."}</Text>
261
- </View>}
262
- </View>;
263
- }
264
-
265
198
  // ---------- 2. checks ----------
266
199
 
267
200
  function ChecksStep({ theme, compact, checks, deps }: { theme: Theme; compact: boolean; checks: ReturnType<typeof useChecks>; deps: SetupDeps }) {
@@ -347,7 +280,8 @@ function DefaultsStep({ theme, compact, held }: { theme: Theme; compact: boolean
347
280
  const data = follow.data;
348
281
  const list = data?.workspaces ?? [];
349
282
  const followed = list.filter(w => w.enable_tracking && !w.optedOut).length;
350
- const shown = all || list.length <= 8 ? list : list.slice(0, 5);
283
+ // Eight or fewer show whole; more fold to five, and Show all opens pages (client/paged-list.tsx).
284
+ const page = usePagedList({ items: list, open: all, onToggle: () => setAll(v => !v), preview: list.length <= 8 ? 8 : 5, theme, compact, noun: "workspaces" });
351
285
  const trust = display.status === "ready" ? display.values.enable_trust_bypass : null;
352
286
  const saveDisplay = (patch: Partial<typeof displayPreferences.schema._output>) => {
353
287
  if (display.status !== "ready") return;
@@ -359,7 +293,7 @@ function DefaultsStep({ theme, compact, held }: { theme: Theme; compact: boolean
359
293
  <SwitchRow first theme={theme} compact={compact} label="Follow every workspace" hint={list.length ? "New and existing workspaces, except any you turn off below." : "Every workspace, from the first one you create."} value={data?.enable_follow_every ?? null} disabled={change.isPending}
360
294
  onChange={v => change.mutate([{ enable_follow_every: v }])}>
361
295
  {list.length > 0 && <View style={{ paddingLeft: compact ? 14 : 16, paddingBottom: 6 }}>
362
- {shown.map(w => {
296
+ {page.shown.map(w => {
363
297
  const on = w.enable_tracking && !w.optedOut;
364
298
  return <Pressable key={w.id} accessibilityRole="checkbox" accessibilityState={{ checked: on }} aria-checked={on} accessibilityLabel={`Follow ${w.title}`} disabled={change.isPending}
365
299
  onPress={() => change.mutate([{ workspace: { workspaceId: w.id, follow: !on } }])}
@@ -371,9 +305,7 @@ function DefaultsStep({ theme, compact, held }: { theme: Theme; compact: boolean
371
305
  </View>
372
306
  </Pressable>;
373
307
  })}
374
- {shown.length < list.length && <Pressable accessibilityRole="button" onPress={() => setAll(true)} style={{ minHeight: compact ? 44 : 32, justifyContent: "center", borderTopWidth: 1, borderTopColor: c.border }}>
375
- <Text style={[t.meta, { color: c.foreground }]}>{`Show all ${list.length}`}</Text>
376
- </Pressable>}
308
+ {page.footer}
377
309
  </View>}
378
310
  </SwitchRow>
379
311
  <SwitchRow theme={theme} compact={compact} label="Send repairs automatically" value={data?.enable_auto_sends_default ?? null} disabled={change.isPending}
@@ -422,7 +354,7 @@ function NewRowChoice({ theme, compact }: { theme: Theme; compact: boolean }) {
422
354
  const row = useNewRowSetting();
423
355
  return <View style={{ gap: 6, paddingTop: 6 }}>
424
356
  <Panel c={c}>
425
- <SwitchRow first theme={theme} compact={compact} label={NEW_ROW.label} hint={NEW_ROW.hint(row.key, isMac() ? "⌘K" : "Ctrl K")} value={row.value} disabled={row.saving} onChange={row.set} />
357
+ <SwitchRow first theme={theme} compact={compact} label={NEW_ROW.label} hint={compact ? NEW_ROW.hint(null, null) : NEW_ROW.hint(row.key, isMac() ? "⌘K" : "Ctrl K")} value={row.value} disabled={row.saving} onChange={row.set} />
426
358
  </Panel>
427
359
  {row.value !== false && <Text style={t.meta}>{NEW_ROW.paseoShort}</Text>}
428
360
  </View>;
@@ -0,0 +1,115 @@
1
+ import { useRef, useState, type ReactNode } from "react";
2
+ import { Platform, View } from "react-native";
3
+ import { Icon } from "@getpaseo/plugin/client/ui";
4
+ import { Pressable, Text } from "./text";
5
+ import { FoldRow, focusRing, type Theme } from "./kit";
6
+ import { PAGE, pageInfo, pageLabel, pageSpoken, type PageInfo } from "../shared/paged";
7
+
8
+ /**
9
+ * Every list that grows with use draws through here (invariant pr-scale-lists-batch-not-throw, "every list pages"):
10
+ * folded it shows `preview` rows and "Show all N"; opened it shows one page of `size` rows with the pager
11
+ * ("26–50 of 312", Previous, Next, Show less), never every row. A search pages its hits from the first page and has
12
+ * no fold. The same on desktop and phone; the pager's buttons are plain buttons, so Tab reaches them and Enter or
13
+ * Space presses them. 2026-11-26, Tom: "Show all" on a busy workspace lagged, then made the sidebar scroll for ever.
14
+ *
15
+ * Adopting it: keep the list's own rows and fold state; pass every item (or a server page's `total`, `Pager`).
16
+ */
17
+ export type Paged<T> = { shown: T[]; footer: ReactNode; info: PageInfo | null };
18
+
19
+ export function usePagedList<T>({ items, open = true, onToggle, searching = false, resetKey = "", follow, preview = PAGE.preview, size = PAGE.size, theme, compact, icon = "List", noun }: {
20
+ items: readonly T[];
21
+ /**
22
+ * The list's own fold state ("Show all" pressed) and its toggle. Without `onToggle` the list has no fold of its own
23
+ * (a card that folds whole, a settings section): it pages from the first row, with no Show all or Show less.
24
+ */
25
+ open?: boolean; onToggle?: () => void;
26
+ /** A search is narrowing the list: page its hits, no fold. */
27
+ searching?: boolean;
28
+ /** Anything that changes what the list is (a tab, the query): back to the first page. */
29
+ resetKey?: string;
30
+ /** A row the list keeps in view (Catch up's card on screen): a reset lands on its page, not the first. */
31
+ follow?: number;
32
+ preview?: number; size?: number; theme: Theme; compact: boolean; icon?: string;
33
+ /** What a row is, for the spoken pager ("questions"). */
34
+ noun?: string;
35
+ }): Paged<T> {
36
+ const [state, setState] = useState({ key: resetKey, page: 0 });
37
+ const page = state.key === resetKey ? state.page : follow !== undefined && follow >= 0 ? Math.floor(follow / size) : 0;
38
+ const setPage = (p: number) => setState({ key: resetKey, page: p });
39
+ const c = theme.colors;
40
+ const folds = !!onToggle && !searching;
41
+ if (folds && !open) {
42
+ const footer = items.length > preview ? <FoldRow theme={theme} compact={compact} open={false} onPress={onToggle!} icon={icon} iconColor={c.foregroundMuted} label={`Show all ${items.length}`} /> : null;
43
+ return { shown: items.slice(0, preview), footer, info: null };
44
+ }
45
+ const info = pageInfo(items.length, page, size);
46
+ const shown = items.slice(info.from, info.to);
47
+ const footer = info.pages > 1 || (folds && items.length > preview)
48
+ ? <Pager theme={theme} compact={compact} info={info} onPage={setPage} onLess={folds ? () => { setPage(0); onToggle!(); } : undefined} noun={noun} />
49
+ : null;
50
+ return { shown, footer, info };
51
+ }
52
+
53
+ /** The pager row: Show less on the left; Previous, "26–50 of 312", Next on the right. A server-paged list draws it with its own PageInfo. */
54
+ export function Pager({ theme, compact, info, onPage: setPage, onLess, noun, busy = false }: { theme: Theme; compact: boolean; info: PageInfo; onPage: (page: number) => void; onLess?: () => void; noun?: string; busy?: boolean }) {
55
+ const c = theme.colors;
56
+ const self = useRef<View>(null);
57
+ // A new page starts at its first row: when the list's top has scrolled out of view (a long page, the pager at the
58
+ // bottom), bring it back, or the reader lands at the end of the page they asked for.
59
+ const onPage = (to: number) => { setPage(to); if (Platform.OS === "web") setTimeout(() => { const css = (globalThis as { getComputedStyle?(e: El): { overflowY: string } }).getComputedStyle; if (css) toListStart(self.current as unknown as El | null, e => css(e).overflowY); }, 0); };
60
+ const size = compact ? 44 : 28;
61
+ const arrow = (iconName: string, label: string, to: number, enabled: boolean) => <Pressable accessibilityRole="button" accessibilityLabel={label} accessibilityState={{ disabled: !enabled }} aria-disabled={!enabled}
62
+ disabled={!enabled} onPress={() => onPage(to)} hitSlop={compact ? 0 : 4}
63
+ style={state => ({ width: size, height: size, borderRadius: 6, alignItems: "center", justifyContent: "center", opacity: enabled ? 1 : 0.35,
64
+ backgroundColor: state.pressed ? c.surface2 : (state as { hovered?: boolean }).hovered && enabled ? c.surface1 : "transparent", ...focusRing((state as { focused?: boolean }).focused, c) })}>
65
+ <Icon name={iconName} size={15} color={c.foregroundMuted} />
66
+ </Pressable>;
67
+ const spoken = `${pageSpoken(info)}${noun ? ` ${noun}` : ""}, page ${info.page + 1} of ${info.pages}`;
68
+ return <View ref={self} style={{ flexDirection: "row", alignItems: "center", gap: 4, paddingHorizontal: compact ? 8 : 6, paddingVertical: compact ? 2 : 4, minHeight: compact ? 48 : 36, borderTopWidth: 1, borderTopColor: c.border }}>
69
+ {onLess && <Pressable accessibilityRole="button" accessibilityLabel="Show less" onPress={onLess} hitSlop={compact ? 0 : 4}
70
+ style={state => ({ flexDirection: "row", alignItems: "center", gap: 6, minHeight: size, paddingHorizontal: 8, borderRadius: 6,
71
+ backgroundColor: state.pressed ? c.surface2 : (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent", ...focusRing((state as { focused?: boolean }).focused, c) })}>
72
+ <Icon name="ChevronUp" size={14} color={c.foregroundMuted} />
73
+ <Text style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 17, fontWeight: "600" }}>Show less</Text>
74
+ </Pressable>}
75
+ <View style={{ flex: 1 }} />
76
+ {info.pages > 1 && <>
77
+ {arrow("ChevronLeft", "Previous page", info.page - 1, info.page > 0 && !busy)}
78
+ <Text accessibilityLabel={spoken} accessibilityLiveRegion="polite" aria-live="polite" style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 17, fontVariant: ["tabular-nums"], minWidth: 72, textAlign: "center", opacity: busy ? 0.6 : 1 }}>{pageLabel(info)}</Text>
79
+ {arrow("ChevronRight", "Next page", info.page + 1, info.page < info.pages - 1 && !busy)}
80
+ </>}
81
+ </View>;
82
+ }
83
+
84
+ /** The few DOM calls toListStart makes (react-native-web hands a View's ref its element; the client has no DOM lib). */
85
+ export type El = { parentElement: El | null; getBoundingClientRect(): { top: number }; getAttribute?(name: string): string | null; scrollIntoView?(o: { block: "start" }): void };
86
+
87
+ /** What marks a list's top: a Card sets it (`dataSet={{ pagedTop: "" }}`), so a page turn brings back the card's header. */
88
+ export const PAGED_TOP = "data-paged-top";
89
+
90
+ /**
91
+ * A new page starts at its top (web): the pager sits under 25 rows, so after Next the reader would land at the end of
92
+ * the new page. Find the list's top (the nearest card above the pager, else the pager's parent) and, when it has
93
+ * scrolled above its scroll container's view, scroll it back to the top of the view.
94
+ */
95
+ export function toListStart(pager: El | null, overflowY: (e: El) => string) {
96
+ let top: El | null = pager?.parentElement ?? null;
97
+ for (let e = top; e; e = e.parentElement) if (e.getAttribute?.(PAGED_TOP) != null) { top = e; break; }
98
+ if (!top) return false;
99
+ let box: El | null = top.parentElement;
100
+ while (box && !/(auto|scroll)/.test(overflowY(box))) box = box.parentElement;
101
+ const viewTop = box ? box.getBoundingClientRect().top : 0;
102
+ if (top.getBoundingClientRect().top >= viewTop) return false;
103
+ top.scrollIntoView?.({ block: "start" });
104
+ return true;
105
+ }
106
+
107
+ /**
108
+ * A list drawn inside a condition or a fold (a settings section, a sheet): its rows and pager as one element, so it
109
+ * pages without a hook in its parent. `row` gets the item and its index in the whole list.
110
+ */
111
+ export function PagedRows<T>({ items, row, ...opts }: { items: readonly T[]; row: (item: T, index: number) => ReactNode } & Omit<Parameters<typeof usePagedList<T>>[0], "items">) {
112
+ const page = usePagedList({ items, ...opts });
113
+ const from = page.info?.from ?? 0;
114
+ return <>{page.shown.map((x, i) => row(x, from + i))}{page.footer}</>;
115
+ }
package/client/panel.tsx CHANGED
@@ -1,4 +1,5 @@
1
1
  import { useEffect, useRef, useState, type ReactNode } from "react";
2
+ import { PagedRows } from "./paged-list";
2
3
  import type { SettingsCategory } from "../shared/settings-nav";
3
4
  import { recoveryActions } from "./recovery-actions";
4
5
  import { Platform, View, type ScrollView as NativeScrollView } from "react-native";
@@ -8,6 +9,7 @@ import { useAgent, useRpc, useTabState, openExternalUrl, type PluginHostProps, t
8
9
  import { z } from "zod";
9
10
  import type { InboxStore } from "./inbox-store";
10
11
  import { useInbox } from "./inbox";
12
+ import { AgentLines } from "./now-lines";
11
13
  import { BriefCard, type BriefDeps } from "./brief";
12
14
  import { briefAsks, liveBrief, type Brief } from "../shared/brief";
13
15
  import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
@@ -25,6 +27,7 @@ import { WorkspaceHeader } from "./header";
25
27
  import { PanelMore } from "./panel-menu";
26
28
  import type { HomeSources } from "./home-data";
27
29
  import { NeedsYouBlock, overviewKey, workspaceKey } from "./needs-you";
30
+ import { YourQuestionsCard, useWorkspaceRunning } from "./your-questions";
28
31
  import { browserKey } from "./keys";
29
32
  import { useWorkspace } from "./workspace-data";
30
33
  import type { LiveStore } from "./live";
@@ -33,11 +36,13 @@ import { TasksCard } from "./tasks";
33
36
  import { MessagesCard } from "./messages";
34
37
  import { PrSheet } from "./pr-sheet";
35
38
  import { ActivityCard, QuestionSheet } from "./questions";
39
+ import type { Question } from "../shared/questions";
36
40
  import { SpecRow, SpecSheet } from "./spec";
37
41
  import { LinkedItemsRow } from "./linked";
38
42
  import { mergedColor, tint } from "./theme";
39
43
  import { SummaryRow } from "./about";
40
44
  import { WhatsNewGate } from "./release-notes";
45
+ import { SetupGate } from "./setup-gate";
41
46
  import { ViewSync } from "./view-store";
42
47
  import { RichText } from "./rich-text";
43
48
  import { ToastHost, useQuestionOpener } from "./toasts";
@@ -53,7 +58,7 @@ type PanelProps = PluginWorkspacePanelProps & PanelLinks & { inbox?: InboxStore;
53
58
  * tasks, questions, spec, activity and Details. What needs you elsewhere lives on Home.
54
59
  */
55
60
  export function FollowPanel(props: PanelProps) {
56
- return <><ViewSync /><PanelBody {...props} /><WhatsNewGate surface="panel" theme={props.theme} compact={props.layout.compact} /><ToastHost theme={props.theme} compact={props.layout.compact} /></>;
61
+ return <><ViewSync /><PanelBody {...props} /><WhatsNewGate surface="panel" theme={props.theme} compact={props.layout.compact} /><SetupGate surface="panel" theme={props.theme} compact={props.layout.compact} deps={{ openSettings: props.openSettings, openHome: props.openOverview }} /><ToastHost theme={props.theme} compact={props.layout.compact} /></>;
57
62
  }
58
63
 
59
64
  function PanelBody(props: PanelProps) {
@@ -228,7 +233,7 @@ function WorkspaceCard({ workspace: w, theme, compact, open, toggle, openAgent,
228
233
  {openAgent && <Button theme={theme} compact={compact} icon="MessageSquare" title="Open" accessibilityLabel="Open main agent" onPress={() => openAgent(w.mainAgentId)} />}
229
234
  </View>
230
235
  <MainChangeNotice workspace={w} theme={theme} compact={compact} />
231
- {(w.contributorAgentIds ?? []).map(id => <OtherRootAgent key={id} agentId={id} workspace={w} theme={theme} compact={compact} openAgent={openAgent} mainAgentId={w.mainAgentId} />)}
236
+ <PagedRows items={w.contributorAgentIds ?? []} theme={theme} compact={compact} noun="agents" row={id => <OtherRootAgent key={id} agentId={id} workspace={w} theme={theme} compact={compact} openAgent={openAgent} mainAgentId={w.mainAgentId} />} />
232
237
  </CardRow>
233
238
  <CardRow theme={theme} compact={compact}>
234
239
  <View style={{ gap: 8 }}>
@@ -343,11 +348,15 @@ const folds = z.object({ open: z.array(z.string()) });
343
348
  /** Two columns from this content width: actions on the left, the stacks on the right. */
344
349
  export const WIDE_MIN = 820;
345
350
 
346
- export function WorkspaceView({ theme, layout, workspace: w, navigation, loadError, openSettings, openOverview, folds: { isOpen, toggle }, resize, large = false, top, ask, sources }: PluginHostProps & {
351
+ export function WorkspaceView({ theme, layout, workspace: w, navigation, loadError, openSettings, openOverview, folds: { isOpen, toggle }, resize, large = false, top, ask, sources, paseo, inbox }: PluginHostProps & {
352
+ /** The inbox rows' store, for each agent's line (client/now-lines.tsx). Absent: the lines read the record alone. */
353
+ inbox?: InboxStore;
347
354
  navigation?: PluginWorkspacePanelProps["navigation"]; workspace: Workspace; loadError?: string | null; openSettings: (category?: SettingsCategory) => void; openOverview: () => void; top?: ReactNode; /** The main agent's open brief and its card, for the Needs you block. */ ask?: { brief: Brief; card: ReactNode } | null;
348
355
  folds: Folds; resize: { icon: "Maximize2" | "Minimize2"; label: string; onPress: () => void } | null; large?: boolean;
349
356
  /** Home's sources: the header's More menu (the row menu). Absent in the larger view. */
350
357
  sources?: HomeSources;
358
+ /** Paseo's workspace list where Home's sources aren't passed (the larger view): Your questions' running state. */
359
+ paseo?: HomeSources["paseo"];
351
360
  }) {
352
361
  const control = useRpc(controlRpc); const refresh = useRpc(refreshRpc); const browserRead = useRpc(browserStatusRpc);
353
362
  const cache = useQueryClient(); const toast = useToast();
@@ -361,6 +370,8 @@ export function WorkspaceView({ theme, layout, workspace: w, navigation, loadErr
361
370
  const wide = !compact && width >= WIDE_MIN;
362
371
  const [sheet, setSheet] = useState<{ key: string; intent: "merge" | "reviewers" | null } | null>(null);
363
372
  const [question, setQuestion] = useState<string | null>(null);
373
+ // An Activity row's question past what follow.get carries (shared/history.ts): the sheet draws the page's copy.
374
+ const [oldQuestion, setOldQuestion] = useState<Question | null>(null);
364
375
  useQuestionOpener(w.id, setQuestion);
365
376
  const [specOpen, setSpecOpen] = useState(false);
366
377
  const [moreMenu, setMoreMenu] = useState<ReactNode>(null);
@@ -377,10 +388,15 @@ export function WorkspaceView({ theme, layout, workspace: w, navigation, loadErr
377
388
  const openPr = (key: string) => setSheet({ key, intent: null });
378
389
  // The expand button only appears while the panel is narrow; a wide panel or the larger view keeps its collapse button.
379
390
  const resizeShown = compact ? null : resize?.icon === "Maximize2" && wide ? null : resize;
380
- const header = <WorkspaceHeader workspace={w} theme={theme} compact={compact} now={now} onSettings={openSettings} onRefresh={() => update.mutate()} refreshing={update.isPending} onAuto={next => auto.mutate(next)} autoPending={auto.isPending} notice={loadError ?? null} onOpenPr={openPr} resize={resizeShown} hideTitle={large} onHome={compact ? openOverview : undefined} openAgent={openAgent}
391
+ const header = <WorkspaceHeader workspace={w} theme={theme} compact={compact} now={now} onSettings={openSettings} onRefresh={() => update.mutate()} refreshing={update.isPending} onAuto={next => auto.mutate(next)} autoPending={auto.isPending} notice={loadError ?? null} onOpenPr={openPr} resize={resizeShown} hideTitle={large} onHome={compact ? openOverview : undefined} openAgent={openAgent} agentLines={!done}
381
392
  more={sources ? <PanelMore w={w} sources={sources} theme={theme} compact={compact} openAgent={openAgent} openQuestion={setQuestion} showMenu={setMoreMenu} /> : undefined} />;
393
+ const running = useWorkspaceRunning(sources?.paseo ?? paseo, w.id);
382
394
  const shipped = <ShippedCard workspace={w} theme={theme} compact={compact} now={now} />;
395
+ // What each agent is on now (shared/now.ts); once shipped nobody is working toward the goal.
396
+ const agents = !done && <AgentLines workspace={w} inbox={inbox} theme={theme} compact={compact} now={now} openAgent={openAgent} />;
383
397
  const needs = <NeedsYouBlock workspace={w} theme={theme} compact={compact} now={now} brief={ask?.brief ?? null} briefCard={ask?.card ?? null} actions={{ openAgent, openPr: (key, intent) => setSheet({ key, intent }), openQuestion: setQuestion }} />;
398
+ // Your questions (docs/needs-you.md#your-questions): under Needs you, the same card as Home's detail pane.
399
+ const questions = <YourQuestionsCard workspaceId={w.id} mainAgentId={w.mainAgentId} theme={theme} compact={compact} openAgent={openAgent} running={running} />;
384
400
  // Once shipped, the stack and tasks are history: one quiet fold instead of two near-empty cards.
385
401
  const history = done && <View style={{ marginHorizontal: compact ? 16 : 12, marginTop: 12, borderRadius: 8, borderWidth: 1, borderColor: theme.colors.border, overflow: "hidden" }}>
386
402
  <View style={{ marginTop: -1 }}><FoldRow theme={theme} compact={compact} open={isOpen("history")} onPress={() => toggle("history")} icon="History" iconColor={theme.colors.foregroundMuted} label={historyLabel(w)} /></View>
@@ -397,7 +413,7 @@ export function WorkspaceView({ theme, layout, workspace: w, navigation, loadErr
397
413
  const tasks = showWork && <TasksCard workspace={w} theme={theme} compact={compact} open={isOpen} toggle={toggle} onOpenQuestion={setQuestion} openAgent={openAgent} onShowActivity={showActivity} now={now} />;
398
414
  // The send queue (what Follow-up sends the main agent next, and the repairs in it) is Follow-up's, not the agent's to-do list.
399
415
  const messages = showWork && <MessagesCard workspace={w} theme={theme} compact={compact} openAgent={openAgent} now={now} />;
400
- const log = <View ref={logRef} onLayout={e => { logY.current = e.nativeEvent.layout.y; }}><ActivityCard workspace={w} theme={theme} compact={compact} now={now} open={isOpen} toggle={toggle} onOpenQuestion={setQuestion} /></View>;
416
+ const log = <View ref={logRef} onLayout={e => { logY.current = e.nativeEvent.layout.y; }}><ActivityCard workspace={w} theme={theme} compact={compact} now={now} open={isOpen} toggle={toggle} onOpenQuestion={(id, q) => { setOldQuestion(q ?? null); setQuestion(id); }} /></View>;
401
417
  const extras = <WorkspaceCard workspace={w} theme={theme} compact={compact} open={isOpen} toggle={toggle} openAgent={openAgent} browserReady={browser.data ? browser.data.ready : null} openOverview={openOverview} editSpec={() => setSpecOpen(true)} />;
402
418
  return <View onLayout={event => setWidth(event.nativeEvent.layout.width)} style={{ flex: 1, backgroundColor: theme.colors.surface0 }}>
403
419
  {/* Phones fold the top bar into the header's own row. */}
@@ -405,12 +421,12 @@ export function WorkspaceView({ theme, layout, workspace: w, navigation, loadErr
405
421
  <ScrollView ref={scrollRef} style={{ flex: 1 }} contentContainerStyle={{ paddingBottom: 20, ...(large ? { maxWidth: 1240, width: "100%", alignSelf: "center", paddingHorizontal: 12 } : null) }}>
406
422
  {header}
407
423
  {wide ? <View style={{ flexDirection: "row", alignItems: "flex-start" }}>
408
- <View style={{ flex: 5, minWidth: 0 }}>{shipped}{needs}{history}{messages}{tasks}</View>
424
+ <View style={{ flex: 5, minWidth: 0 }}>{agents}{shipped}{needs}{questions}{history}{messages}{tasks}</View>
409
425
  <View style={{ flex: 6, minWidth: 0 }}>{stacks}{log}{extras}</View>
410
- </View> : <>{shipped}{needs}{history}{messages}{stacks}{tasks}{log}{extras}</>}
426
+ </View> : <>{agents}{shipped}{needs}{questions}{history}{messages}{stacks}{tasks}{log}{extras}</>}
411
427
  </ScrollView>
412
428
  <PrSheet workspace={w} prKey={sheet?.key ?? null} intent={sheet?.intent ?? null} theme={theme} compact={compact} browserReady={browser.data?.ready ?? false} onClose={() => setSheet(null)} />
413
- <QuestionSheet workspace={w} questionId={question} theme={theme} compact={compact} openAgent={openAgent} onClose={() => setQuestion(null)} />
429
+ <QuestionSheet workspace={w} questionId={question} fallback={oldQuestion} theme={theme} compact={compact} openAgent={openAgent} onClose={() => setQuestion(null)} />
414
430
  <SpecSheet workspace={w} open={specOpen} theme={theme} compact={compact} onClose={() => setSpecOpen(false)} />
415
431
  {/* The More menu draws last, at the panel's root, so the panel's own content never paints over it. */}
416
432
  {moreMenu}
@@ -1,4 +1,5 @@
1
1
  import { useEffect, useState, type ReactNode } from "react";
2
+ import { PagedRows } from "./paged-list";
2
3
  import { ActivityIndicator, TextInput, View } from "react-native";
3
4
  import { Text } from "./text";
4
5
  import { useRpc } from "@getpaseo/plugin/client";
@@ -45,7 +46,7 @@ export function PrStatsSettings({ theme, compact, onPage = false }: { theme: The
45
46
  {query.error && <SettingsCard><SettingsAction label="Couldn't load PR statistics" hint={errorText(query.error)} actionLabel="Retry" onPress={() => void query.refetch()} /></SettingsCard>}
46
47
  {data && <>
47
48
  <SettingsCard>
48
- {data.repos.map(row => <View key={row.repo}>
49
+ <PagedRows items={data.repos} theme={theme} compact={compact} noun="repositories" row={row => <View key={row.repo}>
49
50
  <SettingsSwitch label={row.repo} hint={statsRepoLine(row, data.timeZone)} value={row.state === "on"} disabled={change.isPending}
50
51
  onValueChange={on => {
51
52
  if (on && row.state === "paused") change.mutate({ repo: row.repo, enable: true, toast: `${row.repo}: PR statistics on` });
@@ -60,7 +61,7 @@ export function PrStatsSettings({ theme, compact, onPage = false }: { theme: The
60
61
  {row.state === "on" && <OptionsFold row={row} theme={theme} compact={compact}>
61
62
  <RepoOptions row={row} theme={theme} compact={compact} busy={change.isPending} set={(input, label) => change.mutate({ repo: row.repo, ...input, toast: `${row.repo}: ${label}` })} />
62
63
  </OptionsFold>}
63
- </View>)}
64
+ </View>} />
64
65
  {/* A repository Follow-up hasn't seen yet. */}
65
66
  <SubmitScope enabled={addValid} onSubmit={() => setOptIn(adding.trim())} style={{ flexDirection: compact ? "column" : "row", alignItems: compact ? "stretch" : "center", gap: 8, paddingHorizontal: compact ? 16 : 14, paddingVertical: 10, borderTopWidth: data.repos.length ? 1 : 0, borderTopColor: c.border }}>
66
67
  <TextInput accessibilityLabel="Another repository, owner/repo" value={adding} onChangeText={setAdding} placeholder="Another repository: owner/repo" placeholderTextColor={c.foregroundMuted} autoCapitalize="none" autoCorrect={false}