paseo-follow-up 2.2.0-beta.1 → 2.2.0-beta.3

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.
@@ -0,0 +1,108 @@
1
+ // A scrolling pane with a bar docked under it (`a-focused-field-and-its-send-stay-in-view`). Home's detail pane, the
2
+ // Overseer's pane and setup draw through it, so none of them handles the keyboard or a focused field its own way.
3
+ import { useEffect, useRef, useState, type ReactNode } from "react";
4
+ import { Keyboard, Platform, TextInput, View, findNodeHandle, type StyleProp, type ViewStyle } from "react-native";
5
+ import { ScrollView } from "@getpaseo/plugin/client/ui";
6
+ import { KEYBOARD_MIN, dockState, isField, keyboardOverlap, revealFocused, type DockNode, type DockState } from "./dock";
7
+
8
+ type Doc = { activeElement?: DockNode | null };
9
+ type Viewport = { height: number; offsetTop: number; addEventListener(e: "resize" | "scroll", f: () => void): void; removeEventListener(e: "resize" | "scroll", f: () => void): void };
10
+ type Win = { innerHeight: number; innerWidth: number; visualViewport?: Viewport; addEventListener(e: "resize", f: () => void): void; removeEventListener(e: "resize", f: () => void): void };
11
+ type DomNode = DockNode & { contains(n: unknown): boolean; addEventListener(e: string, f: (e: { target: unknown }) => void): void; removeEventListener(e: string, f: (e: { target: unknown }) => void): void };
12
+
13
+ /**
14
+ * Phones: whether the on-screen keyboard is up, and how much of the page it covers. On the web the keyboard either
15
+ * shrinks the visual viewport over an unchanged page (iOS Safari, Chrome's default: `overlap`) or resizes the page
16
+ * itself (`interactive-widget=resizes-content`: the window got shorter at the same width). Native reads Keyboard.
17
+ */
18
+ export function useKeyboard(compact: boolean): { up: boolean; overlap: number } {
19
+ const [k, setK] = useState({ up: false, overlap: 0 });
20
+ useEffect(() => {
21
+ if (!compact) return;
22
+ if (Platform.OS === "web") {
23
+ const win = globalThis as unknown as Win;
24
+ const vv = win.visualViewport;
25
+ let tallest = win.innerHeight, width = win.innerWidth;
26
+ const check = () => {
27
+ if (win.innerWidth !== width) { width = win.innerWidth; tallest = win.innerHeight; }
28
+ tallest = Math.max(tallest, win.innerHeight);
29
+ const overlap = vv ? keyboardOverlap({ innerHeight: win.innerHeight, viewportHeight: vv.height, offsetTop: vv.offsetTop }) : 0;
30
+ const up = overlap > KEYBOARD_MIN || tallest - win.innerHeight > KEYBOARD_MIN;
31
+ setK(p => p.up === up && p.overlap === overlap ? p : { up, overlap: up ? overlap : 0 });
32
+ };
33
+ vv?.addEventListener("resize", check); vv?.addEventListener("scroll", check); win.addEventListener("resize", check);
34
+ return () => { vv?.removeEventListener("resize", check); vv?.removeEventListener("scroll", check); win.removeEventListener("resize", check); };
35
+ }
36
+ // Native: the host keeps the pane above the keyboard; the pane only needs to know it is up.
37
+ const show = Keyboard.addListener(Platform.OS === "ios" ? "keyboardWillShow" : "keyboardDidShow", () => setK({ up: true, overlap: 0 }));
38
+ const hide = Keyboard.addListener(Platform.OS === "ios" ? "keyboardWillHide" : "keyboardDidHide", () => setK({ up: false, overlap: 0 }));
39
+ return () => { show.remove(); hide.remove(); };
40
+ }, [compact]);
41
+ return k;
42
+ }
43
+
44
+ /**
45
+ * The pane: `header`, a scroll view holding `children`, and the bar `dock(yields)` draws under it. On a phone, while
46
+ * a field in the pane has focus or the keyboard is up, `yields` is true and the dock drops its extras (Home's Sign
47
+ * off row, setup's Back and Continue), the pane stops above the keyboard, and the focused field's primary form (the
48
+ * field with its Send, marked PRIMARY_FORM) scrolls into view, again whenever the keyboard or the dock changes size.
49
+ */
50
+ export function DockedPane({ compact, header, children, dock, style, contentContainerStyle, scrollRef }: {
51
+ compact: boolean; header?: ReactNode | ((s: DockState) => ReactNode); children: ReactNode; dock?: (s: DockState) => ReactNode;
52
+ style?: StyleProp<ViewStyle>; contentContainerStyle?: StyleProp<ViewStyle>;
53
+ scrollRef?: React.MutableRefObject<unknown>;
54
+ }) {
55
+ const root = useRef<View | null>(null);
56
+ const dockRef = useRef<View | null>(null);
57
+ const ownScroll = useRef<unknown>(null);
58
+ const scroll = scrollRef ?? ownScroll;
59
+ const [focus, setFocus] = useState({ field: false, inDock: false });
60
+ const keyboard = useKeyboard(compact);
61
+ const state = dockState({ compact, fieldFocused: focus.field, fieldInDock: focus.inDock, keyboardUp: keyboard.up });
62
+ const yields = state.yields;
63
+ const inDock = (n: unknown) => !!n && !!(dockRef.current as unknown as DomNode | null)?.contains(n);
64
+ // Web: track focus inside the pane, and keep the focused field's form on screen.
65
+ const reveal = () => {
66
+ if (Platform.OS !== "web") return;
67
+ const node = root.current as unknown as DomNode | null;
68
+ const active = (globalThis as { document?: Doc }).document?.activeElement;
69
+ if (node && active && node.contains(active)) revealFocused(active);
70
+ };
71
+ useEffect(() => {
72
+ if (Platform.OS !== "web" || !compact) return;
73
+ const node = root.current as unknown as DomNode | null;
74
+ if (!node) return;
75
+ const timers = new Set<ReturnType<typeof setTimeout>>();
76
+ const later = (ms: number, f: () => void) => { const t = setTimeout(() => { timers.delete(t); f(); }, ms); timers.add(t); };
77
+ const onIn = (e: { target: unknown }) => {
78
+ if (!isField(e.target as DockNode)) return;
79
+ setFocus({ field: true, inDock: inDock(e.target) });
80
+ // Once the dock has yielded and the keyboard has settled.
81
+ later(0, reveal); later(320, reveal);
82
+ };
83
+ const onOut = () => later(0, () => {
84
+ const active = (globalThis as { document?: Doc }).document?.activeElement;
85
+ const field = !!active && node.contains(active) && isField(active);
86
+ setFocus({ field, inDock: field && inDock(active) });
87
+ });
88
+ node.addEventListener("focusin", onIn); node.addEventListener("focusout", onOut);
89
+ return () => { node.removeEventListener("focusin", onIn); node.removeEventListener("focusout", onOut); timers.forEach(clearTimeout); };
90
+ }, [compact]);
91
+ useEffect(() => { if (yields) { reveal(); const t = setTimeout(reveal, 320); return () => clearTimeout(t); } }, [yields, state.typingInContent, keyboard.overlap]);
92
+ // Native: the focused input, with room below it for its Send, once the keyboard is up.
93
+ useEffect(() => {
94
+ if (Platform.OS === "web" || !keyboard.up) return;
95
+ const input = (TextInput as unknown as { State?: { currentlyFocusedInput?(): unknown } }).State?.currentlyFocusedInput?.();
96
+ const handle = input ? findNodeHandle(input as never) : null;
97
+ const s = scroll.current as { scrollResponderScrollNativeHandleToKeyboard?(h: number, extra: number, prevent: boolean): void } | null;
98
+ if (handle) s?.scrollResponderScrollNativeHandleToKeyboard?.(handle, NATIVE_SEND_ROOM, true);
99
+ }, [keyboard.up]);
100
+ return <View ref={root} style={[{ flex: 1 }, style, keyboard.overlap ? { paddingBottom: keyboard.overlap } : null]}>
101
+ {typeof header === "function" ? header(state) : header}
102
+ <ScrollView ref={scroll as never} style={{ flex: 1 }} contentContainerStyle={contentContainerStyle} keyboardShouldPersistTaps="handled">{children}</ScrollView>
103
+ <View ref={dockRef}>{dock?.(state)}</View>
104
+ </View>;
105
+ }
106
+
107
+ /** Native: what is kept clear under the focused input, about one row of actions (Send) plus the gap above it. */
108
+ const NATIVE_SEND_ROOM = 96;
@@ -1,13 +1,14 @@
1
1
  import type { PluginClientContext } from "@getpaseo/plugin/client";
