paseo-follow-up 2.1.0-beta.3 → 2.1.0-beta.4

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.
package/assets/icon.png CHANGED
Binary file
package/assets/icon.svg CHANGED
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256"><title>Follow-up</title><rect width="256" height="256" rx="52" fill="#1c2229"/><svg x="52" y="52" xmlns="http://www.w3.org/2000/svg" width="152" height="152" viewBox="0 0 24 24" fill="none" stroke="#f3f0e8" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-list-checks" aria-hidden="true"><path d="M13 5h8"></path><path d="M13 12h8"></path><path d="M13 19h8"></path><path d="m3 17 2 2 4-4"></path><path d="m3 7 2 2 4-4"></path></svg></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256"><title>Follow-up</title><rect width="256" height="256" rx="52" fill="#1c2229"/><g transform="translate(48 48) scale(6.6667)"><path d="M7.2 19C11 19 15.6 17.8 15.6 13.6C15.6 10.9 13.6 9.6 11.9 9.6C10.2 9.6 8.6 10.9 8.6 12.9C8.6 15.3 11 16.2 13 15.1C15.2 13.9 15.9 10.5 16.6 7.8" fill="none" stroke="#f3f0e8" stroke-width="1.7" stroke-linecap="round"/><circle cx="4.6" cy="19" r="2.3" fill="#1c2229" stroke="#f3f0e8" stroke-width="1.6"/><circle cx="17.4" cy="4.9" r="2.9" fill="#a890d5"/></g></svg>
@@ -3,9 +3,10 @@ import { useRpc, useSettings } from "@getpaseo/plugin/client";
3
3
  import { useQuery } from "@tanstack/react-query";
4
4
  import { displayFeed, inboxListRpc, trustBypassRpc } from "../shared/contracts";
5
5
  import { openFeed } from "./feeds";
6
- import { SettingsAction, SettingsCard, SettingsSection, SettingsSwitch } from "@getpaseo/plugin/client/ui";
6
+ import { SettingsAction, SettingsCard, SettingsSection, SettingsSelect, SettingsSwitch } from "@getpaseo/plugin/client/ui";
7
+ import { isMac, searchShortcutOf, searchShortcutOptions, type SearchShortcut } from "../shared/search-key";
7
8
  import { useEffect } from "react";
8
- import { ActivityIndicator, View } from "react-native";
9
+ import { ActivityIndicator, Platform, View } from "react-native";
9
10
  import { Text } from "./text";
10
11
  import { displayPreferences, displayRpc, trustCountText } from "../shared/display";
11
12
  import { sidebarVisibility } from "./sidebar-visibility";
