paseo-follow-up 2.4.0-beta.9 → 2.4.0

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 (97) hide show
  1. package/CHANGELOG.md +159 -0
  2. package/OVERVIEW.md +1 -1
  3. package/README.md +81 -22
  4. package/client/agents.tsx +8 -26
  5. package/client/brief-since.tsx +4 -3
  6. package/client/compass-settings.tsx +156 -87
  7. package/client/display.tsx +2 -1
  8. package/client/header.tsx +2 -2
  9. package/client/home-chrome.tsx +24 -13
  10. package/client/home-data.ts +1 -1
  11. package/client/home-list.tsx +2 -1
  12. package/client/home-view.ts +7 -9
  13. package/client/home.tsx +9 -4
  14. package/client/job-rows.tsx +56 -7
  15. package/client/list-keys.ts +2 -1
  16. package/client/morning-brief-settings.tsx +11 -1
  17. package/client/new-entry.tsx +42 -2
  18. package/client/new-settings.tsx +29 -13
  19. package/client/new.tsx +89 -43
  20. package/client/onboarding.tsx +75 -29
  21. package/client/release-notes.tsx +11 -7
  22. package/client/reviewers.tsx +1 -1
  23. package/client/row-badges.tsx +37 -0
  24. package/client/search-focus.ts +85 -0
  25. package/client/search-key.ts +6 -12
  26. package/client/stacks.tsx +9 -2
  27. package/docs/screenshots/follow-up-slide-1-cover.png +0 -0
  28. package/docs/screenshots/follow-up-slide-2-decision.png +0 -0
  29. package/docs/screenshots/follow-up-slide-3-overseer.png +0 -0
  30. package/docs/screenshots/follow-up-slide-4-repairs.png +0 -0
  31. package/docs/screenshots/follow-up-slide-5-deploy.png +0 -0
  32. package/docs/screenshots/follow-up-slide-6-catch-up.png +0 -0
  33. package/index.client.tsx +12 -6
  34. package/index.server.ts +89 -25
  35. package/package.json +4 -3
  36. package/paseo-plugin.json +7 -9
  37. package/server/about.ts +4 -1
  38. package/server/agent-hook.mjs +12 -4
  39. package/server/agent-settings.ts +19 -3
  40. package/server/brief-sources.ts +4 -2
  41. package/server/compass.ts +310 -41
  42. package/server/daemon.ts +11 -3
  43. package/server/dispatch.ts +3 -2
  44. package/server/engine.ts +19 -6
  45. package/server/github-api.ts +17 -6
  46. package/server/github-setup.ts +126 -0
  47. package/server/github.ts +28 -0
  48. package/server/hook-source.ts +12 -4
  49. package/server/host-features.ts +21 -1
  50. package/server/linear-issues.ts +4 -3
  51. package/server/linear-queue.ts +3 -0
  52. package/server/mcp-source.ts +5 -3
  53. package/server/mcp.mjs +5 -3
  54. package/server/memory.ts +47 -19
  55. package/server/onboarding.ts +3 -2
  56. package/server/pr-actions.ts +12 -1
  57. package/server/pr-stats-sync.ts +4 -2
  58. package/server/pr-stats.ts +4 -0
  59. package/server/ranker.ts +4 -2
  60. package/server/reviewer-config.ts +3 -1
  61. package/server/session-mcp.ts +3 -2
  62. package/server/session-prompt.ts +34 -8
  63. package/server/wait-for-checks.ts +9 -0
  64. package/shared/agent-settings.ts +17 -9
  65. package/shared/attention.ts +4 -0
  66. package/shared/brief-sources.ts +23 -8
  67. package/shared/changelog.ts +32 -8
  68. package/shared/compass.ts +155 -25
  69. package/shared/contracts.ts +2 -2
  70. package/shared/dispatch.ts +61 -6
  71. package/shared/display.ts +4 -1
  72. package/shared/github-setup.ts +46 -0
  73. package/shared/job-rows.ts +40 -6
  74. package/shared/list-entries.ts +3 -2
  75. package/shared/model.ts +6 -0
  76. package/shared/new-name.ts +27 -0
  77. package/shared/new-view.ts +11 -8
  78. package/shared/onboarding.ts +77 -15
  79. package/shared/provider-support.ts +70 -0
  80. package/shared/recommend.ts +3 -2
  81. package/shared/row-badges.ts +24 -0
  82. package/shared/search-focus.ts +76 -0
  83. package/shared/search-key.ts +3 -2
  84. package/shared/settings-nav.ts +2 -1
  85. package/docs/screenshots/follow-up-home.png +0 -0
  86. package/docs/screenshots/follow-up-linked-items.png +0 -0
  87. package/docs/screenshots/follow-up-notes-home.png +0 -0
  88. package/docs/screenshots/follow-up-notes-panel.png +0 -0
  89. package/docs/screenshots/follow-up-panel.png +0 -0
  90. package/docs/screenshots/follow-up-phone.png +0 -0
  91. package/docs/screenshots/follow-up-pill.png +0 -0
  92. package/docs/screenshots/follow-up-pr-sheet.png +0 -0
  93. package/docs/screenshots/follow-up-questions.png +0 -0
  94. package/docs/screenshots/follow-up-send-to-paseo-dark.png +0 -0
  95. package/docs/screenshots/follow-up-send-to-paseo-light.png +0 -0
  96. package/docs/screenshots/follow-up-setup.png +0 -0
  97. package/docs/screenshots/follow-up-sidebar.png +0 -0
@@ -14,6 +14,7 @@ import type { z } from "zod";
14
14
  export type QueueNeeds = z.infer<typeof queueNeedsSchema>;
15
15
  const NO_QUEUE: QueueNeeds = { needs: [], timeZone: "UTC", revision: "" };
16
16
  import { onVisible, whileVisible } from "./visibility";
17
+ import { createWebSearchFocus } from "./search-focus";
17
18
  import type { ContextRequest } from "../shared/catch-up";
18
19
 