2
- import { displayFeed, homeFeed, overseerAskRpc, overseerRestartRpc, overseerStartRpc, overseerStatusRpc, prioritiesRpc, rankNowRpc, rankStatusRpc, usageRpc } from "../shared/contracts";
2
+ import { contextAskRpc, contextListRpc, displayFeed, homeFeed, overseerAskRpc, overseerRestartRpc, overseerStartRpc, overseerStatusRpc, prioritiesRpc, rankNowRpc, rankStatusRpc, usageRpc } from "../shared/contracts";
3
3
  import { openFeed } from "./feeds";
4
- import type { RpcOutput } from "@getpaseo/plugin";
4
+ import type { RpcInput, RpcOutput } from "@getpaseo/plugin";
5
5
  import type { Priority } from "../shared/priorities";
6
6
  import { DEFAULT_SORT, isSortMode, type SortMode } from "../shared/sort";
7
7
  import { homeSortSync } from "../shared/display";
8
8
  import type { AgentLite } from "../shared/search";
9
9
  import { NO_USAGE, USAGE_POLL_MS, type Usage } from "../shared/usage";
10
10
  import { onVisible, whileVisible } from "./visibility";
11
+ import type { ContextRequest } from "../shared/catch-up";
11
12
 
12
13
  /**
13
14
  * What Home adds on top of the inbox, live and Paseo stores (1.3.0-beta.2): the sort choice, external
@@ -41,6 +42,10 @@ export function createHomeExtras(client: PluginClientContext) {
41
42
  let usage: Usage = NO_USAGE;
42
43
  let overseer: RpcOutput<typeof overseerStatusRpc> | null = null;
43
44
  let rank: RpcOutput<typeof rankStatusRpc> | null = null;
45
+ /** Catch up's More context asks: pushed on the home feed; read when Catch up opens or moves, never on a timer of their own. */
46
+ let context: ContextRequest[] = [];
47
+ const setContext = (next: ContextRequest[]) => { if (JSON.stringify(next) === JSON.stringify(context)) return false; context = next; return true; };
48
+ const readContext = async () => setContext((await client.rpc(contextListRpc, {})).requests);
44
49
  const agents = new Map<string, AgentLite>();
45
50
  let version = 0;
46
51
  let focusToken = 0; let focusPending = false;