@@ -97,6 +98,13 @@ export function DisplaySections({ theme }: Pick<PluginSurfaceProps, "theme">) {
97
98
  </SettingsCard>
98
99
  {settings.saveError && <Text accessibilityRole="alert" style={{ color: theme.colors.statusDanger }}>{settings.saveError}</Text>}
99
100
  </SettingsSection>
101
+ {Platform.OS === "web" && <SettingsSection title="Keyboard" info="Follow-up's key never takes one Paseo uses, and inside a code editor the editor keeps it. Pick None to keep it free.">
102
+ <SettingsCard>
103
+ <SettingsSelect label="Search from anywhere" hint="Jumps to Home's search from any screen, even mid-message. On Home, / works too."
104
+ value={searchShortcutOf(settings.values.search_shortcut)} options={searchShortcutOptions(isMac())} disabled={settings.saving}
105
+ onValueChange={(search_shortcut: SearchShortcut) => save({ search_shortcut })} />
106
+ </SettingsCard>
107
+ </SettingsSection>}
100
108
  <SettingsSection title="Needs-you inbox" trailing={<BetaChip theme={theme} />} info="Agents stay in Needs you until you sign them off or write to them. Opening an agent doesn't clear it.">
101
109
  <SettingsCard>
102
110
  <SettingsSwitch label="Needs-you inbox" hint="Off: no agent is flagged. The pill still shows workspace items, and the sidebar badge counts workspaces instead." value={settings.values.enable_inbox} disabled={settings.saving} onValueChange={(enable_inbox) => save({ enable_inbox })} />
@@ -0,0 +1,28 @@
1
+ import type { PluginSvgIcon } from "@getpaseo/plugin/client";
2
+
3
+ /**
4
+ * Follow-up's own mark: a loop that runs on from a start ring to a filled dot (the work, followed until it's done).
5
+ * One 24-unit glyph in `currentColor`, so the host `Icon` colours it with the theme. It is the brand icon on every
6
+ * surface that stands for Follow-up itself (sidebar row, header button, panel tab, Settings, the open command, the
7
+ * large view's empty state). Pull requests keep lucide GitPullRequest. assets/icon.svg is the same mark on the app tile.
8
+ * tests/follow-up-icon.test.ts checks it with the SDK's validator and that no brand surface falls back to GitPullRequest.
9
+ */
10
+ export const FOLLOW_UP_ICON: PluginSvgIcon = {
11
+ svg: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.2 19C11 19 15.6 17.8 15.6 13.6C15.6 10.9 13.6 9.6 11.9 9.6C10.2 9.6 8.6 10.9 8.6 12.9C8.6 15.3 11 16.2 13 15.1C15.2 13.9 15.9 10.5 16.6 7.8" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/><circle cx="4.6" cy="19" r="2.3" fill="none" stroke="currentColor" stroke-width="1.6"/><circle cx="17.4" cy="4.9" r="2.9" fill="currentColor"/></svg>`,
12
+ };
13
+
14
+ /** Where the end dot sits, as a fraction of the icon box: the header button's Needs-you badge covers it. */
15
+ export const FOLLOW_UP_DOT = { x: 17.4 / 24, y: 4.9 / 24 };
16
+
17
+ /** The header button's Needs-you dot, in px. */
18
+ export const NEED_DOT = 7;
19
+
20
+ /**
21
+ * Where the Needs-you dot goes in a `size` icon box: centred on the end dot, clamped inside the box. Paseo draws a
22
+ * header button's icon in a box of exactly that size with `overflow: hidden` (`ButtonIcon`, 16 px on 0.15 and 0.16),
23
+ * so any part outside it is cut off: centred at 16 px the dot's top sat 0.23 px above the box and drew flat-topped.
24
+ */
25
+ export function needDotBox(size: number): { left: number; top: number } {
26
+ const clamp = (v: number) => Math.min(Math.max(v, 0), Math.max(size - NEED_DOT, 0));
27
+ return { left: clamp(size * FOLLOW_UP_DOT.x - NEED_DOT / 2), top: clamp(size * FOLLOW_UP_DOT.y - NEED_DOT / 2) };
28
+ }
@@ -64,9 +64,9 @@ export function useOmnibox(model: HomeModel, sources: HomeSources, extraProvider
64
64
  const current = active ?? fallback;
65
65
  const move = useCallback((delta: number) => setActive(a => Math.max(0, Math.min((results?.length ?? 1) - 1, (a ?? fallback) + delta))), [results, fallback]);
66
66
  // ⌘K "Follow-up: Search".
67
+ // A request made before this field mounted (the search key opening Home) is taken on mount.
67
68
  const token = useSyncExternalStore(sources.extras.subscribe, sources.extras.focusToken, sources.extras.focusToken);
68
- const first = useRef(token);
69
- useEffect(() => { if (token !== first.current) inputRef.current?.focus(); }, [token]);
69
+ useEffect(() => { if (sources.extras.takeFocus()) inputRef.current?.focus(); }, [token, sources.extras]);
70
70
  return { query, setQuery, results, active: Math.min(current, Math.max(0, (results?.length ?? 1) - 1)), move, inputRef, askOn };
71
71
  }
72
72
 
@@ -92,7 +92,7 @@ export function useSlashToFocus(omnibox: Omnibox, enabled = true) {
92
92
  * The one query field: Home's omnibox (SearchField) and the sidebar view's filter (FilterField) are this with
93
93
  * different words. `dense` is the phone layout: a 44px field with a rounder shape and body-size text.
94
94
  */
95
- export function QueryField({ theme, value, onChange, placeholder, icon, dense, inputRef, slashHint, onSubmit, onArrow, listKeys = false, count, autoFocus = false, onEscape }: {
95
+ export function QueryField({ theme, value, onChange, placeholder, icon, dense, inputRef, slashHint, slashTitle, onSubmit, onArrow, listKeys = false, count, autoFocus = false, onEscape }: {
96
96
  /** Its arrows step into the list below (client/list-keys.ts): the sidebar filter, and Home's search while empty. */
97
97
  listKeys?: boolean;
98
98
  /** "2 of 12" at the field's end (a panel section's search), in place of the field's own ✕: the section has its own. */
@@ -101,7 +101,10 @@ export function QueryField({ theme, value, onChange, placeholder, icon, dense, i
101
101
  /** Esc's own action (a section search closes); without it Esc clears, then leaves the field. */
102
102
  onEscape?: () => void;
103
103
  theme: Theme; value: string; onChange: (q: string) => void; placeholder: string; icon: string; dense: boolean;
104
- inputRef: { current: TextInput | null }; slashHint: boolean; onSubmit?: () => void; onArrow?: (delta: number) => void;
104
+ /** The key chip at the field's end (web, desktop width): "/" or the search-from-anywhere key; false for none. */
105
+ /** The chip's hover title (web): what each key does. */
106
+ slashTitle?: string;
107
+ inputRef: { current: TextInput | null }; slashHint: string | false; onSubmit?: () => void; onArrow?: (delta: number) => void;
105
108
  }) {
106
109
  const c = theme.colors;
107
110
  const [focused, setFocused] = useState(false);
@@ -124,14 +127,19 @@ export function QueryField({ theme, value, onChange, placeholder, icon, dense, i
124
127
  : !!value && <Pressable accessibilityRole="button" accessibilityLabel={`Clear ${placeholder.toLowerCase()}`} hitSlop={dense ? 14 : 8} onPress={() => { onChange(""); inputRef.current?.focus(); }}>
125
128
  <Icon name="X" size={dense ? 16 : 13} color={c.foregroundMuted} />
126
129
  </Pressable>}
127
- {slashHint && !value && !focused && !dense && Platform.OS === "web" && <Text style={{ color: c.foregroundMuted, fontSize: 11, paddingHorizontal: 4, borderRadius: 3, borderWidth: 1, borderColor: c.border }}>/</Text>}
130
+ {slashHint && !value && !focused && !dense && Platform.OS === "web" && <Text accessibilityElementsHidden importantForAccessibility="no" {...(slashTitle ? { title: slashTitle } as object : null)} style={{ color: c.foregroundMuted, fontSize: 11, paddingHorizontal: 4, borderRadius: 3, borderWidth: 1, borderColor: c.border, fontVariant: ["tabular-nums"] }}>{slashHint}</Text>}
128
131
  </View>;
129
132
  }
130
133
 
131
- export function SearchField({ theme, omnibox, dense, onEnter }: { theme: Theme; omnibox: Omnibox; dense: boolean; onEnter: (item: OmniboxItem) => void }) {
134
+ /**
135
+ * Home's search. Its chip names the search-from-anywhere key when one is set (it works here too), else "/"; plain "/"
136
+ * focuses it on Home either way (useSlashToFocus).
137
+ */
138
+ export function SearchField({ theme, omnibox, dense, onEnter, anywhereKey }: { theme: Theme; omnibox: Omnibox; dense: boolean; onEnter: (item: OmniboxItem) => void; anywhereKey?: string | null }) {
132
139
  const { query, setQuery, results, active, move, inputRef, askOn } = omnibox;
133
140
  const placeholder = askOn ? dense ? "Search or ask the Overseer" : "Search, or ask the Overseer" : "Search workspaces, branches, PRs";
134
- return <QueryField theme={theme} value={query} onChange={setQuery} placeholder={placeholder} icon="Search" dense={dense} inputRef={inputRef} slashHint
141
+ return <QueryField theme={theme} value={query} onChange={setQuery} placeholder={placeholder} icon="Search" dense={dense} inputRef={inputRef} slashHint={anywhereKey || "/"}
142
+ slashTitle={anywhereKey ? `${anywhereKey} from anywhere · / on Home` : "/ focuses the search"}
135
143
  onSubmit={() => { const item = results?.[active]; if (item) onEnter(item); }} onArrow={move} listKeys={!query.trim()} />;
136
144
  }
137
145
 
@@ -2,7 +2,7 @@ import { memo, useCallback, useEffect, useMemo, useRef, useState, type ReactNode
2
2
  import { View, type FlatList as NativeFlatList } from "react-native";
3
3
  import { Pressable, Text } from "./text";
4
4
  import { Icon, FlatList } from "@getpaseo/plugin/client/ui";
5
- import { type Badge, type HomeGroupId, type HomeModel, type Workstream } from "../shared/home";
5
+ import { type Badge, type HomeGroupId, type HomeModel, type Workstream, railChips } from "../shared/home";
6
6
  import { ASK_KEY, excerpt, FIELD_LABEL, type OmniboxItem, type Range, type RowHit, type SearchHit } from "../shared/search";
7
7
  import { AskRow, PriorityLine } from "./home-chrome";
8
8
  import { age, wakeLabel, wakeShort } from "../shared/inbox";
@@ -250,7 +250,7 @@ const badgeColor = (b: Badge, c: Colors) => b.tone === "danger" ? c.statusDanger
250
250
 
251
251
  export function BadgeView({ b, c }: { b: Badge; c: Colors }) {
252
252
  const col = badgeColor(b, c);
253
- return <View style={{ paddingHorizontal: 6, height: 20, justifyContent: "center", borderRadius: 4, backgroundColor: b.tone === "muted" ? c.surface2 : tint(col, c) }}>
253
+ return <View testID="follow-up-row-chip" style={{ flexShrink: 1, minWidth: 0, paddingHorizontal: 6, height: 20, justifyContent: "center", borderRadius: 4, backgroundColor: b.tone === "muted" ? c.surface2 : tint(col, c) }}>
254
254
  <Text numberOfLines={1} style={{ color: col, fontSize: 11, lineHeight: 14, fontWeight: "500" }}>{b.text}</Text>
255
255
  </View>;
256
256
  }
@@ -258,10 +258,10 @@ export function BadgeView({ b, c }: { b: Badge; c: Colors }) {
258
258
  export function PrChipView({ s, c }: { s: Workstream; c: Colors }) {
259
259
  if (!s.pr) return null;
260
260
  const checks = s.pr.checks;
261
- return <View style={{ flexDirection: "row", alignItems: "center", gap: 4, paddingHorizontal: 6, height: 20, borderRadius: 4, borderWidth: 1, borderColor: c.border }}>
261
+ return <View testID="follow-up-row-chip" style={{ flexShrink: 1, minWidth: 0, flexDirection: "row", alignItems: "center", gap: 4, paddingHorizontal: 6, height: 20, borderRadius: 4, borderWidth: 1, borderColor: c.border }}>
262
262
  <Icon name="GitPullRequest" size={11} color={toneColor(c, s.pr.tone)} />
263
- <Text style={{ color: c.foreground, fontSize: 11, lineHeight: 14, fontVariant: ["tabular-nums"] }}>{s.pr.label}</Text>
264
- {checks && <Text style={{ color: checks.tone === "muted" ? c.foregroundMuted : badgeColor({ text: "", tone: checks.tone }, c), fontSize: 11, lineHeight: 14 }}>{checks.text}</Text>}
263
+ <Text numberOfLines={1} style={{ flexShrink: 0, color: c.foreground, fontSize: 11, lineHeight: 14, fontVariant: ["tabular-nums"] }}>{s.pr.label}</Text>
264
+ {checks && <Text numberOfLines={1} style={{ flexShrink: 1, minWidth: 0, color: checks.tone === "muted" ? c.foregroundMuted : badgeColor({ text: "", tone: checks.tone }, c), fontSize: 11, lineHeight: 14 }}>{checks.text}</Text>}
265
265
  </View>;
266
266
  }
267
267
 
@@ -281,7 +281,21 @@ export function WakeTime({ until, c, size = 12 }: { until: string; c: Colors; si
281
281
  }
282
282
  /** The right-hand time: when a Later row comes back, otherwise how long ago. */
283
283
  function RowTime({ s, c, size }: { s: Workstream; c: Colors; size: number }) {
284
- return s.group === "later" && s.wakeAt ? <WakeTime until={s.wakeAt} c={c} size={size} /> : <Age iso={s.at} c={c} size={size} />;
284
+ return <View testID="follow-up-row-time" style={{ flexShrink: 0 }}>{s.group === "later" && s.wakeAt ? <WakeTime until={s.wakeAt} c={c} size={size} /> : <Age iso={s.at} c={c} size={size} />}</View>;
285
+ }
286
+
287
+ /**
288
+ * row-chips-never-cover-the-time: a desktop row's badges and PR chip, in priority order (most telling first). They yield
289
+ * before the time column ever moves: the rail shrinks first, a chip that doesn't fit wraps onto a second line the rail
290
+ * clips (so the lowest-priority chips drop, last first), and a lone chip truncates. Guarded by
291
+ * `scripts/screenshots.mjs --only rowchips` (CDP boxes at list widths 320, 360 and 400) and tests/row-chips.test.ts.
292
+ */
293
+ function ChipRail({ s, c }: { s: Workstream; c: Colors }) {
294
+ const chips = railChips(s);
295
+ if (chips.length === 0) return null;
296
+ return <View testID="follow-up-row-chips" style={{ flexShrink: 1000, minWidth: 0, height: 20, overflow: "hidden", flexDirection: "row", flexWrap: "wrap", justifyContent: "flex-end", columnGap: 10, rowGap: 4 }}>
297
+ {chips.map(ch => ch.kind === "badge" ? <BadgeView key={ch.badge.text} b={ch.badge} c={c} /> : <PrChipView key="pr" s={s} c={c} />)}
298
+ </View>;
285
299
  }
286
300
 
287
301
  /** The age on the right. It re-renders on the shared minute clock without touching its row. */
@@ -325,7 +339,9 @@ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMe
325
339
  // A Later row says when it comes back on screen; the label also keeps how long it has waited.
326
340
  const wake = s.group === "later" && s.wakeAt ? wakeLabel({ until: s.wakeAt, at: s.at ?? new Date().toISOString() }, Date.now()) : "";
327
341
  const waited = s.group === "later" && s.at ? age(s.at, Date.now()) : "";
328
- const label = [s.title + (s.agent ? ` › ${s.agent}` : ""), s.word, s.line, hit?.via && `${FIELD_LABEL[hit.via.field]}: ${hit.via.text}`, wake && `Later until ${wake}`, waited && (waited === "now" ? "just now" : `waiting ${waited}`)].filter(Boolean).join(". ");
342
+ const label = [s.title + (s.agent ? ` › ${s.agent}` : ""), s.word, s.line, hit?.via && `${FIELD_LABEL[hit.via.field]}: ${hit.via.text}`,
343
+ // Every chip, even one a narrow row hides (row-chips-never-cover-the-time).
344
+ ...s.badges.map(b => b.text), s.pr && `Pull request ${s.pr.label}${s.pr.checks ? ` ${s.pr.checks.text}` : ""}`, wake && `Later until ${wake}`, waited && (waited === "now" ? "just now" : `waiting ${waited}`)].filter(Boolean).join(". ");
329
345
  return <Pressable ref={trigger.ref} nativeID={rowDomId(s.key)} accessibilityRole="button" accessibilityState={{ selected }} accessibilityLabel={label} accessibilityHint={quickActionsHint(touch)}
330
346
  onPress={() => onSelect(s.key)} onLongPress={trigger.onLongPress} delayLongPress={450}
331
347
  style={state => ({ ...focusRing((state as { focused?: boolean }).focused, c, true), flexDirection: "row", alignItems: dense ? "flex-start" : "center", gap: touch ? 10 : dense ? 8 : 10, minHeight: touch ? 56 : dense ? 36 : 38, paddingLeft: touch ? 14 : dense ? 8 : 16, paddingRight: touch ? 16 : dense ? 8 : 16, paddingVertical: touch ? 12 : dense ? 6 : 0,
@@ -359,12 +375,16 @@ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMe
359
375
  {s.badges.map(b => <BadgeView key={b.text} b={b} c={c} />)}<PrChipView s={s} c={c} />
360
376
  </View>}
361
377
  </View> : <View style={{ flex: 1, minWidth: 0, gap: 1, paddingVertical: s.priority?.reason ? 4 : 0 }}><View style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
362
- <Text numberOfLines={1} style={{ flexShrink: 0, maxWidth: "55%", color: muted ? c.foregroundMuted : c.foreground, fontSize: 13, fontWeight: muted ? "400" : "500" }}>{title}</Text>
363
- <Text numberOfLines={1} style={{ flex: 1, minWidth: 0, color: c.foregroundMuted, fontSize: 12 }}>
364
- {via ?? <>{s.word && s.group === "needs" ? <Text style={{ color }}>{s.word}</Text> : null}{s.word && s.group === "needs" && s.line ? " · " : ""}{line}</>}
378
+ {/* The title keeps its width (up to 55 %) and the chips yield; only beside Send now, which can't, does it shrink. */}
379
+ <Text numberOfLines={1} style={{ flexShrink: sendNow ? 1 : 0, minWidth: 0, maxWidth: "55%", color: muted ? c.foregroundMuted : c.foreground, fontSize: 13, fontWeight: muted ? "400" : "500" }}>{title}</Text>
380
+ {/* A Needs-you row's word (Permission, Question…) is why it's there: it keeps its place, the chips yield first. */}
381
+ {!via && s.word && s.group === "needs" ? <Text numberOfLines={1} style={{ flexShrink: 0, color, fontSize: 12 }}>{s.word}</Text> : null}
382
+ {/* -10 takes back the row gap and the separator opens with a no-break space (a leading plain space is trimmed), so
383
+ "Permission · Accept…" reads as one line, and the dot goes with the line when there's no room for it. */}
384
+ <Text numberOfLines={1} style={{ flex: 1, minWidth: 0, color: c.foregroundMuted, fontSize: 12, marginLeft: !via && s.word && s.group === "needs" ? -10 : 0 }}>
385
+ {via ?? <>{s.word && s.group === "needs" && s.line ? "\u00a0· " : ""}{line}</>}
365
386
  </Text>
366
- {s.badges.map(b => <BadgeView key={b.text} b={b} c={c} />)}
367
- <PrChipView s={s} c={c} />
387
+ <ChipRail s={s} c={c} />
368
388
  {sendNow}
369
389
  </View>{!!s.priority?.reason && <View style={{ paddingRight: 40 }}><PriorityLine reason={s.priority.reason} source={s.priority.source} c={c} /></View>}</View>}
370
390
  {!touch && <RowTime s={s} c={c} size={dense ? 11 : 12} />}
@@ -43,7 +43,7 @@ export function createHomeExtras(client: PluginClientContext) {
43
43
  let rank: RpcOutput<typeof rankStatusRpc> | null = null;
44
44
  const agents = new Map<string, AgentLite>();
45
45
  let version = 0;
46
- let focusToken = 0;
46
+ let focusToken = 0; let focusPending = false;
47
47
  let stopped = false;
48
48
  const listeners = new Set<() => void>();
49
49
  let pending: ReturnType<typeof setTimeout> | null = null;
@@ -222,9 +222,15 @@ export function createHomeExtras(client: PluginClientContext) {
222
222
  /** Settings → Agents changed: a new Overseer on the configured agent, handed the old one's last steps. */
223
223
  async restartOverseer() { overseer = await client.rpc(overseerRestartRpc, {}); emit(); return overseer; },
224
224
  agents: () => [...agents.values()],
225
- /** Bumped by ⌘K "Follow-up: Search"; the visible search field focuses when it changes. */
225
+ /** Bumped by ⌘K "Follow-up: Search" and the search key; the visible search field focuses when it changes. */
226
226
  focusToken: () => focusToken,
227
- focusSearch() { focusToken++; emit(); },
227
+ /**
228
+ * Asks Home's search to take the cursor: now if Home is mounted, else as soon as it mounts (a Home opened by this
229
+ * very request mounts after the call, so a bare token bump would be missed).
230
+ */
231
+ focusSearch() { focusToken++; focusPending = true; emit(); },
232
+ /** True once per focusSearch: the search field that takes it focuses. */
233
+ takeFocus() { const was = focusPending; focusPending = false; return was; },
228
234
  /** Calls `listener` when an agent's status, attention or permissions change (see above). */
229
235
  onActivity(listener: () => void) { activity.add(listener); return () => { activity.delete(listener); }; },
230
236
  /** Each update Paseo sends about one agent (null when it's removed). */
package/client/home.tsx CHANGED
@@ -1,8 +1,8 @@
1
- import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
1
+ import { type ReactNode, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
2
2
  import { browserKey } from "./keys";
3
3
  import { Platform, TextInput, useWindowDimensions, View } from "react-native";
4
4
  import { Pressable, Text } from "./text";
5
- import { usePaseo, useRpc, type PluginScreenProps } from "@getpaseo/plugin/client";
5
+ import { usePaseo, useRpc, useSettings, type PluginScreenProps } from "@getpaseo/plugin/client";
6
6
  import { Icon, ScrollView, Modal, useToast } from "@getpaseo/plugin/client/ui";
7
7
  import { useQuery } from "@tanstack/react-query";
8
8
  import { browserStatusRpc, controlRpc, inboxBriefRpc, sendRpc } from "../shared/contracts";
@@ -34,6 +34,11 @@ import { withAlpha, isLight, mergedColor, type Colors } from "./theme";
34
34
  import { UpdateNotice, VersionMark } from "./updates";
35
35
  import { WhatsNewGate } from "./release-notes";
36
36
  import { ViewSync } from "./view-store";
37
+ import { ResizableSplit } from "./split";
38
+ import type { SearchKey } from "./search-key";
39
+
40
+ import { displayPreferences, displayRpc, writeDisplay, HOME_DETAIL_DEFAULT, HOME_DETAIL_MAX, HOME_DETAIL_MIN, type DisplayClient } from "../shared/display";
41
+ import { subscribeDisplay } from "./display";
37
42
  import { useRowMenu } from "./row-actions";
38
43
  import { laterChoices } from "../shared/row-menu";
39
44
  import { PrLinksProvider, RichText } from "./rich-text";
@@ -41,6 +46,10 @@ import { TOAST_ANCHOR, ToastHost, useQuestionOpener } from "./toasts";
41
46
  import { openRowCopy, useDetailGate, useWorkspace } from "./workspace-data";
42
47
  import type { ListWorkspace } from "../shared/list";
43
48
 
49
+ /** Home without a search key (tests, older wiring): no subscription, no label. */
50
+ const noSubscribe = () => () => undefined;
51
+ const noLabel = () => null;
52
+
44
53
  export const HOME_SCREEN = "follow-up";
45
54
 
46
55
  const mono = Platform.OS === "ios" ? "Menlo" : "ui-monospace, SFMono-Regular, Menlo, monospace";
@@ -56,6 +65,8 @@ export type HomeDeps = {
56
65
  /** Phones: open one Home item as its own screen, so the host's ← (and Android back) returns to the list. */
57
66
  openItem?(key: string, extra?: { question?: string }): void;
58
67
  briefDeps: BriefDeps;
68
+ /** The search-from-anywhere key (client/search-key.ts), for the search field's chip. */
69
+ searchKey?: SearchKey;
59
70
  };
60
71
 
61
72
  /**
@@ -82,6 +93,8 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
82
93
  const compact = layout.compact;
83
94
  const model = useHomeModel(deps.sources);
84
95
  const omnibox = useOmnibox(model, deps.sources);
96
+ const searchKey = deps.searchKey;
97
+ const anywhereKey = useSyncExternalStore(searchKey?.subscribe ?? noSubscribe, searchKey?.label ?? noLabel, searchKey?.label ?? noLabel);
85
98
  useSlashToFocus(omnibox, params.view !== "log");
86
99
  const [filter, setFilter] = useState<HomeGroupId | null>(null);
87
100
  const [selected, setSelected] = useState<string | null>(() => params.item ?? (params.select ? `agent:${params.select}` : null));
@@ -201,7 +214,7 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
201
214
  {/* zIndex: on web every View is its own stacking context, so the sort menu only paints and hit-tests above the
202
215
  strip and meters below if this row sits above them. */}
203
216
  <View style={{ zIndex: 2, flexDirection: "row", alignItems: "center", gap: compact ? 2 : 6, paddingLeft: compact ? 16 : 16, paddingRight: compact ? 6 : 16 }}>
204
- <SearchField theme={theme} omnibox={omnibox} dense={compact} onEnter={item => void pick(item)} />
217
+ <SearchField theme={theme} omnibox={omnibox} dense={compact} onEnter={item => void pick(item)} anywhereKey={anywhereKey} />
205
218
  {!(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} />}
206
219
  {compact && <IconButton theme={theme} compact icon="Settings" label="Follow-up settings" onPress={deps.openSettings} />}
207
220
  </View>
@@ -225,15 +238,43 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
225
238
  <View style={{ position: "absolute", left: 12, right: 12, bottom: bottomGap(true) + (current || selected === OVERSEER_KEY ? 132 : 0) }}><UndoBar store={inbox} theme={theme} touch /></View>
226
239
  </View>;
227
240
  return <View ref={homeRef} style={{ flex: 1, flexDirection: "row", backgroundColor: c.surface0 }}>
228
- <View style={{ flex: 1, minWidth: 0, borderRightWidth: 1, borderRightColor: c.border }}>
241
+ <HomeSplit theme={theme} detail={detail} main={<View style={{ flex: 1, minWidth: 0 }}>
229
242
  {list}
230
243
  {updateSheets}
231
244
  <View style={{ position: "absolute", left: 12, right: 12, bottom: 12 }}><UndoBar store={inbox} theme={theme} touch={false} /></View>
232
- </View>
233
- <View style={{ width: "42%", minWidth: 380, maxWidth: 680 }}>{detail}</View>
245
+ </View>} />
234
246
  </View>;
235
247
  }
236
248
 
249
+ /**
250
+ * Home's list beside its right pane (the brief, or the selected item), with the divider between them
251
+ * (side-panes-are-resizable). The pane's share is the Display setting `home_detail_fraction`, so set_display reaches it.
252
+ */
253
+ function HomeSplit({ theme, main, detail }: { theme: Theme; main: ReactNode; detail: ReactNode }) {
254
+ const settings = useSettings(displayPreferences);
255
+ const readDisplay = useRpc(displayRpc.read); const saveDisplay = useRpc(displayRpc.write);
256
+ const toast = useToast();
257
+ // The host's settings read paints first; the Display feed (an agent's set_display, another device) and this
258
+ // device's own saves replace it. undefined = never set (the default); null = nothing pushed yet.
259
+ const [pushed, setPushed] = useState<number | undefined | null>(null);
260
+ useEffect(() => subscribeDisplay(values => setPushed(values.home_detail_fraction)), []);
261
+ const fraction = pushed !== null ? pushed : settings.status === "ready" ? settings.values.home_detail_fraction : undefined;
262
+ const commit = (next: number) => {
263
+ setPushed(next);
264
+ const client: DisplayClient = { rpc: (contract, input) => (contract as unknown) === displayRpc.read ? readDisplay(input as never) : saveDisplay(input as never) };
265
+ void writeDisplay(client, { home_detail_fraction: next })
266
+ .then(ok => { if (!ok) toast.error("Couldn't save the pane's width. It resets when Home reopens."); })
267
+ .catch(e => toast.error(errorText(e)));
268
+ };
269
+ return <ResizableSplit theme={theme} main={main} side={detail} testID="follow-up-home-split" label="Resize the detail pane"
270
+ fraction={fraction} defaultFraction={HOME_DETAIL_DEFAULT} range={[HOME_DETAIL_MIN, HOME_DETAIL_MAX]}
271
+ minSide={HOME_DETAIL_MIN_PX} minMain={HOME_LIST_MIN_PX} onCommit={commit} />;
272
+ }
273
+
274
+ /** The right pane is never narrower than this, and the list keeps at least HOME_LIST_MIN_PX (its rows keep their reason line). */
275
+ const HOME_DETAIL_MIN_PX = 360;
276
+ const HOME_LIST_MIN_PX = 480;
277
+
237
278
  function ListHeader({ theme, compact, onSettings }: { theme: Theme; compact: boolean; onSettings: () => void }) {
238
279
  const c = theme.colors;
239
280
  return <View style={{ flexDirection: "row", alignItems: "center", gap: 8, paddingHorizontal: 16 }}>
package/client/kit.tsx CHANGED
@@ -2,7 +2,7 @@ import { useEffect, useRef, useState, type ReactNode } from "react";
2
2
  import { Platform, View, type StyleProp, type ViewStyle } from "react-native";
3
3
  import { Pressable, Text } from "./text";
4
4
  import { Icon } from "@getpaseo/plugin/client/ui";
5
- import { openExternalUrl } from "@getpaseo/plugin/client";
5
+ import { openExternalUrl, type PluginSvgIcon } from "@getpaseo/plugin/client";
6
6
  import { PressScale, Spinner } from "./motion";
7
7
  import { raised, tint, withAlpha, type Colors, type Theme } from "./theme";
8
8
 
@@ -173,14 +173,14 @@ export type CardTone = "plain" | "attention" | "success";
173
173
  * is being searched (client/section-search.tsx), and its field takes the title's place in the header.
174
174
  */
175
175
  export function Card({ theme, icon, title, tone = "plain", count, right, children, compact = false, style, search }: {
176
- theme: Theme; icon: string; title: string; tone?: CardTone; count?: string | number; right?: ReactNode; children: ReactNode; compact?: boolean; style?: StyleProp<ViewStyle>; search?: ReactNode;
176
+ theme: Theme; icon: string | PluginSvgIcon; title: string; tone?: CardTone; count?: string | number; right?: ReactNode; children: ReactNode; compact?: boolean; style?: StyleProp<ViewStyle>; search?: ReactNode;
177
177
  }) {
178
178
  const c = theme.colors;
179
179
  const accent = tone === "attention" ? c.statusWarning : tone === "success" ? c.statusSuccess : null;
180
180
  return <View style={[{ marginHorizontal: compact ? 16 : 12, marginTop: 12, borderRadius: 8, overflow: "hidden", backgroundColor: c.surface0 },
181
181
  accent ? { borderWidth: 1, borderColor: withAlpha(accent, 0.7) } : raised(c), style]}>
182
182
  <View style={{ flexDirection: "row", alignItems: "center", gap: compact ? 8 : 7, paddingHorizontal: compact ? 14 : 12, paddingTop: 10, paddingBottom: 8, minHeight: compact ? 44 : undefined }}>
183
- <Icon name={icon} size={compact ? 16 : 14} color={accent ?? c.foregroundMuted} />
183
+ {typeof icon === "string" ? <Icon name={icon} size={compact ? 16 : 14} color={accent ?? c.foregroundMuted} /> : <Icon icon={icon} size={compact ? 16 : 14} color={accent ?? c.foregroundMuted} />}
184
184
  {search ?? <>
185
185
  <Text accessibilityRole="header" style={{ color: accent ?? c.foreground, fontSize: compact ? 14 : 13, lineHeight: compact ? 20 : 18, fontWeight: "600" }}>{title}</Text>
186
186
  {count !== undefined && count !== "" && <Chip theme={theme} color={accent ?? c.foregroundMuted} label={String(count)} />}
package/client/large.tsx CHANGED
@@ -6,6 +6,7 @@ import { useWorkspace } from "./workspace-data";
6
6
  import type { LiveStore } from "./live";
7
7
  import { Button, Card, CardRow, errorText, text } from "./kit";
8
8
  import { Skeleton } from "./motion";
9
+ import { FOLLOW_UP_ICON } from "./follow-up-icon";
9
10
  import { PanelTop, WorkspaceView, useSessionFolds, type PanelLinks } from "./panel";
10
11
 
11
12
  export const LARGE_SCREEN = "follow-up-workspace";
@@ -44,7 +45,7 @@ export function FollowLarge(props: PluginScreenProps & PanelLinks & { live?: Liv
44
45
  </View>;
45
46
  const w = query.workspace;
46
47
  if (!w) return <View style={{ flex: 1, backgroundColor: c.surface0, padding: layout.compact ? 16 : 24 }}>
47
- <Card theme={theme} compact={layout.compact} icon="GitPullRequest" title="Nothing to show here" style={{ marginHorizontal: 0, marginTop: 0, maxWidth: 520 }}>
48
+ <Card theme={theme} compact={layout.compact} icon={FOLLOW_UP_ICON} title="Nothing to show here" style={{ marginHorizontal: 0, marginTop: 0, maxWidth: 520 }}>
48
49
  <CardRow theme={theme}>
49
50
  <Text style={[text(c).meta, { marginBottom: 10 }]}>{query.error ? `Couldn't read Follow-up: ${errorText(query.error)}` : "Follow-up has nothing on this workspace yet, or it no longer exists."}</Text>
50
51
  {navigation && workspaceId ? <Button theme={theme} icon="ArrowLeft" title="Back to the workspace" onPress={back} /> : null}
@@ -49,8 +49,9 @@ export function useListKeys(options: ListKeysOptions): void {
49
49
  const target = e.target as Target;
50
50
  const typing = !!target && (!!target.isContentEditable || ["INPUT", "TEXTAREA", "SELECT"].includes(target.tagName ?? ""));
51
51
  if (typing && !target?.closest?.("[data-list-keys]")) return;
52
- // A row menu or a dialog over the list keeps its own keys.
53
- if (target?.closest?.('[role="menu"],[role="dialog"],[aria-modal="true"]')) return;
52
+ // A row menu or a dialog over the list keeps its own keys, and so does a control whose keys move it (Home's
53
+ // divider: arrows, Home and End resize the pane, never walk the list).
54
+ if (target?.closest?.('[role="menu"],[role="dialog"],[aria-modal="true"],[role="separator"],[role="slider"]')) return;
54
55
  const root = scope();
55
56
  const onBody = !target || target === doc.body;
56
57
  if (!ownsKey({ inside: !!target && !!root?.contains(target), onBody, claimBody: !!claimBody,
package/client/live.tsx CHANGED
@@ -12,6 +12,7 @@ import { useSidebarViewActive } from "./inbox";
12
12
  import { homeCounts } from "../shared/home";
13
13
  import { useHomeModel, type HomeSources } from "./home-data";
14
14
  import { onVisible, whileVisible } from "./visibility";
15
+ import { FOLLOW_UP_ICON, NEED_DOT, needDotBox } from "./follow-up-icon";
15
16
  import { WhatsNewGate } from "./release-notes";
16
17
  import { ViewSync } from "./view-store";
17
18
  import { ToastHost } from "./toasts";
@@ -95,13 +96,13 @@ export function useLive<T>(store: LiveStore, select: () => T): T {
95
96
  return select();
96
97
  }
97
98
 
98
- /** The header button's icon: a pull-request glyph with a warning dot while the workspace needs you. */
99
+ /** The header button's icon: Follow-up's mark. While the workspace needs you, its end dot turns into the warning dot. */
99
100
  export function headerIcon(store: LiveStore) {
100
101
  return function HeaderIcon(props: PluginButtonIconProps) {
101
102
  const need = useLive(store, () => { const w = store.get(props.workspaceId); return w ? activeNeeds(w).length : 0; });
102
103
  return <View style={{ width: props.size, height: props.size }}>
103
- <Icon name="GitPullRequest" size={props.size} color={props.color} />
104
- {need > 0 && <View accessibilityLabel={`${need} need you`} style={{ position: "absolute", top: -2, right: -3, width: 7, height: 7, borderRadius: 4, backgroundColor: props.theme.colors.statusWarning, borderWidth: 1.5, borderColor: props.theme.colors.surface0 }} />}
104
+ <Icon icon={FOLLOW_UP_ICON} size={props.size} color={props.color} />
105
+ {need > 0 && <View testID="follow-up-need-dot" accessibilityLabel={`${need} need you`} style={{ position: "absolute", ...needDotBox(props.size), width: NEED_DOT, height: NEED_DOT, borderRadius: NEED_DOT / 2, backgroundColor: props.theme.colors.statusWarning }} />}
105
106
  </View>;
106
107
  };
107
108
  }
@@ -120,7 +121,7 @@ export function sidebarItem(sources: HomeSources, screenId: string) {
120
121
  const c = theme.colors;
121
122
  const shown = count > 0 && !inSidebarView;
122
123
  // What's new mounts here too (the sidebar is always there), so it shows even if you live in agent chats.
123
- return <><ViewSync /><WhatsNewGate surface="sidebar" theme={theme} compact={layout.compact} /><ToastHost theme={theme} compact={layout.compact} /><SidebarRow icon="GitPullRequest" active={currentScreen?.screenId === screenId} onPress={() => openScreen({ screenId, params: { section: "needs" } })}
124
+ return <><ViewSync /><WhatsNewGate surface="sidebar" theme={theme} compact={layout.compact} /><ToastHost theme={theme} compact={layout.compact} /><SidebarRow icon={FOLLOW_UP_ICON} active={currentScreen?.screenId === screenId} onPress={() => openScreen({ screenId, params: { section: "needs" } })}
124
125
  trailing={shown ? <View accessibilityLabel={`${count} need${count === 1 ? "s" : ""} you`} style={{ minWidth: 18, height: 18, paddingHorizontal: 5, borderRadius: 9, alignItems: "center", justifyContent: "center", backgroundColor: c.statusWarning }}>
125
126
  <Text style={{ color: c.surface0, fontSize: 11, lineHeight: 14, fontWeight: "700", fontVariant: ["tabular-nums"] }}>{count}</Text>
126
127
  </View> : undefined} /></>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Side-by-side layouts that stay outside ResizableSplit (side-panes-are-resizable). Every other client layout that puts
3
+ * a fixed-width or fixed-share pane beside a flexible one draws it through `ResizableSplit` (`client/split.tsx`).
4
+ * Key: "<file>:<what the guard matched>"; value: why it isn't a pane the developer should resize. Guarded by
5
+ * tests/side-panes.test.ts.
6
+ */
7
+ export const SIDE_PANE_ALLOWED: Record<string, string> = {
8
+ "client/panel.tsx:flex: 5": "The wide workspace view's two card columns (actions, then stacks and activity) sit in one ScrollView and scroll together; they are one page laid out in two columns, not a pane beside a list.",
9
+ "client/panel.tsx:flex: 6": "The second of the wide workspace view's two card columns, which scroll together in one ScrollView with the first; a divider between them would resize half a page, not a pane.",
10
+ };
@@ -0,0 +1,69 @@
1
+ import { Platform } from "react-native";
2
+ import type { PluginClientContext } from "@getpaseo/plugin/client";
3
+ import { displayPreferences, displayRpc } from "../shared/display";
4
+ import { isMac, matchesShortcut, searchShortcutOf, shortcutLabel, type KeyEventLike, type SearchShortcut } from "../shared/search-key";
5
+ import { subscribeDisplay } from "./display";
6
+
7
+ type DomKey = KeyEventLike & { target?: { closest?(selector: string): unknown } | null; preventDefault(): void; stopPropagation(): void };
8
+
9
+ /**
10
+ * Code editors keep their own keys: Paseo 0.16's file editor (CodeMirror) binds Mod-/ to toggle comment, so with the
11
+ * cursor in one the key does what the editor says.
12
+ */
13
+ export const EDITOR_SELECTOR = ".cm-editor, .monaco-editor";
14
+ type Win = {
15
+ navigator?: { platform?: string; userAgent?: string };
16
+ location?: { pathname?: string };
17
+ document?: { addEventListener(t: "keydown", f: (e: DomKey) => void, capture?: boolean): void; removeEventListener(t: "keydown", f: (e: DomKey) => void, capture?: boolean): void };
18
+ };
19
+
20
+ /** Home's route in Paseo's web app (scripts/ui-home.mjs `homeUrl`): the shortcut there only moves the cursor. */
21
+ export function onHomeRoute(pathname: string | undefined, screenId: string): boolean {
22
+ return !!pathname && pathname.includes(`/surface/${screenId}`);
23
+ }
24
+
25
+ /** The current key and its label, kept in step with the Display setting; listeners hear every change. */
26
+ export function createSearchKey() {
27
+ let preset: SearchShortcut = searchShortcutOf(undefined);
28
+ const listeners = new Set<() => void>();
29
+ const set = (next: unknown) => { const p = searchShortcutOf(next); if (p === preset) return; preset = p; for (const l of listeners) l(); };
30
+ return {
31
+ preset: () => preset,
32
+ label: () => shortcutLabel(preset, isMac()),
33
+ set,
34
+ subscribe(listener: () => void) { listeners.add(listener); return () => { listeners.delete(listener); }; },
35
+ };
36
+ }
37
+ export type SearchKey = ReturnType<typeof createSearchKey>;
38
+
39
+ /**
40
+ * Search from anywhere (every-shortcut-is-configurable-and-never-paseo-s): one document listener, web and desktop
41
+ * only, in the capture phase so it works with focus in a text field (it's a chord, like ⌘K). On a match it opens Home
42
+ * (or stays there) and asks Home's search for the cursor; anything else passes through untouched. The key is the
43
+ * Display setting `search_shortcut`, read once at start and then from the Display feed or poll. Inside a code editor
44
+ * the key stays the editor's (EDITOR_SELECTOR).
45
+ */
46
+ export function installSearchShortcut(client: PluginClientContext, key: SearchKey, open: { screenId: string; focus: () => void }): () => void {
47
+ const win = globalThis as Win;
48
+ const doc = win.document;
49
+ if (Platform.OS !== "web" || !doc) return () => undefined;
50
+ const mac = isMac();
51
+ let live = true;
52
+ void client.rpc(displayRpc.read, {}).then(doc => {
53
+ if (!live || doc.status !== "ready") return;
54
+ const parsed = displayPreferences.schema.safeParse(doc.values);
55
+ if (parsed.success) key.set(parsed.data.search_shortcut);
56
+ }).catch(() => undefined);
57
+ const offDisplay = subscribeDisplay(values => key.set(values.search_shortcut));
58
+ const onKey = (e: DomKey) => {
59
+ if (!matchesShortcut(e, key.preset(), mac) || e.target?.closest?.(EDITOR_SELECTOR)) return;
60
+ e.preventDefault(); e.stopPropagation();
61
+ if (onHomeRoute(win.location?.pathname, open.screenId)) { open.focus(); return; }
62
+ client.openScreen({ screenId: open.screenId });
63
+ // A Home that mounts now takes the request on mount; one kept mounted behind takes it once it's on screen.
64
+ const raf = typeof requestAnimationFrame === "function" ? requestAnimationFrame : (f: () => void) => setTimeout(f, 16);
65
+ raf(() => raf(() => open.focus()));
66
+ };
67
+ doc.addEventListener("keydown", onKey, true);
68
+ return () => { live = false; offDisplay(); doc.removeEventListener("keydown", onKey, true); };
69
+ }