19
20
  /**
@@ -67,7 +68,6 @@ export function createHomeExtras(client: PluginClientContext) {
67
68
  const readContext = async () => setContext((await client.rpc(contextListRpc, {})).requests);
68
69
  const agents = new Map<string, AgentLite>();
69
70
  let version = 0;
70
- let focusToken = 0; let focusPending = false;
71
71
  let stopped = false;
72
72
  const listeners = new Set<() => void>();
73
73
  let pending: ReturnType<typeof setTimeout> | null = null;
@@ -94,6 +94,8 @@ export function createHomeExtras(client: PluginClientContext) {
94
94
  void run();
95
95
  return () => { off = true; runs.delete(wake); if (next) { clearTimeout(next); timers.delete(next); next = null; } };
96
96
  };
97
+ const searchFocus = createWebSearchFocus();
98
+ const offSearchFocus = searchFocus.install();
97
99
  const offVisible = onVisible(() => { for (const r of runs) void r(); });
98
100
  const together = (stops: (() => void)[]) => () => { for (const s of stops) s(); };
99
101
  const readRank = async () => {
@@ -288,15 +290,11 @@ export function createHomeExtras(client: PluginClientContext) {
288
290
  return out;
289
291
  },
290
292
  agents: () => [...agents.values()],
291
- /** Bumped by ⌘K "Follow-up: Search" and the search key; the visible search field focuses when it changes. */
292
- focusToken: () => focusToken,
293
293
  /**
294
- * Asks Home's search to take the cursor: now if Home is mounted, else as soon as it mounts (a Home opened by this
295
- * very request mounts after the call, so a bare token bump would be missed).
294
+ * The one owner of "put the caret in Home's search" (every-search-request-lands-in-the-visible-search): the search
295
+ * key, ⌘K "Follow-up: Search" and `/` ask it; the search field on screen takes it (client/search-focus.ts).
296
296
  */
297
- focusSearch() { focusToken++; focusPending = true; emit(); },
298
- /** True once per focusSearch: the search field that takes it focuses. */
299
- takeFocus() { const was = focusPending; focusPending = false; return was; },
297
+ searchFocus,
300
298
  /** Calls `listener` when an agent's status, attention or permissions change (see above). */
301
299
  onActivity(listener: () => void) { activity.add(listener); return () => { activity.delete(listener); }; },
302
300
  /** Each update Paseo sends about one agent (null when it's removed). */
@@ -304,7 +302,7 @@ export function createHomeExtras(client: PluginClientContext) {
304
302
  const set = agentWatchers.get(agentId) ?? new Set(); set.add(listener); agentWatchers.set(agentId, set);
305
303
  return () => { set.delete(listener); if (!set.size) agentWatchers.delete(agentId); };
306
304
  },
307
- async stop() { stopped = true; stopFeeds(); offVisible(); activity.clear(); for (const t of timers) clearTimeout(t); timers.clear(); if (pending) clearTimeout(pending); listeners.clear(); unsubscribe(); await release?.(); },
305
+ async stop() { stopped = true; stopFeeds(); offVisible(); offSearchFocus(); activity.clear(); for (const t of timers) clearTimeout(t); timers.clear(); if (pending) clearTimeout(pending); listeners.clear(); unsubscribe(); await release?.(); },
308
306
  };
309
307
  }
310
308
  export type HomeExtras = ReturnType<typeof createHomeExtras>;
package/client/home.tsx CHANGED
@@ -61,6 +61,7 @@ import { PrLinksProvider, RichText } from "./rich-text";
61
61
  import { TOAST_ANCHOR, ToastHost, useQuestionOpener } from "./toasts";
62
62
  import { openRowCopy, useDetailGate, useWorkspace } from "./workspace-data";
63
63
  import type { ListWorkspace } from "../shared/list";
64
+ import { NEW_NAME } from "../shared/new-name";
64
65
 
65
66
  /** Home without a search key (tests, older wiring): no subscription, no label. */
66
67
  const noSubscribe = () => () => undefined;
@@ -289,13 +290,13 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
289
290
  // Phones: the setup offer goes after the Needs-you group when there is one, so the first ask stays high.
290
291
  raised={<NobodyRows theme={theme} compact={compact} data={queue} onDismissed={deps.sources.extras.refreshQueue} />}
291
292
  afterNeeds={compact && model.needs > 0 && props.onboarding?.offer ? <SetupOffer theme={theme} compact view={props.onboarding} /> : undefined}