@@ -91,7 +96,9 @@ export function createHomeExtras(client: PluginClientContext) {
91
96
  poll(PRIORITY_POLL_MS, readRank),
92
97
  poll(15_000, async () => {
93
98
  const next = await client.rpc(overseerStatusRpc, {});
94
- if (JSON.stringify(next) === JSON.stringify(overseer)) return false;
99
+ // Without the feed, an ask still open is read on the Overseer's existing poll: no poll of its own.
100
+ const asked = context.some(r => r.state === "asking") ? await readContext().catch(() => false) : false;
101
+ if (JSON.stringify(next) === JSON.stringify(overseer)) return asked;
95
102
  overseer = next; return true;
96
103
  }),
97
104
  pollUsage(),
@@ -110,6 +117,7 @@ export function createHomeExtras(client: PluginClientContext) {
110
117
  event: event => {
111
118
  if (stopped) return;
112
119
  priorities = event.priorities; rank = event.rank; overseer = event.overseer;
120
+ if (event.context) setContext(event.context);
113
121
  if (event.usage) usage = { ...event.usage, resources: usage.resources };
114
122
  if (!event.rank.running) { for (const done of rankWaiters) done(); rankWaiters.clear(); }
115
123
  // Smart Session's files can't be watched: read the meters once a minute instead.
@@ -221,6 +229,16 @@ export function createHomeExtras(client: PluginClientContext) {
221
229
  async askOverseer(text: string) { overseer = await client.rpc(overseerAskRpc, { text }); emit(); return overseer; },
222
230
  /** Settings → Agents changed: a new Overseer on the configured agent, handed the old one's last steps. */
223
231
  async restartOverseer() { overseer = await client.rpc(overseerRestartRpc, {}); emit(); return overseer; },
232
+ /** Catch up's More context asks and their answers. */
233
+ context: () => context,
234
+ /** Reads the asks once (Catch up opening or moving on, so a 0.15 host or a dropped feed is never stale for long). */
235
+ async refreshContext() { if (await readContext().catch(() => false)) emit(); },
236
+ /** Asks the Overseer or the card's agent; the ask shows at once, its answer arrives on the feed. */
237
+ async askContext(input: RpcInput<typeof contextAskRpc>) {
238
+ const out = await client.rpc(contextAskRpc, input);
239
+ setContext([...context.filter(r => r.id !== out.request.id), out.request]); emit();
240
+ return out;
241
+ },
224
242
  agents: () => [...agents.values()],
225
243
  /** Bumped by ⌘K "Follow-up: Search" and the search key; the visible search field focuses when it changes. */
226
244
  focusToken: () => focusToken,
package/client/home.tsx CHANGED
@@ -17,6 +17,8 @@ import { BriefCard, type BriefDeps } from "./brief";
17
17
  import { SummaryLine } from "./about";
18
18
  import { ReferencesLine } from "./linked";
19
19
  import { bottomGap, bottomInset, Button, focusSoon, IconButton, space, text, type Theme } from "./kit";
20
+ import { DockedPane } from "./docked-pane";
21
+ import type { DockState } from "./dock";
20
22
  import { NeedsYouBlock } from "./needs-you";
21
23
  import { HeldMerges } from "./merge-button";
22
24
  import { PrSheet } from "./pr-sheet";
@@ -34,6 +36,8 @@ import { withAlpha, isLight, mergedColor, type Colors } from "./theme";
34
36
  import { UpdateNotice, VersionMark } from "./updates";
35
37
  import { WhatsNewGate } from "./release-notes";
36
38
  import { ViewSync } from "./view-store";
39
+ import { CatchUp, CatchUpButton } from "./catch-up";
40
+ import { deckCards } from "../shared/catch-up";
37
41
  import { ResizableSplit } from "./split";
38
42
  import type { SearchKey } from "./search-key";
39
43
 
@@ -61,6 +65,8 @@ export type HomeDeps = {
61
65
  /** Docks the workspace's own panel in its explorer column. */
62
66
  openPanel(workspaceId: string): void;
63
67
  openLog(): void;
68
+ /** Catch up: Needs you one card at a time (`?view=catchup`). */
69
+ openCatchUp?(): void;
64
70
  openHome(): void;
65
71
  /** Phones: open one Home item as its own screen, so the host's ← (and Android back) returns to the list. */
66
72
  openItem?(key: string, extra?: { question?: string }): void;
@@ -95,7 +101,7 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
95
101
  const omnibox = useOmnibox(model, deps.sources);
96
102
  const searchKey = deps.searchKey;
97
103
  const anywhereKey = useSyncExternalStore(searchKey?.subscribe ?? noSubscribe, searchKey?.label ?? noLabel, searchKey?.label ?? noLabel);
98
- useSlashToFocus(omnibox, params.view !== "log");
104
+ useSlashToFocus(omnibox, params.view !== "log" && params.view !== "catchup");
99
105
  const [filter, setFilter] = useState<HomeGroupId | null>(null);
100
106
  const [selected, setSelected] = useState<string | null>(() => params.item ?? (params.select ? `agent:${params.select}` : null));
101
107
  const openAgentRow = useMemo(() => navigation ? (row: InboxRow) => navigation.openAgent({ agentId: row.agentId }) : undefined, [navigation]);
@@ -116,6 +122,8 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
116
122
  const current = selected ? model.byKey.get(selected) ?? (selected.startsWith("agent:") ? [...model.byKey.values()].find(x => x.agentId === selected.slice(6)) ?? null : null) : null;
117
123
  const tracked = useSyncExternalStore(deps.sources.live.subscribe, deps.sources.live.version, deps.sources.live.version);
118
124
  const rows = useInbox(inbox, () => inbox.rows());
125
+ // Go through's count is its cards (one per ask), the same deck the mode opens on.
126
+ const deckSize = useMemo(() => deckCards({ model, rows, items: id => { const w = deps.sources.live.get(id); return w ? needsYou(w as never) : []; } }).length, [model, rows, tracked, deps.sources.live]);
119
127
  const pane = useMemo(() => briefPane({ model, rows, tracked: deps.sources.live.all(), now: Date.now() }), [model, rows, tracked, deps.sources.live]);
120
128
  const rank = useSyncExternalStore(deps.sources.extras.subscribe, deps.sources.extras.rank, deps.sources.extras.rank);
121
129
  const overseerStatus = useSyncExternalStore(deps.sources.extras.subscribe, deps.sources.extras.overseer, deps.sources.extras.overseer);
@@ -183,13 +191,17 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
183
191
  <WhatsNewGate surface="home" theme={theme} compact={compact} />
184
192
  <ToastHost theme={theme} compact={compact} />
185
193
  </>;
194
+ if (params.view === "catchup") return <View style={{ flex: 1 }}>
195
+ <CatchUp theme={theme} compact={compact} deps={{ sources: deps.sources, briefDeps: deps.briefDeps, openHome: deps.openHome, openPanel: deps.openPanel }} navigation={navigation as never} onExit={deps.openHome} />
196
+ {updateSheets}
197
+ </View>;
186
198
  if (params.view === "log") return <LogView theme={theme} compact={compact} sources={deps.sources} onHome={deps.openHome} onOpen={key => { setSelected(key); deps.openHome(); }} />;
187
199
 
188
200
  const detail = selected === OVERSEER_KEY && overseer
189
201
  ? <OverseerPane theme={theme} compact={compact} o={overseer} focus={replyFocus} pending={pendingAsk} agentId={overseerStatus?.agentId ?? null} model={overseerStatus?.model ?? null} restartWith={overseerStatus?.restartWith ?? null} configured={overseerStatus?.configured ?? null} deps={deps} navigation={navigation} onBack={compact && !route ? () => setSelected(null) : undefined} />
190
202
  : current
191
203
  ? <DetailPane key={current.key} s={current} model={model} theme={theme} compact={compact} deps={deps} openFull={openFull} signOffNext={signOffNext} ask={ask?.key === current.key ? ask : null} onBack={compact && !route ? () => setSelected(null) : undefined} />
192
- : <BriefPane theme={theme} compact={compact} pane={pane} onSelect={key => route ? route(key) : setSelected(key)} openLog={deps.openLog} sources={deps.sources} />;
204
+ : <BriefPane theme={theme} compact={compact} pane={pane} catchUp={deps.openCatchUp} deckSize={deckSize} onSelect={key => route ? route(key) : setSelected(key)} openLog={deps.openLog} sources={deps.sources} />;
193
205
  // Nothing followed at all: no sort, no meters, just the empty state and its action.
194
206
  const nothing = model.groups.every(g => !g.items.length);
195
207
  // Enter on a row: its chat, as Open full does. The brief has nothing to open; the Overseer opens once it runs.
@@ -228,6 +240,7 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
228
240
  {/* No title row on phones. The strip has the row to itself, so every chip is reachable (Q51: "Sending" pushed
229
241
  Waiting, Quiet and Later behind the version); the version is at the end of the list. */}
230
242
  <StatusStrip theme={theme} model={model} filter={filter} onFilter={setFilter} touch dense />
243
+ {model.needs > 0 && deps.openCatchUp && <View style={{ paddingHorizontal: 16 }}><CatchUpButton theme={theme} compact count={deckSize} onPress={deps.openCatchUp} /></View>}
231
244
  {updateNotice}
232
245
  {model.needs === 0 && <SetupOffer theme={theme} compact view={props.onboarding} />}
233
246
  </View> : updateNotice} />;
@@ -251,24 +264,32 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
251
264
  * (side-panes-are-resizable). The pane's share is the Display setting `home_detail_fraction`, so set_display reaches it.
252
265
  */
253
266
  function HomeSplit({ theme, main, detail }: { theme: Theme; main: ReactNode; detail: ReactNode }) {
267
+ return <DisplaySplit theme={theme} main={main} side={detail} field="home_detail_fraction" testID="follow-up-home-split" label="Resize the detail pane"
268
+ defaultFraction={HOME_DETAIL_DEFAULT} range={[HOME_DETAIL_MIN, HOME_DETAIL_MAX]} minSide={HOME_DETAIL_MIN_PX} minMain={HOME_LIST_MIN_PX} />;
269
+ }
270
+
271
+ /** A resizable side pane whose share is a Display field (Home's detail pane, Catch up's queue rail). */
272
+ export function DisplaySplit({ theme, main, side, field, defaultFraction, range, minSide, minMain, label, testID }: {
273
+ theme: Theme; main: ReactNode; side: ReactNode; field: "home_detail_fraction" | "catch_up_rail_fraction";
274
+ defaultFraction: number; range: [number, number]; minSide: number; minMain: number; label: string; testID: string;
275
+ }) {
254
276
  const settings = useSettings(displayPreferences);
255
277
  const readDisplay = useRpc(displayRpc.read); const saveDisplay = useRpc(displayRpc.write);
256
278
  const toast = useToast();
257
279
  // The host's settings read paints first; the Display feed (an agent's set_display, another device) and this
258
280
  // device's own saves replace it. undefined = never set (the default); null = nothing pushed yet.
259
281
  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;
282
+ useEffect(() => subscribeDisplay(values => setPushed(values[field])), [field]);
283
+ const fraction = pushed !== null ? pushed : settings.status === "ready" ? settings.values[field] : undefined;
262
284
  const commit = (next: number) => {
263
285
  setPushed(next);
264
286
  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."); })
287
+ void writeDisplay(client, { [field]: next })
288
+ .then(ok => { if (!ok) toast.error("Couldn't save the pane's width. It resets when this screen reopens."); })
267
289
  .catch(e => toast.error(errorText(e)));
268
290
  };
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} />;
291
+ return <ResizableSplit theme={theme} main={main} side={side} testID={testID} label={label}
292
+ fraction={fraction} defaultFraction={defaultFraction} range={range} minSide={minSide} minMain={minMain} onCommit={commit} />;
272
293
  }
273
294
 
274
295
  /** The right pane is never narrower than this, and the list keeps at least HOME_LIST_MIN_PX (its rows keep their reason line). */
@@ -292,7 +313,7 @@ function ListHeader({ theme, compact, onSettings }: { theme: Theme; compact: boo
292
313
  type Permission = { id: string; name: string; title?: string; description?: string; detail?: Record<string, unknown>; input?: Record<string, unknown>; actions?: { id: string; label: string; behavior: "allow" | "deny"; variant?: string }[] };
293
314
 
294
315
  /** The selected agent's live state: pending permissions and status, from its own handle (never the whole list). */
295
- function useAgentLive(agentId: string | null) {
316
+ export function useAgentLive(agentId: string | null) {
296
317
  const paseo = usePaseo();
297
318
  const handle = useMemo(() => agentId ? paseo.agents.ref(agentId) : null, [paseo, agentId]);
298
319
  const [, bump] = useState(0);
@@ -385,7 +406,6 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
385
406
  // Phones: one primary per screen. An actionable Needs-you item (Answer, Merge…) outranks Sign off.
386
407
  const itemFirst = compact && asks.length > 0;
387
408
  const [laterSheet, setLaterSheet] = useState(false);
388
- const [typing, setTyping] = useState(false);
389
409
  // A snoozed row keeps its moves: Sign off is a normal end for something put off, and Later changes the time.
390
410
  const flagged = !!row?.needs;
391
411
  const plan = paneButtons({ permissions: agent.permissions.length, decisions: !!b?.decisions.some(d => d.options.length), items, flagged, hasAgent: !!s.agentId });
@@ -410,12 +430,13 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
410
430
  const metaRest = [laterText, ago === "now" ? "just now" : ago, s.project].filter(Boolean).join(" · ");
411
431
  // Phones: the host header already says Follow-up and carries ←. The pane head is the full-width title, then one meta
412
432
  // line (state, age, project, PRs as text) that ellipsizes instead of wrapping, with Open full as an icon at its end.
413
- const header = compact ? <View style={{ paddingHorizontal: 16, paddingTop: 10, paddingBottom: 6, gap: 2, borderBottomWidth: 1, borderBottomColor: c.border }}>
414
- <Text accessibilityRole="header" numberOfLines={3} style={t.title}>{s.title}</Text>
433
+ // While typing (DockedPane yields) the phone head keeps only the title, so the form gets the height.
434
+ const header = ({ yields: writing }: DockState) => compact ? <View style={{ paddingHorizontal: 16, paddingTop: 10, paddingBottom: 6, gap: 2, borderBottomWidth: 1, borderBottomColor: c.border }}>
435
+ <Text accessibilityRole="header" numberOfLines={writing ? 1 : 3} style={t.title}>{s.title}</Text>
415
436
  {/* The Summary: what this workspace is for, right under its name. */}
416
- {s.workspaceId && w && <View style={{ marginTop: 4 }}><SummaryLine key={s.workspaceId} workspace={w} theme={theme} compact /></View>}
417
- {s.workspaceId && w && <View style={{ marginTop: 6 }}><ReferencesLine key={`refs:${s.workspaceId}`} workspace={w} theme={theme} compact /></View>}
418
- <View style={{ flexDirection: "row", alignItems: "center", gap: 6, minHeight: 44 }}>
437
+ {!writing && s.workspaceId && w && <View style={{ marginTop: 4 }}><SummaryLine key={s.workspaceId} workspace={w} theme={theme} compact /></View>}
438
+ {!writing && s.workspaceId && w && <View style={{ marginTop: 6 }}><ReferencesLine key={`refs:${s.workspaceId}`} workspace={w} theme={theme} compact /></View>}
439
+ {!writing && <View style={{ flexDirection: "row", alignItems: "center", gap: 6, minHeight: 44 }}>
419
440
  <Icon name={s.icon} size={14} color={color} />
420
441
  <Text numberOfLines={1} style={[t.meta, { flex: 1, minWidth: 0 }]}>
421
442
  {!!s.word && <Text style={{ color, fontWeight: "600" }}>{s.word}</Text>}
@@ -423,7 +444,7 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
423
444
  <PrSummaryText s={s} c={c} lead=" · " />
424
445
  </Text>
425
446
  <IconButton theme={theme} compact icon="PanelRightOpen" label="Open full" onPress={() => openFull(s)} />
426
- </View>
447
+ </View>}
427
448
  </View> : <View style={{ paddingHorizontal: 20, paddingTop: 12, paddingBottom: 12, gap: 6, borderBottomWidth: 1, borderBottomColor: c.border }}>
428
449
  <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
429
450
  {onBack && <IconButton theme={theme} compact icon="ChevronLeft" label="Back to Home" onPress={onBack} />}
@@ -476,7 +497,8 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
476
497
  const laterTimes = laterChoices(new Date());
477
498
  // Phones: the moves sit in the dock above the composer, in thumb reach, on one row: Sign off, Sign off & next, Later.
478
499
  const narrow = useWindowDimensions().width < 380;
479
- const moves = compact && canMove && !typing && <View style={{ flexDirection: "row", gap: 8, paddingHorizontal: 12, paddingTop: 10 }}>
500
+ // The dock's extras step aside while a field in the pane has focus (DockedPane, a-focused-field-and-its-send-stay-in-view).
501
+ const moves = compact && canMove && <View style={{ flexDirection: "row", gap: 8, paddingHorizontal: 12, paddingTop: 10 }}>
480
502
  <View style={{ flex: 1 }}><Button nativeID={PANE_PRIMARY} theme={theme} compact grow kind={plan.primary === "sign_off" && !itemFirst ? "primary" : "secondary"} icon={narrow ? undefined : "Check"} title="Sign off" loading={busy === "sign_off"}
481
503
  onPress={() => void run("sign_off", () => inbox.signOff([s.agentId!]))} /></View>
482
504
  <View style={{ flex: 1.3 }}><Button theme={theme} compact grow icon={narrow ? undefined : "ArrowRight"} title="Sign off & next" onPress={() => signOffNext(s)} /></View>
@@ -521,9 +543,14 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
521
543
  // Only a real ask joins it (shared briefAsks): a done brief on a row flagged for something else stays out of the count.
522
544
  const inBlock = !!w && !!showBrief && !later && briefAsks(b, row);
523
545
 
524
- return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
525
- {header}
526
- <ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: compact ? 16 : 20, gap: 16, paddingBottom: 24 }} keyboardShouldPersistTaps="handled">
546
+ return <><DockedPane compact={compact} header={header} style={{ backgroundColor: c.surface0 }} contentContainerStyle={{ padding: compact ? 16 : 20, gap: 16, paddingBottom: 24 }}
547
+ dock={({ yields, typingInContent }) => s.agentId && !typingInContent && <View nativeID={compact ? TOAST_ANCHOR : undefined} style={[{ borderTopWidth: 1, borderTopColor: c.border, backgroundColor: c.surface0 }, bottomInset(compact)]}>
548
+ {!yields && moves}
549
+ <ReplyBox theme={theme} compact={compact} agentName={s.title} placeholder={compact ? "Reply to the agent" : undefined} onSend={async text => {
550
+ await agent.handle!.send(text);
551
+ inbox.refresh();
552
+ }} />
553
+ </View>}>
527
554
  {agent.permissions.map(p => <PermissionBlock key={p.id} p={p} theme={theme} compact={compact} busy={busy === `perm:${p.id}`} primary={plan.primary === "allow"} onRespond={r => void respond(p, r)} />)}
528
555
  {showBrief ? inBlock ? null : <BriefCard {...({ embedded: true, snoozed: !!later, item: { data: b }, theme, layout: { compact }, agentId: s.agentId, deps: deps.briefDeps } as unknown as Parameters<typeof BriefCard>[0])} />
529
556
  : echoed || (b && compact && b.source === "none" && asks.length) ? null
@@ -536,18 +563,11 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
536
563
  {actionBar}
537
564
  {laterBlock}
538
565
  {steps}
539
- </ScrollView>
540
- {s.agentId && <View nativeID={compact ? TOAST_ANCHOR : undefined} style={[{ borderTopWidth: 1, borderTopColor: c.border, backgroundColor: c.surface0 }, bottomInset(compact)]}>
541
- {moves}
542
- <ReplyBox theme={theme} compact={compact} agentName={s.title} placeholder={compact ? "Reply to the agent" : undefined} onFocusChange={setTyping} onSend={async text => {
543
- await agent.handle!.send(text);
544
- inbox.refresh();
545
- }} />
546
- </View>}
566
+ </DockedPane>
547
567
  {laterModal}
548
568
  {full && sheet && <PrSheet workspace={full} prKey={sheet.key} intent={sheet.intent} theme={theme} compact={compact} browserReady={browser.data?.ready ?? false} onClose={() => setSheet(null)} />}
549
569
  {full && <QuestionSheet workspace={full} questionId={question} theme={theme} compact={compact} onClose={() => setQuestion(null)} />}
550
- </View>;
570
+ </>;
551
571
  }
552
572
 
553
573
  /**
@@ -613,9 +633,11 @@ function OverseerPane({ theme, compact, o, focus = 0, pending = null, agentId, m
613
633
  <View style={{ flexDirection: "row" }}><Button theme={theme} compact={compact} grow={compact} kind="primary" icon="Play" title="Start the Overseer" loading={starting} onPress={() => void start()} /></View>
614
634
  </ScrollView>
615
635
  </View>;
616
- return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
617
- {header}
618
- <ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: compact ? 16 : 20, gap: 12, paddingBottom: 24 }} keyboardShouldPersistTaps="handled">
636
+ return <DockedPane compact={compact} header={header} style={{ backgroundColor: c.surface0 }} contentContainerStyle={{ padding: compact ? 16 : 20, gap: 12, paddingBottom: 24 }}
637
+ dock={({ typingInContent }) => agentId && !typingInContent && <View style={[{ borderTopWidth: 1, borderTopColor: c.border }, bottomInset(compact)]}>
638
+ <ReplyBox theme={theme} compact={compact} agentName="the Overseer" placeholder={compact ? "Ask or give a task" : "Ask or give a task: “assign reviewers on all ready PRs”"} hint={null} focus={focus}
639
+ onSend={async message => { await agent.handle!.send(message); inbox.refresh(); }} />
640
+ </View>}>
619
641
  {o.state === "error" && <Text accessibilityRole="alert" style={[t.body, { color: c.statusDanger }]}>{o.line}</Text>}
620
642
  {tail.steps === null ? <Spinner color={c.foregroundMuted} size={12} label="Loading the conversation" />
621
643
  : tail.steps.length === 0 ? <Text style={t.meta}>{tail.error ? `Couldn't load the conversation: ${tail.error}` : "Nothing yet. Ask it what needs you, or give it a task for one of your agents."}</Text>
@@ -625,12 +647,7 @@ function OverseerPane({ theme, compact, o, focus = 0, pending = null, agentId, m
625
647
  {(o.state === "running" || pending && tail.steps && !tail.steps.some(x => x.kind === "you" && x.text.trim() === pending)) && <Spinner color={c.foregroundMuted} size={12} label="The Overseer is working" />}
626
648
  {/* Its open ask, after the conversation that led to it. Only something Tom can act on; never "No ask stated". */}
627
649
  {b && agentId && (b.kind === "decision" && b.decisions.some(d => d.options.length) || b.kind === "action") ? <BriefCard {...({ embedded: true, item: { data: b }, theme, layout: { compact }, agentId, deps: deps.briefDeps } as unknown as Parameters<typeof BriefCard>[0])} /> : null}
628
- </ScrollView>
629
- {agentId && <View style={[{ borderTopWidth: 1, borderTopColor: c.border }, bottomInset(compact)]}>
630
- <ReplyBox theme={theme} compact={compact} agentName="the Overseer" placeholder={compact ? "Ask or give a task" : "Ask or give a task: “assign reviewers on all ready PRs”"} hint={null} focus={focus}
631
- onSend={async message => { await agent.handle!.send(message); inbox.refresh(); }} />
632
- </View>}
633
- </View>;
650
+ </DockedPane>;
634
651
  }
635
652
 
636
653
  /** "Codex · GPT-6-Luna · low" → "GPT-6-Luna · low": the button already says it's the Overseer's provider change. */
@@ -660,7 +677,7 @@ function permissionText(p: Permission): string {
660
677
  return typeof v === "string" ? v : p.description ?? "";
661
678
  }
662
679
 
663
- function PermissionBlock({ p, theme, compact, busy, primary, onRespond }: { p: Permission; theme: Theme; compact: boolean; busy: boolean; primary: boolean; onRespond: (r: { behavior: "allow" | "deny"; selectedActionId?: string; message?: string }) => void }) {
680
+ export function PermissionBlock({ p, theme, compact, busy, primary, onRespond }: { p: Permission; theme: Theme; compact: boolean; busy: boolean; primary: boolean; onRespond: (r: { behavior: "allow" | "deny"; selectedActionId?: string; message?: string }) => void }) {
664
681
  const c = theme.colors; const t = text(c, compact);
665
682
  const command = permissionText(p);
666
683
  // Provider-defined choices ("Always for this session") show as extra secondaries; Allow and Deny always exist.
@@ -730,7 +747,7 @@ function ReplyBox({ theme, compact, agentName, onSend, placeholder = "Answer in
730
747
 
731
748
  // ---------- brief pane ----------
732
749
 
733
- function BriefPane({ theme, compact, pane, onSelect, openLog, sources }: { theme: Theme; compact: boolean; pane: ReturnType<typeof briefPane>; onSelect: (key: string) => void; openLog: () => void; sources: HomeSources }) {
750
+ function BriefPane({ theme, compact, pane, onSelect, openLog, sources, catchUp, deckSize = 0 }: { theme: Theme; compact: boolean; pane: ReturnType<typeof briefPane>; onSelect: (key: string) => void; openLog: () => void; sources: HomeSources; catchUp?: () => void; deckSize?: number }) {
734
751
  const c = theme.colors; const t = text(c, compact);
735
752
  useTick(30_000);
736
753
  const now = Date.now();
@@ -747,7 +764,7 @@ function BriefPane({ theme, compact, pane, onSelect, openLog, sources }: { theme
747
764
  {!compact && <Text style={t.meta}>{date} · {time}</Text>}
748
765
  <Text accessibilityRole="header" style={t.headline}>{pane.headline}</Text>
749
766
  {compact && <Text style={t.meta}>Morning brief · {date} · {time}</Text>}
750
- {pane.first && <Button theme={theme} compact={compact} grow={compact} kind="primary" icon="ArrowRight" title={`Open ${pane.first.title.length > 40 ? `${pane.first.title.slice(0, 40)}…` : pane.first.title}`} onPress={() => onSelect(pane.first!.key)} />}
767
+ {catchUp && deckSize > 0 ? <CatchUpButton theme={theme} compact={compact} count={deckSize} onPress={catchUp} /> : pane.first && <Button theme={theme} compact={compact} grow={compact} kind="primary" icon="ArrowRight" title={`Open ${pane.first.title.length > 40 ? `${pane.first.title.slice(0, 40)}…` : pane.first.title}`} onPress={() => onSelect(pane.first!.key)} />}
751
768
  {!!pane.waiting && <Text style={t.body}><Text style={{ color: c.foregroundMuted }}>Waiting on others: </Text>{pane.waiting}</Text>}
752
769
  <Text style={t.body}><Text style={{ color: c.foregroundMuted }}>Cleared since {sinceLabel(now)}: </Text>{pane.cleared ?? "nothing yet"}.</Text>
753
770
 
@@ -1,8 +1,8 @@
1
1
  import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";
2
- import { Animated, Easing, Keyboard, Platform, View, type ViewStyle, type ScrollView as NativeScrollView } from "react-native";
2
+ import { Animated, Easing, Platform, View, type ViewStyle, type ScrollView as NativeScrollView } from "react-native";
3
3
  import { Pressable, Text } from "./text";
4
4
  import { useRpc, useSettings } from "@getpaseo/plugin/client";
5
- import { Icon, ScrollView, copyText, useToast } from "@getpaseo/plugin/client/ui";
5
+ import { Icon, copyText, useToast } from "@getpaseo/plugin/client/ui";
6
6
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
7
7
  import { followSettingsRpc, onboardingChecksRpc, onboardingRpc, setFollowSettingsRpc, setOnboardingRpc } from "../shared/contracts";
8
8
  import { displayPreferences } from "../shared/display";
@@ -10,6 +10,7 @@ import { ONBOARDING_STEPS, autoSendWrites, checksSummary, type Check, type Onboa
10
10
  import { Button, IconButton, errorText, text, type Theme } from "./kit";
11
11
  import { ReviewerSettings } from "./reviewers";
12
12
  import { JobRows } from "./job-rows";
13
+ import { DockedPane } from "./docked-pane";
13
14
  import { SETUP_ORDER } from "../shared/job-rows";
14
15
  import { ShippingStep } from "./shipping";
15
16
  import { UpdatesStep } from "./updates";
@@ -77,7 +78,6 @@ export function Setup({ theme, compact, view, deps }: { theme: Theme; compact: b
77
78
  } });
78
79
  const skip = () => move.mutate({ action: "skip" }, { onSuccess: () => toast.show("Setup skipped. Set it up any time from Follow-up settings, General.") });
79
80
  const last = index === ONBOARDING_STEPS.length - 1;
80
- const keyboard = useKeyboardUp(compact);
81
81
  const failing = step === "checks" && checks.data ? checksSummary(checks.data.checks).state === "fail" : false;
82
82
 
83
83
  const body = step === "intro" ? <IntroStep theme={theme} compact={compact} follow={follow.data ?? null} />
@@ -100,22 +100,13 @@ export function Setup({ theme, compact, view, deps }: { theme: Theme; compact: b
100
100
  };
101
101
  const column: ViewStyle = { width: "100%", maxWidth: 560, alignSelf: "center", paddingHorizontal: compact ? 16 : 24 };
102
102
 
103
- return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
104
- <View style={[column, { flexDirection: "row", alignItems: "center", gap: 12, paddingTop: compact ? 8 : 20, paddingBottom: 8 }]}>
103
+ return <DockedPane compact={compact} scrollRef={scroll} style={{ backgroundColor: c.surface0 }} contentContainerStyle={{ paddingBottom: 24 }}
104
+ header={<View style={[column, { flexDirection: "row", alignItems: "center", gap: 12, paddingTop: compact ? 8 : 20, paddingBottom: 8 }]}>
105
105
  <Progress theme={theme} index={index} onPick={i => i < index && go(ONBOARDING_STEPS[i])} />
106
106
  <Button theme={theme} compact={compact} kind="ghost" title="Skip setup" accessibilityHint="Leaves setup. Every setting keeps its current value." onPress={skip} disabled={move.isPending} />
107
- </View>
108
- <ScrollView ref={scroll} style={{ flex: 1 }} contentContainerStyle={{ paddingBottom: 24 }} keyboardShouldPersistTaps="handled">
109
- <StepFade key={step} style={[column, { gap: compact ? 14 : 16, paddingTop: compact ? 8 : 20 }]}>
110
- <View style={{ gap: 6 }}>
111
- <Text accessibilityRole="header" style={{ color: c.foreground, fontSize: 20, lineHeight: 26, fontWeight: "600" }}>{TITLES[step]}</Text>
112
- <Text style={[t.body, { color: c.foregroundMuted, maxWidth: 520 }]}>{lead[step]}</Text>
113
- </View>
114
- {body}
115
- </StepFade>
116
- </ScrollView>
117
- {/* While typing a reviewer on a phone the bar steps aside, so Continue never sits over the keyboard. */}
118
- {!keyboard && <View style={[{ borderTopWidth: 1, borderTopColor: c.border, backgroundColor: c.surface0, paddingTop: 12 }, bottomPad(compact)]}>
107
+ </View>}
108
+ // While typing a reviewer on a phone the bar steps aside, so Continue never sits over the keyboard (DockedPane).
109
+ dock={({ yields }) => !yields && <View style={[{ borderTopWidth: 1, borderTopColor: c.border, backgroundColor: c.surface0, paddingTop: 12 }, bottomPad(compact)]}>
119
110
  <View style={[column, { flexDirection: "row", alignItems: "center", gap: 8 }]}>
120
111
  {index > 0 && (compact
121
112
  ? <IconButton theme={theme} compact icon="ChevronLeft" label="Back" onPress={() => go(ONBOARDING_STEPS[index - 1])} />
@@ -126,29 +117,15 @@ export function Setup({ theme, compact, view, deps }: { theme: Theme; compact: b
126
117
  title={last ? "Finish" : failing ? "Continue anyway" : "Continue"} loading={last && move.isPending}
127
118
  onPress={() => last ? finish() : go(ONBOARDING_STEPS[index + 1])} />
128
119
  </View>
129
- </View>}
130
- </View>;
131
- }
132
-
133
- /** Phones: whether the on-screen keyboard is up (native events; on the web, the visual viewport shrinking). */
134
- function useKeyboardUp(compact: boolean): boolean {
135
- const [up, setUp] = useState(false);
136
- useEffect(() => {
137
- if (!compact) return;
138
- if (Platform.OS === "web") {
139
- type Viewport = { height: number; addEventListener(e: "resize", f: () => void): void; removeEventListener(e: "resize", f: () => void): void };
140
- const vv = (globalThis as { visualViewport?: Viewport }).visualViewport;
141
- const win = globalThis as unknown as { innerHeight: number };
142
- if (!vv) return;
143
- const check = () => setUp(win.innerHeight - vv.height > 150);
144
- vv.addEventListener("resize", check);
145
- return () => vv.removeEventListener("resize", check);
146
- }
147
- const show = Keyboard.addListener(Platform.OS === "ios" ? "keyboardWillShow" : "keyboardDidShow", () => setUp(true));
148
- const hide = Keyboard.addListener(Platform.OS === "ios" ? "keyboardWillHide" : "keyboardDidHide", () => setUp(false));
149
- return () => { show.remove(); hide.remove(); };
150
- }, [compact]);
151
- return up;
120
+ </View>}>
121
+ <StepFade key={step} style={[column, { gap: compact ? 14 : 16, paddingTop: compact ? 8 : 20 }]}>
122
+ <View style={{ gap: 6 }}>
123
+ <Text accessibilityRole="header" style={{ color: c.foreground, fontSize: 20, lineHeight: 26, fontWeight: "600" }}>{TITLES[step]}</Text>
124
+ <Text style={[t.body, { color: c.foregroundMuted, maxWidth: 520 }]}>{lead[step]}</Text>
125
+ </View>
126
+ {body}
127
+ </StepFade>
128
+ </DockedPane>;
152
129
  }
153
130
 
154
131
  /** "2 of 5" and one short segment per step, drawn like the stack bar but in neutral ink: progress isn't a PR state. */
@@ -18,6 +18,7 @@ import { activity, type ActivityTone } from "../shared/activity";
18
18
  import { Button, Card, CardRow, Chip, FoldRow, IconButton, SubmitScope, errorText, text, type Theme } from "./kit";
19
19
  import { Spinner } from "./motion";
20
20
  import { NoteLink } from "./brief";
21
+ import { PRIMARY_FORM } from "./dock";
21
22
  import { mergedColor, tint, withAlpha, type Colors } from "./theme";
22
23
  import { overviewKey, workspaceKey } from "./keys";
23
24
  import { PrLinksProvider, RichText } from "./rich-text";
@@ -273,7 +274,6 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
273
274
  {open && (draft.canAddNote || draft.canRemoveNote) && <NoteLink icon={draft.canAddNote ? "MessageSquarePlus" : "X"} label={draft.canAddNote ? "Add note" : "Remove note"}
274
275
  a11y={draft.canAddNote ? `Add a note for the agent about ${q.id}` : `Remove the note on ${q.id}`} disabled={run.isPending} c={c} compact={compact}
275
276
  onPress={() => { if (draft.canAddNote) setNoteOpen(true); else { setWords(""); setNoteOpen(false); } }} />}
276
- {open && !pinned && input}
277
277
  </View>;
278
278
  const actions = (open || q.answer && answerHasActions(q.answer.delivery)) && <View style={{ gap: 6 }}>
279
279
  <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8 }}>
@@ -309,13 +309,20 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
309
309
  <Text style={t.small}>More below</Text>
310
310
  </View>}
311
311
  </View>
312
- {showInput && input}
313
- {actions}
312
+ {/* The field with its Send: kept on screen together while typing (a-focused-field-and-its-send-stay-in-view). */}
313
+ <View {...PRIMARY_FORM} style={{ gap: 10 }}>
314
+ {showInput && input}
315
+ {actions}
316
+ </View>
314
317
  </SubmitScope>;
315
318
  }
316
319
  return <SubmitScope enabled={submittable} onSubmit={() => open ? quick("send") : run.mutate("send")} style={{ gap: dense ? 10 : 14 }}>
317
320
  {body}
318
- {actions}
321
+ {/* The field with its Send: kept on screen together while typing (a-focused-field-and-its-send-stay-in-view). */}
322
+ <View {...PRIMARY_FORM} style={{ gap: dense ? 10 : 14 }}>
323
+ {open && input}
324
+ {actions}
325
+ </View>
319
326
  {!dense && !compact && !inline && <Text style={t.small}>Asked {ago(q.askedAt, now)} by {who(w, q.askedBy)}{q.taskId && !q.options.length ? " (blocked task)" : ""}</Text>}
320
327
  </SubmitScope>;
321
328
  }
package/index.client.tsx CHANGED
@@ -6,6 +6,7 @@ import { openExternalUrl, type PluginClientContext, type PluginButtonRegistratio
6
6
  import { Dimensions } from "react-native";
7
7
  import { FollowSettings } from "./client/settings";
8
8
  import { FollowHome, HOME_SCREEN } from "./client/home";
9
+ import { MODE } from "./shared/catch-up";
9
10
  import { FollowPanel } from "./client/panel";
10
11
  import { createPaseoWorkspaces } from "./client/home-data";
11
12
  import { createHomeExtras } from "./client/home-view";
@@ -54,6 +55,7 @@ export default function contribute(host: PluginClientContext) {
54
55
  const openSettings = (category?: string) => { if (isCategory(category)) writeCategory(category); client.openSettings("projects"); };
55
56
  const openOverview = () => client.openScreen({ screenId: OVERVIEW });
56
57
  const openLog = () => client.openScreen({ screenId: OVERVIEW, params: { view: "log" } });
58
+ const openCatchUp = () => client.openScreen({ screenId: OVERVIEW, params: { view: "catchup", at: "0", n: String(Date.now()) } });
57
59
  const openLarge = (workspaceId: string) => client.openScreen({ screenId: LARGE_SCREEN, params: { workspaceId } });
58
60
  // "Set up Follow-up again" (Settings and ⌘K): restart the flow on the server, then open Home, which shows it.
59
61
  // `resume`: setup is already in progress, so open it where it was left instead of from the top.
@@ -91,7 +93,7 @@ export default function contribute(host: PluginClientContext) {
91
93
  noteDone: (agentId, cancel) => inbox.noteDone(agentId, cancel), endDone: agentId => inbox.endDone(agentId),
92
94
  };
93
95
  const openItem = (key: string, extra: { question?: string } = {}) => client.openScreen({ screenId: OVERVIEW, params: { item: key, ...(extra.question ? { question: extra.question } : {}) } });
94
- const homeDeps = { sources, openSettings, openPanel, openLog, openHome: openOverview, openItem, briefDeps, searchKey };
96
+ const homeDeps = { sources, openSettings, openPanel, openLog, openCatchUp, openHome: openOverview, openItem, briefDeps, searchKey };
95
97
  const Overview = (props: PluginScreenProps) => <><FollowHome {...props} deps={homeDeps} />{reportHost(props)}</>;
96
98
  const Panel = (props: PluginWorkspacePanelProps) => <><FollowPanel {...props} openSettings={openSettings} openOverview={openOverview} openLarge={openLarge} inbox={inbox} live={store} briefDeps={briefDeps} sources={sources} />{reportHost(props)}</>;
97
99
  const Large = (props: PluginScreenProps) => <FollowLarge {...props} openSettings={openSettings} openOverview={openOverview} live={store} />;
@@ -112,6 +114,7 @@ export default function contribute(host: PluginClientContext) {
112
114
  // The dialog lives in Follow-up's surfaces: open the panel, which mounts a host, then ask.
113
115
  openPanel(PANEL, { location: location() }); setTimeout(() => openRename({ workspaceId: workspace.id }), 0); } }),
114
116
  client.addCommandCenterItem({ id: "follow-up-overview", title: "Follow-up: Home", icon: "House", keywords: ["home", "workspaces", "needs you", "inbox", "attention", "brief", "overview"], context: "global", onSelect({ openScreen }) { openScreen({ screenId: OVERVIEW }); } }),
117
+ client.addCommandCenterItem({ id: "follow-up-catch-up", title: MODE.command, icon: "Layers", keywords: ["catch up", "inbox", "needs you", "triage", "answer", "questions", "one by one"], context: "global", onSelect() { openCatchUp(); } }),
115
118
  client.addCommandCenterItem({ id: "follow-up-log", title: "Follow-up: Done while you were away", icon: "History", keywords: ["log", "overnight", "away", "repairs", "activity"], context: "global", onSelect({ openScreen }) { openScreen({ screenId: OVERVIEW, params: { view: "log" } }); } }),
116
119
  client.addCommandCenterItem({ id: "follow-up-settings", title: "Follow-up: settings", icon: "Settings", keywords: ["default", "following", "project", "display", "sidebar", "pill", "header", "inbox", "questions"], context: "global", onSelect() { openSettings(); } }),
117
120
  // "Set up Follow-up again": the setup flow from the top, on Home.