292
- emptyAction={compact ? <Button theme={theme} compact kind="secondary" icon="Settings" title="Project settings" onPress={deps.openSettings} /> : undefined}
293
+ emptyAction={<Button theme={theme} compact={compact} kind="primary" icon="Plus" title={NEW_NAME} onPress={() => openNew()} />}
293
294
  top={<ListTop theme={theme} dense={compact} title={compact ? undefined : <ListHeader theme={theme} compact={compact} onSettings={deps.openSettings} onKeys={() => setKeysOpen(v => !v)} onStats={openStats} onNew={() => openNew()} newLabel={newLabel} />}>
294
295
  {/* zIndex: on web every View is its own stacking context, so the sort menu only paints and hit-tests above the
295
296
  strip and meters below if this row sits above them. */}
296
297
  <View style={{ zIndex: 2, flexDirection: "row", alignItems: "center", gap: compact ? 2 : 6, paddingLeft: compact ? 16 : 16, paddingRight: compact ? 6 : 16 }}>
297
298
  <SearchField theme={theme} omnibox={omnibox} dense={compact} onEnter={item => void pick(item)} anywhereKey={anywhereKey} />
298
- {compact && <IconButton theme={theme} compact icon="Plus" label="New" onPress={() => openNew()} />}
299
+ {compact && <IconButton theme={theme} compact icon="Plus" label={NEW_NAME} onPress={() => openNew()} />}
299
300
  {!(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} />}
300
301
  {compact && openStats && <IconButton theme={theme} compact icon="ChartNoAxesColumn" label="PR stats" onPress={openStats} />}
301
302
  {compact && <IconButton theme={theme} compact icon="Settings" label="Follow-up settings" onPress={deps.openSettings} />}
@@ -389,7 +390,7 @@ function ListHeader({ theme, compact, onSettings, onKeys, onStats, onNew, newLab
389
390
  <VersionMark theme={theme} touch={compact} openSettings={onSettings} />
390
391
  </View>
391
392
  {/* New first, then the other header controls. */}
392
- {onNew && <Button theme={theme} compact={compact} kind="secondary" icon="Plus" title="New" keyHint={newLabel ?? undefined} accessibilityLabel={newLabel ? `New (${newLabel})` : "New"} onPress={onNew} />}
393
+ {onNew && <Button theme={theme} compact={compact} kind="secondary" icon="Plus" title={NEW_NAME} keyHint={newLabel ?? undefined} accessibilityLabel={newLabel ? `${NEW_NAME} (${newLabel})` : `${NEW_NAME}`} onPress={onNew} />}
393
394
  {/* The keys sheet's way in for the mouse (S from the keyboard); desktop web, where the keys are. */}
394
395
  {onKeys && Platform.OS === "web" && <IconButton theme={theme} compact={compact} icon="Keyboard" label="Keys (S)" tooltip onPress={onKeys} />}
395
396
  {/* Shown once a repository has PR statistics (docs/pr-stats.md#where-it-opens-from). */}
@@ -896,6 +897,8 @@ function BriefPane({ theme, compact, pane, onSelect, openLog, sources, catchUp,
896
897
  useTick(30_000);
897
898
  const now = Date.now();
898
899
  const offline = sources.inbox.offlineSince();
900
+ // works-without-github: the worker sets githubOff on every workspace with PRs while GitHub is off.
901
+ const githubOff = sources.live.all().find(w => w.githubOff)?.githubOff ?? null;
899
902
  const observed = sources.live.all().flatMap(w => w.prs.map(p => p.snapshot?.observedAt).filter((x): x is string => !!x)).sort().at(-1) ?? null;
900
903
  const date = new Date(now).toLocaleDateString([], { weekday: "long", day: "numeric", month: "long" });
901
904
  const time = new Date(now).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: false });
@@ -935,7 +938,9 @@ function BriefPane({ theme, compact, pane, onSelect, openLog, sources, catchUp,
935
938
  {section("Sources")}
936
939
  <View style={{ flexDirection: "row", flexWrap: "wrap", gap: 14 }}>
937
940
  <View style={{ flexDirection: "row", alignItems: "center", gap: 6 }}>{dot(offline === null)}<Text style={t.meta}>Paseo {offline === null ? "live" : `offline ${age(new Date(offline).toISOString(), now)}`}</Text></View>
938
- <View style={{ flexDirection: "row", alignItems: "center", gap: 6 }}>{dot(!!observed && now - Date.parse(observed) < 15 * 60_000)}<Text style={t.meta}>GitHub {observed ? age(observed, now) : "no PRs yet"}</Text></View>
941
+ {githubOff
942
+ ? <View style={{ flexDirection: "row", alignItems: "center", gap: 6 }}><View style={{ width: 8, height: 8, borderRadius: 4, backgroundColor: c.foregroundMuted }} /><Text style={t.meta}>{githubOff === "missing" ? "GitHub not connected" : "GitHub signed out"}</Text></View>
943
+ : <View style={{ flexDirection: "row", alignItems: "center", gap: 6 }}>{dot(!!observed && now - Date.parse(observed) < 15 * 60_000)}<Text style={t.meta}>GitHub {observed ? age(observed, now) : "no PRs yet"}</Text></View>}
939
944
  </View>
940
945
  </ScrollView>;
941
946
  }
@@ -44,8 +44,10 @@ export function useAgentSettings() {
44
44
  /** Settings' per-row More: what its toggle says (it names what's inside) and what it shows. */
45
45
  export type JobExtra = { label: (r: RoleView) => string | null; render: (r: RoleView, save: (entry: SavedRole | null) => void, busy: boolean) => ReactNode };
46
46
 
47
- export function JobRows({ theme, compact, order, extra, preselect = false }: {
47
+ export function JobRows({ theme, compact, order, extra, preselect = false, brief = false }: {
48
48
  theme: Theme; compact: boolean; order: readonly AgentRole[];
49
+ /** Setup only (Q161): one line per helper, its model and a Change link that opens the pickers. */
50
+ brief?: boolean;
49
51
  /** Settings only: controls behind each row's More (limits, schedule, permissions, Reset to defaults). */
50
52
  extra?: JobExtra;
51
53
  /** Setup only: fill in the recommendation for jobs with nothing saved whose default can't run here. */
@@ -104,9 +106,11 @@ export function JobRows({ theme, compact, order, extra, preselect = false }: {
104
106
  {roles.map((r, i) => {
105
107
  const field = SWITCH[r.role];
106
108
  const on = field && display.status === "ready" ? display.values[field] !== false : null;
107
- return <JobRow key={r.role} first={i === 0} row={rows[i]} r={r} catalog={catalog?.providers ?? []} loading={!catalog} theme={theme} compact={compact} busy={busy}
109
+ const Line = brief ? JobLine : JobRow;
110
+ return <Line key={r.role} first={i === 0} row={rows[i]} r={r} catalog={catalog?.providers ?? []} loading={!catalog} theme={theme} compact={compact} busy={busy}
108
111
  open={open === r.role} onToggle={() => setOpen(open === r.role ? null : r.role)}
109
- enabled={field ? on : undefined} onEnable={field && display.status === "ready" ? v => void display.save({ ...display.values, [field]: v }, display.revision).catch(e => toast.error(errorText(e))) : undefined}
112
+ // A job no available provider can run (needsGuard) shows off, and its notice says why; the setting is kept.
113
+ enabled={field ? (rows[i]!.blocked ? false : on) : undefined} onEnable={field && display.status === "ready" && !rows[i]!.blocked ? v => void display.save({ ...display.values, [field]: v }, display.revision).catch(e => toast.error(errorText(e))) : undefined}
110
114
  save={entry => change.mutate({ role: r.role, entry })} extra={extra} />;
111
115
  })}
112
116
  </View>;
@@ -125,12 +129,16 @@ export function JobRow({ row, r, catalog, loading, theme, compact, busy, open, o
125
129
  return <View style={{ borderTopWidth: first ? 0 : 1, borderTopColor: c.border, paddingHorizontal: pad, paddingVertical: 14, gap: 2 }}>
126
130
  <View style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
127
131
  <Text accessibilityRole="header" style={[t.label, { flex: 1 }]}>{row.title}</Text>
128
- {enabled !== undefined && <Switch theme={theme} compact={compact} label={enabled ? "On" : "Off"} accessibilityLabel={row.title} value={enabled} disabled={!onEnable} onChange={v => onEnable?.(v)} />}
132
+ {enabled !== undefined && <Switch theme={theme} compact={compact} label={row.blocked ? "Unavailable" : enabled ? "On" : "Off"} accessibilityLabel={row.title} hint={row.blocked ? row.notice?.text : undefined} value={enabled} disabled={!onEnable} onChange={v => onEnable?.(v)} />}
129
133
  </View>
130
134
  <Text style={[t.meta, off && { opacity: 0.6 }]}>{row.does}</Text>
131
- <View style={{ opacity: off ? 0.6 : 1, gap: 6, marginTop: 8 }}>
135
+ {/* An off row dims, but never its warning: the one line that says why must stay readable. */}
136
+ <View style={{ opacity: off && row.notice?.tone !== "warning" ? 0.6 : 1, gap: 6, marginTop: 8 }}>
132
137
  <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8 }}>
133
- {loading
138
+ {row.blocked && !loading
139
+ // Nothing here can run it: the state as plain text, not a picker that opens onto choices that can't run it.
140
+ ? <Text style={[t.body, { color: c.foregroundMuted, minHeight: compact ? 44 : 32, textAlignVertical: "center", paddingVertical: compact ? 12 : 6 }]}>{row.pick}</Text>
141
+ : loading
134
142
  ? <View style={{ flexDirection: "row", alignItems: "center", gap: 8, minHeight: compact ? 44 : 32 }}><Spinner color={c.foregroundMuted} size={14} /><Text style={t.meta}>Reading your providers…</Text></View>
135
143
  : <Pressable accessibilityRole="button" accessibilityLabel={`${row.title} model: ${row.pick}. Change`} accessibilityState={{ expanded: open, disabled: busy }} aria-expanded={open}
136
144
  disabled={busy && !open} onPress={onToggle}
@@ -140,7 +148,7 @@ export function JobRow({ row, r, catalog, loading, theme, compact, busy, open, o
140
148
  </Pressable>}
141
149
  {row.recommended && <Chip theme={theme} label="Recommended" color={c.foregroundMuted} />}
142
150
  </View>
143
- <Text style={[t.meta, { fontSize: 12, lineHeight: 16 }]}>{row.hint ? `${row.need} ${row.hint}` : row.need}</Text>
151
+ {!row.blocked && <Text style={[t.meta, { fontSize: 12, lineHeight: 16 }]}>{row.hint ? `${row.need} ${row.hint}` : row.need}</Text>}
144
152
  {row.notice && <View style={{ gap: 6, alignItems: "flex-start" }}>
145
153
  <Text accessibilityRole={row.notice.tone === "warning" ? "alert" : undefined} style={[t.meta, { fontSize: 12, lineHeight: 16, color: row.notice.tone === "warning" ? c.statusWarning : c.foregroundMuted }]}>{row.notice.text}</Text>
146
154
  {/* Can't run: a real button, the row's one way back. Only differs: the developer chose it, so a quiet link. */}
@@ -166,6 +174,47 @@ export function JobRow({ row, r, catalog, loading, theme, compact, busy, open, o
166
174
  </View>;
167
175
  }
168
176
 
177
+ /**
178
+ * Setup's row (Q161): the helper, the model it will use and Change, on one line on desktop (the switch at its end);
179
+ * a phone puts the model and Change under the name. Change opens the same pickers as Settings. Only a warning (it
180
+ * can't run) adds a line, with its one way back; what each helper does and needs stays in Settings → Agents.
181
+ */
182
+ export function JobLine({ row, r, catalog, loading, theme, compact, busy, open, onToggle, enabled, onEnable, save, first }: Parameters<typeof JobRow>[0]) {
183
+ const c = theme.colors; const t = text(c, compact);
184
+ const off = enabled === false;
185
+ const use = row.rec && !row.recommended ? () => save(recommendedEntry(r, row.rec!)) : null;
186
+ const warning = row.notice?.tone === "warning" ? row.notice : null;
187
+ const pick = loading ? "Reading your providers…" : row.blocked ? row.pick : `${row.pick}${row.recommended ? " · Recommended" : ""}`;
188
+ const toggle = enabled !== undefined && <Switch theme={theme} compact={compact} label={row.blocked ? "Unavailable" : enabled ? "On" : "Off"} accessibilityLabel={row.title} hint={row.blocked ? row.notice?.text : undefined} value={enabled} disabled={!onEnable} onChange={v => onEnable?.(v)} />;
189
+ const change = !loading && !row.blocked && <Pressable accessibilityRole="button" accessibilityLabel={`${row.title} model: ${row.pick}. Change`} accessibilityState={{ expanded: open, disabled: busy }} aria-expanded={open}
190
+ disabled={busy && !open} onPress={onToggle} hitSlop={compact ? 12 : 8} style={{ minHeight: compact ? 32 : 24, justifyContent: "center" }}>
191
+ <Text style={[t.label, { fontSize: 13, textDecorationLine: "underline" }]}>{open ? "Done" : "Change"}</Text>
192
+ </Pressable>;
193
+ const model = <View style={{ flexDirection: "row", alignItems: "center", gap: 12, flex: 1, minWidth: 0, opacity: off ? 0.6 : 1 }}>
194
+ {loading && <Spinner color={c.foregroundMuted} size={12} />}
195
+ {/* Wraps, never cut: "Recommended" is what this line is for (Q161), and a provider's name can be long. */}
196
+ <Text numberOfLines={2} style={[t.meta, { flex: 1 }]}>{pick}</Text>
197
+ {change}
198
+ </View>;
199
+ return <View style={{ borderTopWidth: first ? 0 : 1, borderTopColor: c.border, paddingHorizontal: compact ? 14 : 16, paddingVertical: compact ? 6 : 12, gap: compact ? 0 : 6 }}>
200
+ {compact
201
+ ? <><View style={{ flexDirection: "row", alignItems: "center", gap: 10, minHeight: 40 }}><Text accessibilityRole="header" style={[t.label, { flex: 1 }]}>{row.title}</Text>{toggle}</View>{model}</>
202
+ : <View style={{ flexDirection: "row", alignItems: "center", gap: 12, minHeight: 32 }}>
203
+ <Text accessibilityRole="header" style={[t.label, { width: 104 }]}>{row.title}</Text>
204
+ {model}
205
+ {/* A fixed switch column, so every row's Change lines up whether or not it has a switch. */}
206
+ <View style={{ minWidth: 84, alignItems: "flex-end" }}>{toggle}</View>
207
+ </View>}
208
+ {warning && <View style={{ gap: 6, alignItems: "flex-start", paddingLeft: compact ? 0 : 116, paddingBottom: compact ? 8 : 0 }}>
209
+ <Text accessibilityRole="alert" style={[t.meta, { fontSize: 12, lineHeight: 16, color: c.statusWarning }]}>{warning.text}</Text>
210
+ {use && <Button theme={theme} compact={compact} kind="secondary" title="Use recommended" accessibilityLabel={`Use ${row.recPick} for ${row.title}`} disabled={busy} onPress={use} />}
211
+ </View>}
212
+ {open && !loading && <View style={{ marginTop: 4, marginLeft: compact ? 0 : 116, borderWidth: 1, borderColor: c.border, borderRadius: 10, overflow: "hidden" }}>
213
+ <RolePickers r={r} catalog={catalog} busy={busy} save={save} />
214
+ </View>}
215
+ </View>;
216
+ }
217
+
169
218
  /** Provider, Model and Effort: the same pickers in setup and Settings. */
170
219
  export function RolePickers({ r, catalog, busy, save }: { r: RoleView; catalog: CatalogProvider[]; busy: boolean; save: (entry: SavedRole | null) => void }) {
171
220
  const role = r.role;
@@ -16,7 +16,8 @@ type Doc = { body: unknown; activeElement: unknown; visibilityState?: string; qu
16
16
  * non-modal dialog (Home's keys sheet, which S opens and closes) leaves the page its keys; keys typed inside one stay
17
17
  * its own (the focus check below).
18
18
  */
19
- const OVERLAYS = '[role="menu"],[role="alertdialog"],[aria-modal="true"]';
19
+ /** Menus and modal dialogs drawn over a surface (list keys pause under them; so does a held search request). */
20
+ export const OVERLAYS = '[role="menu"],[role="alertdialog"],[aria-modal="true"]';
20
21
 
21
22
  export type ListKeysOptions = {
22
23
  enabled: boolean;
@@ -127,7 +127,8 @@ function ConnectionsSection({ sources, theme, compact }: { sources: SourcesState
127
127
  const notRead = data.sources.filter(r => r.kind === "skipped");
128
128
  const checking = !!data.checking || !!(change.isPending && change.variables?.check);
129
129
  return <SettingsSection title="Connections" info="What mcpproxy and GitHub let Follow-up read. Each source is found by the tools mcpproxy offers, never by its name, and only its read-only tools are ever called.">
130
- {data.error || data.line.tone === "warn" ? <Warning text={data.error ?? data.line.text} theme={theme} compact={compact} /> : <Text style={t.meta}>{data.line.text}</Text>}
130
+ {/* Each input's own failure is on its row above; Connections says only what no row can: mcpproxy itself failing. */}
131
+ {data.error ? <Warning text={data.error} theme={theme} compact={compact} /> : <Text style={t.meta}>{connectionsLine(data.sources)}</Text>}
131
132
  {notRead.length > 0 && <View style={{ gap: 6 }}>
132
133
  <Pressable accessibilityRole="button" aria-expanded={showNotRead} accessibilityState={{ expanded: showNotRead }} onPress={() => setShowNotRead(v => !v)}
133
134
  style={{ flexDirection: "row", alignItems: "center", gap: 4, alignSelf: "flex-start", minHeight: compact ? 44 : 24 }}>
@@ -146,6 +147,15 @@ function ConnectionsSection({ sources, theme, compact }: { sources: SourcesState
146
147
  </SettingsSection>;
147
148
  }
148
149
 
150
+ /** "6 inputs read", or "6 inputs read · 2 need attention above": the count, never each row's failure again. */
151
+ function connectionsLine(rows: readonly BriefSource[]): string {
152
+ const used = rows.filter(r => r.on && r.kind !== "skipped");
153
+ // Names, not the failures: each row above already says what's wrong and how to fix it.
154
+ const bad = used.filter(r => r.health === "failed" || r.health === "sign-in").map(r => inputLabel(r));
155
+ const names = bad.length > 2 ? `${bad.slice(0, 2).join(", ")} and ${bad.length - 2} more` : bad.join(" and ");
156
+ return `${used.length} input${used.length === 1 ? "" : "s"} read${bad.length ? ` · ${names} need${bad.length === 1 ? "s" : ""} attention above` : ""}`;
157
+ }
158
+
149
159
  const MONO = { fontFamily: "ui-monospace, Menlo, monospace", fontSize: 11 } as const;
150
160
  /** 24-hour time, like the sweep's "07:00". */
151
161
  const clock = (iso: string) => new Date(iso).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hourCycle: "h23" });
@@ -1,10 +1,18 @@
1
1
  import { useSyncExternalStore } from "react";
2
+ import { useSettings } from "@getpaseo/plugin/client";
3
+ import { useToast } from "@getpaseo/plugin/client/ui";
4
+ import { displayPreferences } from "../shared/display";
5
+ import { isDesktopApp, isMac, newShortcutPreset, shortcutLabel } from "../shared/search-key";
6
+ import { errorText } from "./kit";
2
7
  import { Platform } from "react-native";
3
8
  import { Text } from "./text";
4
- import type { PluginSidebarItemProps } from "@getpaseo/plugin/client";
9
+ import type { PluginClientContext, PluginSidebarItemProps } from "@getpaseo/plugin/client";
5
10
  import { SidebarRow } from "@getpaseo/plugin/client/ui";
6
11
  import { useNewOpen } from "./new";
7
12
  import type { NewKey } from "./search-key";
13
+ import { subscribeDisplay } from "./display";
14
+ import { sidebarVisibility } from "./sidebar-visibility";
15
+ import { NEW_NAME } from "../shared/new-name";
8
16
 
9
17
  /**
10
18
  * The sidebar's New row (`addSidebarHeaderItem`, id "new"): a + and "New", with New's key on the right on desktop web.
@@ -15,7 +23,39 @@ export function NewSidebarRow(key: NewKey, enter: (openScreen: PluginSidebarItem
15
23
  return function FollowNewRow({ openScreen, theme }: PluginSidebarItemProps) {
16
24
  const label = useSyncExternalStore(key.subscribe, key.label, key.label);
17
25
  const open = useNewOpen();
18
- return <SidebarRow icon="Plus" label="New" active={open} onPress={() => enter(openScreen)}
26
+ return <SidebarRow icon="Plus" label={NEW_NAME} active={open} onPress={() => enter(openScreen)}
19
27
  trailing={label && Platform.OS === "web" ? <Text accessibilityElementsHidden importantForAccessibility="no" style={{ color: theme.colors.foregroundMuted, fontSize: 11 }}>{label}</Text> : undefined} />;
20
28
  };
21
29
  }
30
+
31
+ /**
32
+ * The row is optional (new-row-is-optional): it follows the Display switch `enable_new_sidebar_row`, registered while
33
+ * on and removed while off, on every device the developer uses and live when an agent's set_display changes it. It
34
+ * registers at once (the default, so most hosts never flash) and the first Display read removes it when off. Off
35
+ * touches nothing else: Home's + New, ⌘K and New's key keep opening New.
36
+ */
37
+ export function contributeNewRow(client: Pick<PluginClientContext, "addSidebarHeaderItem">, key: NewKey, enter: (openScreen: PluginSidebarItemProps["openScreen"]) => void) {
38
+ const row = sidebarVisibility(() => client.addSidebarHeaderItem({ id: "new", title: NEW_NAME, Component: NewSidebarRow(key, enter) }));
39
+ row.set(true);
40
+ const off = subscribeDisplay(values => row.set(values.enable_new_sidebar_row !== false));
41
+ return () => { off(); row.dispose(); };
42
+ }
43
+
44
+ /**
45
+ * The row's switch, one copy for Settings → New work and setup's tour (`NEW_ROW`): its value (null until read), the
46
+ * hint naming New's key on web, and the write, which goes through the Display document like set_display.
47
+ */
48
+ export function useNewRowSetting() {
49
+ const display = useSettings(displayPreferences); const toast = useToast();
50
+ const ready = display.status === "ready";
51
+ const key = ready && Platform.OS === "web" ? shortcutLabel(newShortcutPreset(display.values.new_shortcut, isDesktopApp()), isMac()) : null;
52
+ return {
53
+ value: ready ? display.values.enable_new_sidebar_row : null,
54
+ saving: ready ? display.saving : false,
55
+ key,
56
+ set: (enable_new_sidebar_row: boolean) => {
57
+ if (display.status !== "ready") return;
58
+ void display.save({ ...display.values, enable_new_sidebar_row }, display.revision).catch(e => toast.error(errorText(e)));
59
+ },
60
+ };
61
+ }
@@ -1,7 +1,9 @@
1
1
  import { useState } from "react";
2
+ import { NEW_ROW } from "../shared/new-name";
3
+ import { useNewRowSetting } from "./new-entry";
2
4
  import { ActivityIndicator, View } from "react-native";
3
5
  import { useRpc } from "@getpaseo/plugin/client";
4
- import { Icon, SettingsAction, SettingsCard, SettingsRow, SettingsSection, SettingsSelect, TextInput, useToast } from "@getpaseo/plugin/client/ui";
6
+ import { Icon, SettingsAction, SettingsCard, SettingsRow, SettingsSection, SettingsSelect, SettingsSwitch, TextInput, useToast } from "@getpaseo/plugin/client/ui";
5
7
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
6
8
  import { Text } from "./text";
7
9
  import { Button, IconButton, SubmitScope, Switch, errorText, text, type Theme } from "./kit";
@@ -12,6 +14,7 @@ import { dispatchActionsRpc, dispatchSettingsRpc, setDispatchActionsRpc, setDisp
12
14
  import type { z } from "zod";
13
15
  import type { DispatchAction, actionChangeSchema, settingsChangeSchema } from "../shared/dispatch";
14
16
  import { actionRows, learnedTeams, teamKey, type ActionRowModel, type SettingsView } from "../shared/new-settings";
17
+ import { NEW_NAME, NEW_OF, NEW_WORK } from "../shared/new-name";
15
18
 
16
19
  export const newActionsKey = ["follow-up", "dispatch-actions"];
17
20
  export const newSettingsKey = ["follow-up", "dispatch-settings"];
@@ -32,13 +35,26 @@ export function NewWorkCategory({ theme, compact, openAgents }: { theme: Theme;
32
35
  <ActionsSection theme={theme} compact={compact} />
33
36
  <WhereSection theme={theme} compact={compact} />
34
37
  <BasesSection theme={theme} compact={compact} />
38
+ <SidebarSection theme={theme} compact={compact} />
35
39
  <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", columnGap: 8, rowGap: 4, paddingHorizontal: 4 }}>
36
- <Text style={t.meta}>New's agent is set in Agents → New work.</Text>
40
+ <Text style={t.meta}>{`${NEW_OF} agent is set in Agents → ${NEW_WORK}.`}</Text>
37
41
  {openAgents && <Button theme={theme} compact={compact} kind="ghost" icon="ArrowRight" title="Open Agents" accessibilityLabel="Open Settings, Agents" onPress={openAgents} />}
38
42
  </View>
39
43
  </>;
40
44
  }
41
45
 
46
+ /** The sidebar's New row, on or off (new-row-is-optional), and, while on, the tip about Paseo's own New workspace. */
47
+ function SidebarSection({ theme, compact }: { theme: Theme; compact: boolean }) {
48
+ const t = text(theme.colors, compact);
49
+ const row = useNewRowSetting();
50
+ return <SettingsSection title="Sidebar">
51
+ <SettingsCard>
52
+ <SettingsSwitch label={NEW_ROW.label} hint={NEW_ROW.hint(row.key, isMac() ? "⌘K" : "Ctrl K")} value={row.value ?? true} disabled={row.value === null || row.saving} onValueChange={row.set} />
53
+ </SettingsCard>
54
+ {row.value !== false && <Text style={[t.meta, { paddingHorizontal: 4 }]}>{NEW_ROW.paseo}</Text>}
55
+ </SettingsSection>;
56
+ }
57
+
42
58
  function useActions() {
43
59
  const read = useRpc(dispatchActionsRpc);
44
60
  return useQuery({ queryKey: newActionsKey, queryFn: async () => await read({}) as ActionsView, staleTime: 30_000 });
@@ -57,19 +73,19 @@ function ActionsSection({ theme, compact }: { theme: Theme; compact: boolean })
57
73
  onSuccess: (value, change) => cache.setQueryData<ActionsView>(newActionsKey, { actions: value.actions as DispatchAction[], edited: change.op !== "reset-all" }),
58
74
  onError: error => toast.error(errorText(error)),
59
75
  });
60
- const info = "What New offers for an issue, a link or your words, in this order: the first one shown is ↵, the second ⌥↵, the rest are under More. A hidden action stays here. Agents can add their own; an action is a template, never code.";
76
+ const info = `What ${NEW_NAME} offers for an issue, a link or your words, in this order: the first one shown is ↵, the second ⌥↵, the rest are under More. A hidden action stays here. Agents can add their own; an action is a template, never code.`;
61
77
  const rows = query.data ? actionRows(query.data.actions) : [];
62
78
  const [confirm, setConfirm] = useState<string | null>(null);
63
79
  const added = query.data?.actions.filter(a => !a.builtin).length ?? 0;
64
80
  return <SettingsSection title="Actions" info={info}>
65
- {query.isPending && <ActivityIndicator accessibilityLabel="Loading New's actions" color={c.foregroundMuted} style={{ alignSelf: "flex-start", marginVertical: 8 }} />}
66
- {query.error && <SettingsCard><SettingsAction label="Couldn't load New's actions" hint={errorText(query.error)} actionLabel="Retry" onPress={() => void query.refetch()} /></SettingsCard>}
81
+ {query.isPending && <ActivityIndicator accessibilityLabel={`Loading ${NEW_OF} actions`} color={c.foregroundMuted} style={{ alignSelf: "flex-start", marginVertical: 8 }} />}
82
+ {query.error && <SettingsCard><SettingsAction label={`Couldn't load ${NEW_OF} actions`} hint={errorText(query.error)} actionLabel="Retry" onPress={() => void query.refetch()} /></SettingsCard>}
67
83
  {query.data && <View style={{ ...raised(c), borderRadius: 10, backgroundColor: c.surface1, overflow: "hidden" }}>
68
84
  {rows.map((row, i) => <ActionRowView key={row.id} row={row} first={i === 0} theme={theme} compact={compact} busy={change.isPending}
69
85
  confirming={confirm === row.id} onConfirm={v => setConfirm(v ? row.id : null)}
70
86
  onChange={op => { setConfirm(null); change.mutate(op); }} index={i} />)}
71
87
  </View>}
72
- {query.data && <Text style={[t.meta, { paddingHorizontal: 4 }]}>In New, the first two shown get ↵ and ⌥↵; the rest are under More.</Text>}
88
+ {query.data && <Text style={[t.meta, { paddingHorizontal: 4 }]}>{`In ${NEW_NAME}, the first two shown get ↵ and ⌥↵; the rest are under More.`}</Text>}
73
89
  {/* Reset all removes added actions, so it asks in place first, like Delete. */}
74
90
  {query.data?.edited && <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8 }}>
75
91
  {confirm === RESET_ALL
@@ -89,7 +105,7 @@ function ActionRowView({ row, first, index, theme, compact, busy, confirming, on
89
105
  }) {
90
106
  const c = theme.colors; const t = text(c, compact);
91
107
  const tags = [row.key, row.scope, row.origin, row.hidden ? "Hidden" : null].filter((x): x is string => !!x);
92
- const spoken = (tag: string) => tag === "↵" ? "Enter in New" : tag === "⌥↵" ? `${isMac() ? "Option" : "Alt"} Enter in New` : tag;
108
+ const spoken = (tag: string) => tag === "↵" ? `Enter in ${NEW_NAME}` : tag === "⌥↵" ? `${isMac() ? "Option" : "Alt"} Enter in ${NEW_NAME}` : tag;
93
109
  const fg = row.hidden ? c.foregroundMuted : c.foreground;
94
110
  return <View style={{ borderTopWidth: first ? 0 : 1, borderTopColor: c.border, paddingHorizontal: compact ? 12 : 16, paddingVertical: compact ? 10 : 12, gap: 8 }}>
95
111
  <View style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
@@ -105,7 +121,7 @@ function ActionRowView({ row, first, index, theme, compact, busy, confirming, on
105
121
  </View>
106
122
  <IconButton theme={theme} compact={compact} icon="ArrowUp" label={`Move ${row.name} up`} disabled={busy || row.first} onPress={() => onChange({ op: "move", id: row.id, to: index - 1 })} />
107
123
  <IconButton theme={theme} compact={compact} icon="ArrowDown" label={`Move ${row.name} down`} disabled={busy || row.last} onPress={() => onChange({ op: "move", id: row.id, to: index + 1 })} />
108
- <Switch theme={theme} compact={compact} label="" accessibilityLabel={`Show ${row.name} in New`} value={!row.hidden} disabled={busy} onChange={on => onChange({ op: "hide", id: row.id, hidden: !on })} />
124
+ <Switch theme={theme} compact={compact} label="" accessibilityLabel={`Show ${row.name} in ${NEW_NAME}`} value={!row.hidden} disabled={busy} onChange={on => onChange({ op: "hide", id: row.id, hidden: !on })} />
109
125
  </View>
110
126
  {(row.canReset || row.canDelete) && <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8, paddingLeft: 16 }}>
111
127
  {row.canReset && <Button theme={theme} compact={compact} kind="ghost" icon="RotateCcw" title="Reset to built-in" disabled={busy} onPress={() => onChange({ op: "reset", id: row.id })} />}
@@ -135,14 +151,14 @@ function WhereSection({ theme, compact }: { theme: Theme; compact: boolean }) {
135
151
  const [team, setTeam] = useState(""); const [project, setProject] = useState(PICK);
136
152
  const [removing, setRemoving] = useState<string | null>(null);
137
153
  const view = query.data;
138
- const info = "Which project New starts an issue's work in. A link to a repository and an issue that already has a workspace go there; otherwise the team's rule, then where the team's past work went, then the rule below. When New isn't sure it asks, and your pick is saved as the team's rule.";
154
+ const info = `Which project ${NEW_NAME} starts an issue's work in. A link to a repository and an issue that already has a workspace go there; otherwise the team's rule, then where the team's past work went, then the rule below. When ${NEW_NAME} isn't sure it asks, and your pick is saved as the team's rule.`;
139
155
  const projectOptions = (view?.projects ?? []).map(p => ({ value: p.id, label: p.name }));
140
156
  const key = teamKey(team);
141
157
  // The fields clear only once the rule is saved: a failed save keeps what was typed.
142
158
  const add = () => change.mutate({ rules: { [key]: project } }, { onSuccess: () => { setTeam(""); setProject(PICK); } });
143
159
  return <SettingsSection title="Where work goes" info={info}>
144
- {query.isPending && <ActivityIndicator accessibilityLabel="Loading where New starts work" color={c.foregroundMuted} style={{ alignSelf: "flex-start", marginVertical: 8 }} />}
145
- {query.error && <SettingsCard><SettingsAction label="Couldn't load New's rules" hint={errorText(query.error)} actionLabel="Retry" onPress={() => void query.refetch()} /></SettingsCard>}
160
+ {query.isPending && <ActivityIndicator accessibilityLabel={`Loading where ${NEW_NAME} starts work`} color={c.foregroundMuted} style={{ alignSelf: "flex-start", marginVertical: 8 }} />}
161
+ {query.error && <SettingsCard><SettingsAction label={`Couldn't load ${NEW_OF} rules`} hint={errorText(query.error)} actionLabel="Retry" onPress={() => void query.refetch()} /></SettingsCard>}
146
162
  {view && <>
147
163
  <SettingsCard>
148
164
  <SettingsSelect label="Everything else" hint="Issues from a team without a rule or a clear history, links and your words." value={view.noTeam} disabled={change.isPending}
@@ -164,7 +180,7 @@ function WhereSection({ theme, compact }: { theme: Theme; compact: boolean }) {
164
180
  : <Button theme={theme} compact={compact} kind="ghost" title="Remove" accessibilityLabel={`Remove ${rule.team}'s rule`} disabled={change.isPending} onPress={() => setRemoving(rule.team)} />}
165
181
  </View>
166
182
  </View>)}
167
- {!view.rules.length && <View style={{ paddingHorizontal: 16, paddingVertical: 12 }}><Text style={t.meta}>No team rules yet. New learns from where each team's work went; add a rule to fix one.</Text></View>}
183
+ {!view.rules.length && <View style={{ paddingHorizontal: 16, paddingVertical: 12 }}><Text style={t.meta}>No team rules yet. {NEW_NAME} learns from where each team's work went; add a rule to fix one.</Text></View>}
168
184
  {/* Three native rows, never one row of nested fields: a select squeezed beside an input cuts "Pick a project". */}
169
185
  <SettingsRow label="Add a rule" hint="A Linear team's key, like ACME.">
170
186
  <TeamInput theme={theme} compact={compact} value={team} onChange={setTeam} />
@@ -199,7 +215,7 @@ function BasesSection({ theme, compact }: { theme: Theme; compact: boolean }) {
199
215
  <SettingsCard>
200
216
  {worktrees.map(p => <BaseRow key={p.id} theme={theme} compact={compact} name={p.name} saved={view.bases.find(b => b.projectId === p.id)?.base ?? ""} busy={change.isPending}
201
217
  onSave={(base, done) => change.mutate({ bases: { [p.id]: base || null } }, { onSuccess: done })} />)}
202
- {!worktrees.length && <View style={{ paddingHorizontal: 16, paddingVertical: 12 }}><Text style={t.meta}>No project here is a git repository, so New opens work in place.</Text></View>}
218
+ {!worktrees.length && <View style={{ paddingHorizontal: 16, paddingVertical: 12 }}><Text style={t.meta}>{`No project here is a git repository, so ${NEW_NAME} opens work in place.`}</Text></View>}
203
219
  </SettingsCard>
204
220
  </SettingsSection>;
205
221
  }