paseo-follow-up 2.2.0-beta.4 → 2.2.0-beta.6

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/CHANGELOG.md CHANGED
@@ -2,6 +2,55 @@
2
2
 
3
3
  What changed in each version of Follow-up, newest first. Follow-up shows "What's new" after an update that brings new release notes: the curated part of each stable release since you last looked (betas install quietly; Settings → General can turn it off), and every version's notes from Home's version line.
4
4
 
5
+ ## 2.2.0 (2026-11-18)
6
+
7
+ Catch up walks you through everything that needs you, one card at a time.
8
+
9
+ - **Start Catch up from Home or ⌘K.** On a phone, swipe left to skip a workspace or right to go back; Skip on the bar skips one card. On desktop, use the keyboard and queue beside the card.
10
+ - **Ask for More context** right on a card. Your workspace's agent explains it, and the card comes back with the answer. More context and Later open beside the card, above the bar on a phone.
11
+ - **Write your own answer in one step:** pick Something else, type, and send. Use Add note to explain a picked option.
12
+ - **See what's new after stable updates.** Turn off Show What's new after updates in Settings → General if you prefer. Home also announces every available stable version when Updates is set to Tell me.
13
+ - **Steadier answers:** your field and Send stay above the phone keyboard, and unconfirmed messages keep checking and retrying, including answers an older version gave up on. Plus many smaller fixes.
14
+ - Follow-up has a new icon.
15
+
16
+ <details><summary>Full changelog since 2.1.0</summary>
17
+
18
+ ### Home and Needs you
19
+
20
+ - Catch up has a key for every move on desktop: A–H pick, W writes your own, ⌘↵ sends, J/K skip and go back, M asks for context, L later, O opens the chat, R the queue. S shows them all; X leaves.
21
+ - Catch up: once a question has an answer, Send to agent is on the move bar. More context and Later open right where you are, a sheet above the phone's bar or a popover on desktop, never below the card.
22
+ - Agents can ask the card's workspace main agent to explain it in plain words, and read what Catch up will show you next. The answer comes back on its own, with no waiting around.
23
+ - Catch up walks everything that needs you one card at a time, from Home's "Catch up · N" or ⌘K. Ask for more context and the deck moves on; that workspace comes back as your next card with the answer. Desktop shows the queue beside the card.
24
+ - On a phone the card follows your finger: drag left to skip the whole workspace (shown underneath), right to go back, or let go early and it springs back. Skip on the bar skips one card.
25
+ - Skip workspace, at the top right of the card beside the workspace name, skips every card of that workspace at once (Shift+J on desktop).
26
+ - More context asks the workspace's main agent, so its answer lands on the card.
27
+ - Catch up's Skip says what it skips ("Skip question", "Skip permission") and that the card comes back after the rest.
28
+ - On a phone, what you type and its Send button stay on screen. While you write an answer or a note, Sign off and the reply box step aside and the page scrolls the field above the keyboard.
29
+
30
+ ### Questions and answers
31
+
32
+ - A note on a picked option opens with Add note and says which option it goes with.
33
+ - Answers that an older version gave up on go back to checking after the update.
34
+
35
+ ### Repairs and PRs
36
+
37
+ - A message to a busy agent, or one Paseo kept refusing after a crash, now still reaches the agent: Follow-up checks the agent's chat more thoroughly and sends again when it isn't there.
38
+
39
+ ### Setup, Settings and updates
40
+
41
+ - Follow-up has a new icon.
42
+ - What's new now opens after any update that brings new release notes, not only a major one. Betas still install quietly.
43
+ - Don't want it? Turn off Show What's new after updates in Settings → General. Release notes stay one tap away.
44
+
45
+ ### Fixes
46
+
47
+ - Follow-up now sees a Graphite sign-in made with newer gt versions.
48
+ - Home now says when any new stable version is out, including minor and patch releases, if Updates is set to Tell me. Betas stay in Settings → General.
49
+ - Writing your own answer to a question is one step everywhere. Pick Something else, type, and send. The box no longer sits there as a note before you pick anything, in the panel, on Home or on a phone.
50
+ - An answer Follow-up couldn't confirm no longer ends as Failed and waits for you. It keeps checking the agent's chat and sends it again once the chat shows it never arrived.
51
+
52
+ </details>
53
+
5
54
  ## 2.1.0 (2026-11-17)
6
55
 
7
56
  Answers reach the agent even when Paseo is busy, search is one key away, and artifact links have their real names.
package/OVERVIEW.md CHANGED
@@ -36,7 +36,7 @@ This is a trusted, unsandboxed plugin. It reads workspace metadata, saved agent
36
36
 
37
37
  Follow-up reads Paseo's agent, workspace and project lists into one in-memory directory shared by discovery, runtime checks, the Needs-you inbox, the Overseer and every client RPC. It reads the lists once at start, then patches the directory from lifecycle events: turn started or ended, permission requested or resolved, agent created, closed or archived, workspace created or archived. A change marks it dirty, and a dirty directory re-reads at most once a minute; a clean one re-reads every ten minutes. Before anything that would load an agent (a timeline or provider-subagent read), Follow-up re-reads that one agent, because the cached copy may predate Paseo unloading it. Provider subagents are asked about only when a send is due or waiting for acknowledgment, or completion is being checked. The Done label is sent only when it changes. In the app, the panel, the larger view and the pill draw from the client's shared workspace poll, which runs every 15 s plus a refresh shortly after Paseo reports an agent change. The inbox runs the same way and passes the tag of the list it holds, so an unchanged list comes back empty. Display preferences re-read once a minute. None of these poll while the app is hidden.
38
38
 
39
- The PR workflow setting lives in `plugin-data/follow-up/pr-workflow.json` (owner-only): the default, per-repository overrides, merge methods and the review-fix instruction. Auto-detection reads only files: PATH for a `gt` executable, `~/.config/graphite/auth` for a sign-in token's presence (never sent anywhere by detection), and `<git dir>/.graphite_repo_config` in the checkout of the repository's Paseo project, then in the working directories of tracked workspaces with PRs in that repository (from the agent list Follow-up already has). It never runs `gt` and caches for ten minutes. Repositories that resolve to GitHub get no Graphite API calls; their readiness, merge method and auto-merge come from the same `gh api graphql` query that already reads each PR, so there is no extra polling. The first start with this setting seeds the review-fix instruction to `/fix-pr` when `~/.claude/commands/fix-pr.md` or `~/.claude/skills/fix-pr/SKILL.md` exists, once.
39
+ The PR workflow setting lives in `plugin-data/follow-up/pr-workflow.json` (owner-only): the default, per-repository overrides, merge methods and the review-fix instruction. Auto-detection reads only files: PATH for a `gt` executable, `<config>/graphite/user_config`, `<config>/graphite/auth`, then `~/.graphite_user_config` for a sign-in token's presence (`<config>` is `$XDG_CONFIG_HOME` or `~/.config`) (never sent anywhere by detection), and `<git dir>/.graphite_repo_config` in the checkout of the repository's Paseo project, then in the working directories of tracked workspaces with PRs in that repository (from the agent list Follow-up already has). It never runs `gt` and caches for ten minutes. Repositories that resolve to GitHub get no Graphite API calls; their readiness, merge method and auto-merge come from the same `gh api graphql` query that already reads each PR, so there is no extra polling. The first start with this setting seeds the review-fix instruction to `/fix-pr` when `~/.claude/commands/fix-pr.md` or `~/.claude/skills/fix-pr/SKILL.md` exists, once.
40
40
 
41
41
  Reviewer lists live in `plugin-data/follow-up/reviewers.json` (owner-only), apart from `state.json`. Each list is per repository, plus a default for repositories without one, and each user keeps their own. Collaborator and team suggestions are read with `gh api` only when you open Add reviewer. They are cached for ten minutes, and never polled.
42
42
 
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"/><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>
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="#222126"/><g transform="translate(24.8 24.8) scale(8.6)"><path d="M6.95 19.21C7.25 19.11 8.19 18.91 8.75 18.59C9.3 18.27 9.7 18 10.29 17.29C10.89 16.58 11.8 15.23 12.34 14.32C12.87 13.41 13.14 12.75 13.51 11.84C13.88 10.93 14.29 9.96 14.57 8.87C14.84 7.78 15.17 6.23 15.18 5.28C15.2 4.33 14.88 3.61 14.63 3.18C14.38 2.74 14.04 2.66 13.7 2.68C13.36 2.7 12.92 2.85 12.58 3.3C12.25 3.75 11.93 4.48 11.72 5.4C11.5 6.33 11.32 7.8 11.29 8.87C11.25 9.94 11.36 10.93 11.53 11.84C11.71 12.75 11.97 13.58 12.34 14.32C12.71 15.06 13.23 15.8 13.76 16.3C14.29 16.79 14.98 17.03 15.49 17.29C16.01 17.55 16.63 17.75 16.86 17.85" fill="none" stroke="#ffffff" stroke-width="1.42" stroke-linecap="round" stroke-linejoin="round"/><circle cx="4.85" cy="19.15" r="2.14" fill="none" stroke="#ffffff" stroke-width="1.42"/><circle cx="20.01" cy="18.03" r="1.92" fill="#B79CF0"/></g></svg>
@@ -15,7 +15,7 @@ import { age, snoozeUntil } from "../shared/inbox";
15
15
  import { laterChoices } from "../shared/row-menu";
16
16
  import { errorText } from "../shared/errors";
17
17
  import { CATCH_UP_RAIL_DEFAULT, CATCH_UP_RAIL_MAX, CATCH_UP_RAIL_MIN } from "../shared/display";
18
- import { CATCH_UP_KEYS, CONTEXT_ASKS, MODE, askHeadline, catchUpKey, keyLabel, deckCards, groupOf, nextPos, openInWorkspace, park, prevPos, skipWorkspace, swipeLock, swipeOutcome, settle as settleCard, startSession, statsOf, sync, type ContextRequest, type DeckCard, type Outcome, type Session } from "../shared/catch-up";
18
+ import { CATCH_UP_KEYS, CONTEXT_ASKS, MODE, askHeadline, catchUpKey, keyLabel, deckCards, groupOf, openInWorkspace, park, prevPos, applySwipe, skipWorkspace, swipeLock, swipeOutcome, settle as settleCard, startSession, statsOf, sync, type ContextRequest, type DeckCard, type Outcome, type Session } from "../shared/catch-up";
19
19
  import type { Workspace } from "../shared/model";
20
20
  import type { ListWorkspace } from "../shared/list";
21
21
  import { bottomInset, Button, focusSoon, IconButton, SubmitScope, text, type Theme } from "./kit";
@@ -32,6 +32,7 @@ import { mergedColor, withAlpha, tint } from "./theme";
32
32
  import { RichText } from "./rich-text";
33
33
  import { DisplaySplit, PermissionBlock, useAgentLive } from "./home";
34
34
  import { DockedPane } from "./docked-pane";
35
+ import { ownsKey, surfaceVisible } from "../shared/list-keys";
35
36
  import { useReducedMotion } from "./motion";
36
37
  import { PRIMARY_FORM } from "./dock";
37
38
 
@@ -129,23 +130,35 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
129
130
 
130
131
  // Desktop keys (CATCH_UP_KEYS, catchUpKey in shared/catch-up.ts): every move has one. The card's controls are found
131
132
  // by the names they already carry (option letters, Later (L), Open chat (O)), so a key does exactly what a click does.
133
+ // every-catch-up-key-works-wherever-focus-is: one owner for these keys whatever else is mounted. The listener is the
134
+ // window's, in the capture phase, so it runs before any document listener (Follow-up's list keys take j and k there
135
+ // and stop them); it takes a key only when focus is inside this screen, or on nothing while this screen is the one on
136
+ // view (a Catch up Paseo keeps mounted behind a tab never does), and it finds every control inside its own root.
132
137
  const [keysOpen, setKeysOpen] = useState(false);
138
+ const rootRef = useRef<View>(null);
133
139
  useEffect(() => {
134
140
  if (Platform.OS !== "web" || compact) return;
135
- type Ev = { key: string; metaKey: boolean; ctrlKey: boolean; altKey: boolean; shiftKey: boolean; isComposing: boolean; target: unknown; preventDefault(): void };
141
+ type Ev = { key: string; metaKey: boolean; ctrlKey: boolean; altKey: boolean; shiftKey: boolean; isComposing: boolean; target: unknown; preventDefault(): void; stopPropagation(): void };
136
142
  type El = { tagName?: string; isContentEditable?: boolean; click?(): void; focus?(): void; closest?(q: string): El | null };
137
- type Doc = { querySelector(q: string): El | null; querySelectorAll(q: string): ArrayLike<El>; activeElement?: El | null; addEventListener(t: string, f: (e: Ev) => void): void; removeEventListener(t: string, f: (e: Ev) => void): void };
138
- const doc = (globalThis as { document?: Doc }).document; if (!doc) return;
143
+ type Root = El & { querySelector(q: string): El | null; querySelectorAll(q: string): ArrayLike<El>; contains(n: unknown): boolean; checkVisibility?(): boolean; getClientRects?(): { length: number } };
144
+ type Doc = { body?: unknown; visibilityState?: string };
145
+ type Win = { addEventListener(t: string, f: (e: Ev) => void, capture?: boolean): void; removeEventListener(t: string, f: (e: Ev) => void, capture?: boolean): void };
146
+ const doc = (globalThis as { document?: Doc }).document; const win = globalThis as unknown as Win;
147
+ if (!doc || typeof win.addEventListener !== "function") return;
139
148
  const mac = isMac();
140
- const inCard = (q: string) => doc.querySelector(`[data-catch-up-card] ${q}`);
141
- const railItems = () => Array.from(doc.querySelectorAll("[data-catch-up-rail] [role=\"button\"]"));
149
+ const root = () => rootRef.current as unknown as Root | null;
150
+ const inCard = (q: string) => root()?.querySelector(`[data-catch-up-card] ${q}`) ?? null;
151
+ const railItems = () => Array.from(root()?.querySelectorAll("[data-catch-up-rail] [role=\"button\"]") ?? []);
142
152
  const onKey = (e: Ev) => {
143
153
  const el = e.target as El | null;
154
+ const r = root();
155
+ const onBody = !el || el === doc.body;
156
+ if (!r || !ownsKey({ inside: !!el && r.contains(el), onBody, claimBody: true, visible: onBody && surfaceVisible(r, doc) })) return;
144
157
  const typing = !!el && (el.tagName === "INPUT" || el.tagName === "TEXTAREA" || !!el.isContentEditable);
145
158
  const hit = catchUpKey({ key: e.key, meta: e.metaKey, ctrl: e.ctrlKey, alt: e.altKey, shift: e.shiftKey, composing: e.isComposing, mac },
146
159
  { typing, inMore: !!el?.closest?.("[data-catch-up-more]"), moreOpen: more, inRail: !!el?.closest?.("[data-catch-up-rail]") });
147
160
  if (!hit || finished && !["back", "keys", "leave", "rail"].includes(hit.action)) return;
148
- const click = (q: string) => { const b = doc.querySelector(q); b?.click?.(); return !!b; };
161
+ const click = (q: string) => { const b = r.querySelector(q); b?.click?.(); return !!b; };
149
162
  switch (hit.action) {
150
163
  case "skip": skip(); break;
151
164
  case "skip-workspace": if (wsLeft < 2) return; skipWs(); break;
@@ -156,16 +169,16 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
156
169
  case "pick": inCard(`[role="radio"][aria-label^="${hit.arg}. "]`)?.click?.(); break;
157
170
  case "own": inCard('[role="radio"][aria-label^="Something else"]')?.click?.(); break;
158
171
  case "send": { const b = inCard('[aria-label^="Send your"]') ?? inCard('[aria-label^="Send "]'); if (!b) return; b.click?.(); break; }
159
- case "note": { const add = inCard('[aria-label^="Add a note"]'); if (add) add.click?.(); else doc.querySelector('[aria-label="Tell the agent something"]')?.focus?.(); break; }
172
+ case "note": { const add = inCard('[aria-label^="Add a note"]'); if (add) add.click?.(); else r.querySelector('[aria-label="Tell the agent something"]')?.focus?.(); break; }
160
173
  // Its sheet or popover takes focus itself (MoveResult).
161
174
  case "later": if (!click('[aria-label="Later (L)"]')) return; break;
162
175
  case "chat": if (!click('[aria-label="Open chat (O)"]')) return; break;
163
- case "chip": doc.querySelectorAll("[data-catch-up-more] [role=\"radio\"]")[Number(hit.arg) - 1]?.click?.(); break;
176
+ case "chip": r.querySelectorAll("[data-catch-up-more] [role=\"radio\"]")[Number(hit.arg) - 1]?.click?.(); break;
164
177
  case "ask": if (!click('[data-catch-up-more] [data-ask-agent] [role="button"]')) return; break;
165
178
  case "rail": {
166
179
  const items = railItems();
167
180
  if (el?.closest?.("[data-catch-up-rail]")) { (el as { blur?(): void }).blur?.(); break; }
168
- (doc.querySelector("[data-catch-up-rail] [data-catch-up-here]") ?? items[0])?.focus?.();
181
+ (r.querySelector("[data-catch-up-rail] [data-catch-up-here]") ?? items[0])?.focus?.();
169
182
  break;
170
183
  }
171
184
  case "rail-up": case "rail-down": {
@@ -176,9 +189,11 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
176
189
  default: return;
177
190
  }
178
191
  e.preventDefault();
192
+ // Acted: nothing else handles it (a list's j/k under a document listener).
193
+ e.stopPropagation();
179
194
  };
180
- doc.addEventListener("keydown", onKey);
181
- return () => doc.removeEventListener("keydown", onKey);
195
+ win.addEventListener("keydown", onKey, true);
196
+ return () => win.removeEventListener("keydown", onKey, true);
182
197
  });
183
198
  // Phones: the card follows the finger (Paseo's sidebar drag): left skips this card, right goes Back, the card about to
184
199
  // show peeks underneath, and a drag held halfway stays there. The direction locks in the first SWIPE_LOCK_PX, so a
@@ -186,7 +201,7 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
186
201
  // no follow, just the move on release. Transforms only (translateX), on the native driver where there is one.
187
202
  const reduced = useReducedMotion();
188
203
  const drag = useRef(new Animated.Value(0)).current;
189
- const [dragDir, setDragDir] = useState<"skip" | "back" | null>(null);
204
+ const [dragDir, setDragDir] = useState<"skip-workspace" | "back" | null>(null);
190
205
  const width = useRef(390);
191
206
  const lock = useRef<"x" | "y" | null>(null);
192
207
  // The finger's own offset from where it went down: react-native-web's accumulated gestureState.dx runs ahead of a
@@ -208,17 +223,18 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
208
223
  onPanResponderTerminationRequest: () => false,
209
224
  onPanResponderMove: e => {
210
225
  const { dx } = offset(e);
211
- setDragDir(dx < 0 ? "skip" : canBack ? "back" : null);
226
+ setDragDir(dx < 0 ? "skip-workspace" : canBack ? "back" : null);
212
227
  // Nothing behind the first card: the drag resists instead of revealing an empty space.
213
228
  if (!reduced) drag.setValue(dx > 0 && !canBack ? dx * 0.25 : dx);
214
229
  },
215
230
  onPanResponderRelease: (e, g) => {
216
231
  lock.current = null;
217
232
  const out = swipeOutcome({ dx: offset(e).dx, vx: g.vx, width: width.current, canBack });
218
- const act = () => { drag.setValue(0); setDragDir(null); if (out === "skip") skip(); else if (out === "back") back(); };
233
+ // Left skips the whole workspace (Skip workspace, ⇧J); right is Back. The same applySwipe the tests run.
234
+ const act = () => { drag.setValue(0); setDragDir(null); setMore(false); setSession(s => applySwipe(s, out)); };
219
235
  if (out === "stay") { setDragDir(null); if (!reduced) Animated.spring(drag, { toValue: 0, bounciness: 0, speed: 20, useNativeDriver: Platform.OS !== "web" }).start(); else drag.setValue(0); return; }
220
236
  if (reduced) { act(); return; }
221
- Animated.timing(drag, { toValue: (out === "skip" ? -1 : 1) * width.current, duration: 160, useNativeDriver: Platform.OS !== "web" }).start(act);
237
+ Animated.timing(drag, { toValue: (out === "skip-workspace" ? -1 : 1) * width.current, duration: 160, useNativeDriver: Platform.OS !== "web" }).start(act);
222
238
  },
223
239
  onPanResponderTerminate: () => { lock.current = null; setDragDir(null); drag.setValue(0); },
224
240
  }), [compact, key, finished, canBack, reduced]); // eslint-disable-line react-hooks/exhaustive-deps
@@ -278,14 +294,17 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
278
294
  </ScrollView>;
279
295
 
280
296
  // Under the dragged card: the one the release would show, so the drag says where it goes.
281
- const peekKey = dragDir === "skip" ? session.order[nextPos(session, session.pos)] : dragDir === "back" ? session.order[prevPos(session)] : undefined;
297
+ // The peek says exactly what the release does: where Skip workspace lands (skipWorkspace itself), or Back's card.
298
+ const ahead = dragDir === "skip-workspace" ? skipWorkspace(session) : null;
299
+ const peekKey = ahead ? ahead.order[ahead.pos] : dragDir === "back" ? session.order[prevPos(session)] : undefined;
300
+ const peekWhat = dragDir === "back" ? "Back" : wsLeft > 1 ? `Skip workspace · ${wsLeft} cards` : `Skip ${card ? skipNoun(card) : "card"}`;
282
301
  const peekCard = cardOf(peekKey);
283
302
  const peek = compact && dragDir && <View accessibilityElementsHidden importantForAccessibility="no-hide-descendants" pointerEvents="none"
284
- style={{ position: "absolute", top: 0, bottom: 0, left: 0, right: 0, backgroundColor: c.surface1, justifyContent: "center", alignItems: dragDir === "skip" ? "flex-end" : "flex-start", paddingHorizontal: 20 }}>
285
- <View style={{ maxWidth: "42%", gap: 4, alignItems: dragDir === "skip" ? "flex-end" : "flex-start" }}>
286
- <Icon name={dragDir === "skip" ? "ArrowRight" : "ChevronLeft"} size={18} color={c.foregroundMuted} />
287
- <Text style={[t.small, { fontWeight: "600" }]}>{dragDir === "skip" ? `Skip ${card ? skipNoun(card) : "card"}` : "Back"}</Text>
288
- <Text numberOfLines={2} style={[t.meta, { textAlign: dragDir === "skip" ? "right" : "left" }]}>{peekCard ? `${peekCard.s.title} · ${cardLabel(peekCard, peekCard.s.workspaceId ? live.get(peekCard.s.workspaceId) : undefined)}` : MODE.endOfDeck}</Text>
303
+ style={{ position: "absolute", top: 0, bottom: 0, left: 0, right: 0, backgroundColor: c.surface1, justifyContent: "center", alignItems: dragDir === "skip-workspace" ? "flex-end" : "flex-start", paddingHorizontal: 20 }}>
304
+ <View style={{ maxWidth: "42%", gap: 4, alignItems: dragDir === "skip-workspace" ? "flex-end" : "flex-start" }}>
305
+ <Icon name={dragDir === "back" ? "ChevronLeft" : wsLeft > 1 ? "ChevronsRight" : "ArrowRight"} size={18} color={c.foregroundMuted} />
306
+ <Text style={[t.small, { fontWeight: "600" }]}>{peekWhat}</Text>
307
+ <Text numberOfLines={2} style={[t.meta, { textAlign: dragDir === "skip-workspace" ? "right" : "left" }]}>{peekCard ? `${peekCard.s.title} · ${cardLabel(peekCard, peekCard.s.workspaceId ? live.get(peekCard.s.workspaceId) : undefined)}` : MODE.endOfDeck}</Text>
289
308
  </View>
290
309
  </View>;
291
310
  const main = <View style={{ flex: 1, minWidth: 0, overflow: "hidden" }} onLayout={e => { width.current = e.nativeEvent.layout.width; }} {...pan.panHandlers}>
@@ -293,7 +312,7 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
293
312
  <Animated.View {...({ dataSet: { catchUpDrag: "1" } } as object)} style={{ flex: 1, backgroundColor: c.surface0, transform: [{ translateX: drag }],
294
313
  ...(dragDir ? { shadowColor: "#000", shadowOpacity: 0.18, shadowRadius: 12, shadowOffset: { width: 0, height: 0 } } : {}) }}>{body}</Animated.View>
295
314
  </View>;
296
- return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
315
+ return <View ref={rootRef} {...({ dataSet: { catchUpRoot: "1" } } as object)} style={{ flex: 1, backgroundColor: c.surface0 }}>
297
316
  {progress}
298
317
  <View style={{ flex: 1, borderTopWidth: 1, borderTopColor: c.border }}>
299
318
  {/* Desktop: the queue rail beside the card, resizable (side-panes-are-resizable); its width is the Display field catch_up_rail_fraction. */}
@@ -335,7 +354,16 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
335
354
  {sameWorkspace.length > 1 ? ` · ${nth + 1} of ${sameWorkspace.length} here` : ""}
336
355
  </Text>
337
356
  </View>
338
- <Text accessibilityRole="header" numberOfLines={2} style={compact ? t.title : [t.title, { fontSize: 17, lineHeight: 23 }]}>{s.title}{s.agent ? <Text style={{ color: c.foregroundMuted, fontWeight: "400" }}>{` › ${s.agent}`}</Text> : null}</Text>
357
+ {/* Skip workspace sits on the line of the workspace it skips, top right, the same place on phone and desktop (Tom,
358
+ beta.4: "maybe put the skip workspace button at the top right?"). Only while more than one card is left; the meta
359
+ line's "1 of 2 here" gives the count, and its accessible name says it. Negative margins keep its 44 px target
360
+ from pushing the title line apart. */}
361
+ <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
362
+ <Text accessibilityRole="header" numberOfLines={2} style={[compact ? t.title : [t.title, { fontSize: 17, lineHeight: 23 }], { flex: 1 }]}>{s.title}{s.agent ? <Text style={{ color: c.foregroundMuted, fontWeight: "400" }}>{` › ${s.agent}`}</Text> : null}</Text>
363
+ {onSkipWorkspace && <View style={{ marginVertical: compact ? -10 : -6, marginRight: compact ? -14 : -11 }}>
364
+ <Tip label={`${skipWorkspaceHint(wsLeft)} (⇧J)`}><Button theme={theme} compact={compact} kind="ghost" icon="ChevronsRight" title="Skip workspace" accessibilityLabel={skipWorkspaceHint(wsLeft)} accessibilityHint={compact ? undefined : "Shift+J"} onPress={onSkipWorkspace} /></Tip>
365
+ </View>}
366
+ </View>
339
367
  {ws && <SummaryLine key={ws.id} workspace={ws} theme={theme} compact={compact} />}
340
368
  {full && <ReferencesLine workspace={full} theme={theme} compact={compact} />}
341
369
  </View>;
@@ -399,7 +427,6 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
399
427
  {compact ? ready ? <IconButton theme={theme} compact icon="ArrowRight" label={skipCardHint(noun)} onPress={onSkip} />
400
428
  : <View style={{ flex: 1 }}><Button theme={theme} compact grow icon="ArrowRight" title={`Skip ${noun}`} accessibilityLabel={skipCardHint(noun)} onPress={onSkip} /></View>
401
429
  : <>
402
- {onSkipWorkspace && <Tip label={`${skipWorkspaceHint(wsLeft)} (⇧J)`}><Button theme={theme} kind="ghost" icon="ChevronsRight" title="Skip workspace" accessibilityLabel={skipWorkspaceHint(wsLeft)} accessibilityHint="Shift+J" onPress={onSkipWorkspace} /></Tip>}
403
430
  <Tip label={`${skipCardHint(noun)} (J or →)`}><Button theme={theme} icon="ArrowRight" title={`Skip ${noun}`} accessibilityLabel={skipCardHint(noun)} accessibilityHint="J" onPress={onSkip} /></Tip>
404
431
  </>}
405
432
  {send}
@@ -413,9 +440,6 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
413
440
  contentContainerStyle={{ padding: compact ? 16 : 28, gap: compact ? 16 : 18, ...(compact ? {} : { maxWidth: 720, width: "100%", alignSelf: "center" }) }}
414
441
  dock={({ yields, typingInContent }) => compact && (sheet && !typingInContent || !yields) && <View style={[{ borderTopWidth: 1, borderTopColor: c.border, backgroundColor: c.surface0 }, bottomInset(compact)]}>
415
442
  {sheet && !typingInContent && <MoveResult place="sheet" theme={theme} label={moreBlock ? "More context" : "Later"}>{sheet}</MoveResult>}
416
- {!yields && !sheet && onSkipWorkspace && <View style={{ flexDirection: "row", justifyContent: "flex-end", paddingHorizontal: 12, paddingTop: 6 }}>
417
- <Button theme={theme} compact kind="ghost" icon="ChevronsRight" title={`Skip workspace · ${wsLeft} cards`} accessibilityLabel={skipWorkspaceHint(wsLeft)} onPress={onSkipWorkspace} />
418
- </View>}
419
443
  {!yields && moves}
420
444
  </View>}>
421
445
  {goneBanner}
@@ -432,7 +456,7 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
432
456
  * Where a move's result opens (MOVE_OPENS, a-move-bar-action-opens-in-view): a sheet in the phone's dock or a popover
433
457
  * on its desktop button. Focus moves into it (its first choice), and on the web it scrolls into view the least distance.
434
458
  */
435
- function MoveResult({ place, theme, label, width, children }: { place: "sheet" | "popover"; theme: Theme; label: string; width?: number; children: ReactNode }) {
459
+ export function MoveResult({ place, theme, label, width, children }: { place: "sheet" | "popover"; theme: Theme; label: string; width?: number; children: ReactNode }) {
436
460
  const c = theme.colors;
437
461
  const ref = useRef<View>(null);
438
462
  useEffect(() => {
@@ -445,7 +469,7 @@ function MoveResult({ place, theme, label, width, children }: { place: "sheet" |
445
469
  }, 0);
446
470
  return () => clearTimeout(t);
447
471
  }, []);
448
- return <View ref={ref} {...({ dataSet: { moveResult: place } } as object)} accessibilityRole={"dialog" as never} accessibilityLabel={label}
472
+ return <View ref={ref} {...({ dataSet: { moveResult: place } } as object)} role="dialog" accessibilityLabel={label}
449
473
  style={[{ padding: place === "sheet" ? 14 : 16, borderRadius: 12, borderWidth: 1, borderColor: c.border, backgroundColor: c.surface1 },
450
474
  place === "sheet"
451
475
  ? { marginHorizontal: 12, marginTop: 12 }
@@ -455,7 +479,7 @@ function MoveResult({ place, theme, label, width, children }: { place: "sheet" |
455
479
  }
456
480
 
457
481
  /** What came back for this card: the answer, "answered in its chat", a failure, or (seen going Back) that it's still asking. */
458
- function ContextAnswer({ theme, compact, request, waiting, agent, openChat, openAgent }: { theme: Theme; compact: boolean; request: ContextRequest; waiting: boolean; agent: string; openChat: () => void; openAgent?: (agentId: string) => void }) {
482
+ export function ContextAnswer({ theme, compact, request, waiting, agent, openChat, openAgent }: { theme: Theme; compact: boolean; request: ContextRequest; waiting: boolean; agent: string; openChat: () => void; openAgent?: (agentId: string) => void }) {
459
483
  const c = theme.colors; const t = text(c, compact);
460
484
  const who = request.target === "overseer" ? "Overseer" : agent === "the agent" ? "The agent" : agent;
461
485
  const asking = request.state === "asking";
@@ -497,7 +521,7 @@ function BriefAsk({ s, theme, compact, deps }: { s: DeckCard["s"]; theme: Theme;
497
521
  * the card's workspace's main agent, the one that can answer on the card (an-ask-goes-only-to-an-agent-that-can-answer-
498
522
  * it). It may wake, because the developer asked. The deck moves on and this workspace comes back when the answer is ready.
499
523
  */
500
- function MorePanel({ theme, compact, onClose, onAsk }: { theme: Theme; compact: boolean; onClose: () => void; onAsk: (words: string) => Promise<void> }) {
524
+ export function MorePanel({ theme, compact, onClose, onAsk }: { theme: Theme; compact: boolean; onClose: () => void; onAsk: (words: string) => Promise<void> }) {
501
525
  const c = theme.colors; const t = text(c, compact);
502
526
  const [words, setWords] = useState<string>(CONTEXT_ASKS[0].text);
503
527
  const [picked, setPicked] = useState<string>(CONTEXT_ASKS[0].id);
@@ -535,7 +559,7 @@ function MorePanel({ theme, compact, onClose, onAsk }: { theme: Theme; compact:
535
559
  </View>;
536
560
  }
537
561
 
538
- function Finished({ theme, compact, stats, empty, onHome, onSkipped }: { theme: Theme; compact: boolean; stats: ReturnType<typeof statsOf>; empty: boolean; onHome: () => void; onSkipped: () => void }) {
562
+ export function Finished({ theme, compact, stats, empty, onHome, onSkipped }: { theme: Theme; compact: boolean; stats: ReturnType<typeof statsOf>; empty: boolean; onHome: () => void; onSkipped: () => void }) {
539
563
  const c = theme.colors; const t = text(c, compact);
540
564
  // "All caught up" only when it is true: a skipped or waiting card means the developer is not, so the end says so.
541
565
  const caughtUp = !stats.skipped && !stats.waiting;
@@ -567,7 +591,7 @@ export function KeysSheet({ theme, onClose }: { theme: Theme; onClose: () => voi
567
591
  const section = (title: string, keys: readonly typeof CATCH_UP_KEYS[number][]) => <View style={{ gap: 6 }}>
568
592
  <Text style={[t.small, { fontWeight: "600" }]}>{title}</Text>{keys.map(row)}
569
593
  </View>;
570
- return <View accessibilityRole={"dialog" as never} accessibilityLabel="Catch up keys" style={{ position: "absolute", zIndex: 10, right: 20, top: 8, width: 300, padding: 16, gap: 12, borderRadius: 10, borderWidth: 1, borderColor: c.border, backgroundColor: c.surface1, shadowColor: "#000", shadowOpacity: 0.25, shadowRadius: 12 }}>
594
+ return <View role="dialog" accessibilityLabel="Catch up keys" style={{ position: "absolute", zIndex: 10, right: 20, top: 8, width: 300, padding: 16, gap: 12, borderRadius: 10, borderWidth: 1, borderColor: c.border, backgroundColor: c.surface1, shadowColor: "#000", shadowOpacity: 0.25, shadowRadius: 12 }}>
571
595
  <View style={{ flexDirection: "row", alignItems: "center" }}>
572
596
  <Text style={[t.label, { flex: 1, fontWeight: "600" }]}>Keys</Text>
573
597
  <IconButton theme={theme} compact={false} icon="X" label="Close the keys (S)" tooltip onPress={onClose} />
@@ -1,18 +1,18 @@
1
1
  import type { PluginSvgIcon } from "@getpaseo/plugin/client";
2
2
 
3
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).
4
+ * Follow-up's own mark: a cursive l that runs on from a start ring to a filled dot (the work, followed until it's done).
5
5
  * One 24-unit glyph in `currentColor`, so the host `Icon` colours it with the theme. It is the brand icon on every
6
6
  * surface that stands for Follow-up itself (sidebar row, header button, panel tab, Settings, the open command, the
7
7
  * large view's empty state). Pull requests keep lucide GitPullRequest. assets/icon.svg is the same mark on the app tile.
8
8
  * tests/follow-up-icon.test.ts checks it with the SDK's validator and that no brand surface falls back to GitPullRequest.
9
9
  */
10
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>`,
11
+ svg: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.95 19.21C7.25 19.11 8.19 18.91 8.75 18.59C9.3 18.27 9.7 18 10.29 17.29C10.89 16.58 11.8 15.23 12.34 14.32C12.87 13.41 13.14 12.75 13.51 11.84C13.88 10.93 14.29 9.96 14.57 8.87C14.84 7.78 15.17 6.23 15.18 5.28C15.2 4.33 14.88 3.61 14.63 3.18C14.38 2.74 14.04 2.66 13.7 2.68C13.36 2.7 12.92 2.85 12.58 3.3C12.25 3.75 11.93 4.48 11.72 5.4C11.5 6.33 11.32 7.8 11.29 8.87C11.25 9.94 11.36 10.93 11.53 11.84C11.71 12.75 11.97 13.58 12.34 14.32C12.71 15.06 13.23 15.8 13.76 16.3C14.29 16.79 14.98 17.03 15.49 17.29C16.01 17.55 16.63 17.75 16.86 17.85" fill="none" stroke="currentColor" stroke-width="1.42" stroke-linecap="round" stroke-linejoin="round"/><circle cx="4.85" cy="19.15" r="2.14" fill="none" stroke="currentColor" stroke-width="1.42"/><circle cx="20.01" cy="18.03" r="1.92" fill="currentColor"/></svg>`,
12
12
  };
13
13
 
14
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 };
15
+ export const FOLLOW_UP_DOT = { x: 20.01 / 24, y: 18.03 / 24 };
16
16
 
17
17
  /** The header button's Needs-you dot, in px. */
18
18
  export const NEED_DOT = 7;
@@ -139,11 +139,12 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
139
139
  const draft = answerDraft(q, { choice, words, noteOpen });
140
140
  const other = draft.own;
141
141
  const answer = draft.answer;
142
- const note = draft.note;
142
+ // What Send sends with the answer: Something else's words or a pick's note, from the draft (what-you-typed-is-what-gets-sent).
143
+ const sentWords = draft.words;
143
144
  const run = useMutation({
144
145
  mutationFn: async (action: "send" | "copy" | "resend") => {
145
- if (action === "copy") await copyText(answerMessage(q, q.answer?.choice ?? answer!, q.answer?.words ?? note));
146
- return answerRpc({ workspaceId: w.id, questionId: q.id, choice: q.answer?.choice ?? answer!, words: q.answer?.words ?? note, action });
146
+ if (action === "copy") await copyText(answerMessage(q, q.answer?.choice ?? answer!, q.answer?.words ?? sentWords));
147
+ return answerRpc({ workspaceId: w.id, questionId: q.id, choice: q.answer?.choice ?? answer!, words: q.answer?.words ?? sentWords, action });
147
148
  },
148
149
  onSuccess: (result, action) => {
149
150
  const d = result.question.answer?.delivery;
@@ -165,7 +166,7 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
165
166
  */
166
167
  const putIn = () => {
167
168
  if (!answer || !composer) return;
168
- const message = answerMessage(q, answer, note);
169
+ const message = answerMessage(q, answer, sentWords);
169
170
  onClose?.();
170
171
  void putInChatOrCopy(composer, message, {
171
172
  inChat: () => quick("chat"),
@@ -174,9 +175,10 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
174
175
  };
175
176
  const quick = (action: "send" | "copy" | "chat") => {
176
177
  if (!answer) return;
177
- const input = { workspaceId: w.id, questionId: q.id, choice: answer, words: note, action };
178
- if (action === "copy") void copyText(answerMessage(q, answer, note)).catch(() => undefined);
179
- setPendingAnswer(w.id, q.id, { choice: answer, words: other ? words.trim() : note });
178
+ const input = { workspaceId: w.id, questionId: q.id, choice: answer, words: sentWords, action };
179
+ if (action === "copy") void copyText(answerMessage(q, answer, sentWords)).catch(() => undefined);
180
+ // The unsent copy keeps exactly what was sent, so Retry (which rebuilds the draft from it) sends it again.
181
+ setPendingAnswer(w.id, q.id, { choice: answer, words: sentWords });
180
182
  const agent = who(w, q.askedBy);
181
183
  void runAction({
182
184
  label: `Answer to ${q.id}`, toast, run: () => answerRpc(input),
Binary file
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "paseo-follow-up",
3
3
  "private": false,
4
- "version": "2.2.0-beta.4",
4
+ "version": "2.2.0-beta.6",
5
5
  "description": "A Paseo plugin that follows every workspace until the work is done: one Home for what needs you, questions you answer anywhere, and repairs that send themselves.",
6
6
  "type": "module",
7
7
  "files": [
@@ -53,6 +53,7 @@
53
53
  "@types/react": "~19.2.0",
54
54
  "react": "19.1.0",
55
55
  "react-native": "0.81.5",
56
+ "react-test-renderer": "19.1.0",
56
57
  "tsx": "^4.20.0",
57
58
  "typescript": "^5.9.3",
58
59
  "zod": "^4.4.3"
@@ -14,10 +14,22 @@ export function mergeScheduling(status: unknown): Scheduling {
14
14
  export class GraphiteWriteError extends Error {
15
15
  constructor(message: string, readonly uncertain: boolean) { super(message); }
16
16
  }
17
+ /** Shared by sign-in detection and API requests. Never surface config contents or parse errors. */
18
+ export async function graphiteAuthToken(environment: NodeJS.ProcessEnv = process.env): Promise<string | null> {
19
+ const home = environment.HOME ?? homedir();
20
+ const config = environment.XDG_CONFIG_HOME ?? join(home, ".config");
21
+ for (const path of [join(config, "graphite", "user_config"), join(config, "graphite", "auth"), join(home, ".graphite_user_config")]) {
22
+ try {
23
+ const authToken: unknown = JSON.parse(await readFile(path, "utf8"))?.authToken;
24
+ if (typeof authToken === "string" && authToken.length > 0) return authToken;
25
+ } catch { /* Missing, unreadable or invalid files don't prevent checking older locations. */ }
26
+ }
27
+ return null;
28
+ }
29
+
17
30
  async function requestGraphite(route: "mergeability-status" | "merge", body: Record<string, unknown>): Promise<unknown> {
18
- const config = process.env.XDG_CONFIG_HOME ?? join(homedir(), ".config");
19
- const { authToken } = await readFile(join(config, "graphite", "auth"), "utf8").then(s => JSON.parse(s)).catch(() => { throw new GraphiteWriteError("Graphite CLI authentication is unavailable.", false); });
20
- if (typeof authToken !== "string" || !authToken) throw new GraphiteWriteError("Graphite authentication unavailable.", false);
31
+ const authToken = await graphiteAuthToken();
32
+ if (!authToken) throw new GraphiteWriteError("Graphite CLI authentication is unavailable.", false);
21
33
  const controller = new AbortController();
22
34
  const timeout = setTimeout(() => controller.abort(), 8_000);
23
35
  try {
@@ -1,6 +1,7 @@
1
1
  import { access, constants, readFile, stat } from "node:fs/promises";
2
2
  import { delimiter, isAbsolute, join, resolve } from "node:path";
3
3
  import { homedir } from "node:os";
4
+ import { graphiteAuthToken } from "./graphite";
4
5
  import { WriteBehind } from "./write-behind";
5
6
  import { repoKey } from "../shared/reviewers";
6
7
  import {
@@ -26,9 +27,7 @@ export const fsProbe = (environment: NodeJS.ProcessEnv = process.env): Probe =>
26
27
  return false;
27
28
  },
28
29
  async signedIn() {
29
- const config = environment.XDG_CONFIG_HOME ?? join(environment.HOME ?? homedir(), ".config");
30
- try { const { authToken } = JSON.parse(await readFile(join(config, "graphite", "auth"), "utf8")); return typeof authToken === "string" && authToken.length > 0; }
31
- catch { return false; }
30
+ return (await graphiteAuthToken(environment)) !== null;
32
31
  },
33
32
  async initialised(path) {
34
33
  const common = await gitCommonDir(path);
@@ -124,17 +124,24 @@ export function swipeLock(dx: number, dy: number): "x" | "y" | null {
124
124
  }
125
125
  /**
126
126
  * A released drag: past `SWIPE_COMMIT` of the card's width, or flung faster than `SWIPE_FLING` px/ms the same way, left
127
- * skips the card and right goes Back (when there is a card to go back to); anything else springs back.
127
+ * skips the workspace and right goes Back (when there is a card to go back to); anything else springs back. Left is the
128
+ * workspace, not the card (Tom, 2.2.0-beta.4: "it makes more sense for the drag left to skip the whole workspace"); the
129
+ * bar's Skip stays the way to skip one card. With one card left in the workspace the two are the same.
128
130
  */
129
131
  export const SWIPE_COMMIT = 0.35;
130
132
  export const SWIPE_FLING = 0.5;
131
- export function swipeOutcome(g: { dx: number; vx: number; width: number; canBack: boolean }): "skip" | "back" | "stay" {
133
+ export type SwipeOutcome = "skip-workspace" | "back" | "stay";
134
+ export function swipeOutcome(g: { dx: number; vx: number; width: number; canBack: boolean }): SwipeOutcome {
132
135
  const far = Math.abs(g.dx) > SWIPE_COMMIT * g.width;
133
136
  const fling = Math.abs(g.vx) > SWIPE_FLING && Math.sign(g.vx) === Math.sign(g.dx);
134
137
  if (!far && !fling) return "stay";
135
- if (g.dx < 0) return "skip";
138
+ if (g.dx < 0) return "skip-workspace";
136
139
  return g.canBack && g.dx > 0 ? "back" : "stay";
137
140
  }
141
+ /** What a released drag does to the session: the screen and the tests run this one function. */
142
+ export function applySwipe(s: Session, out: SwipeOutcome): Session {
143
+ return out === "skip-workspace" ? skipWorkspace(s) : out === "back" ? { ...s, pos: prevPos(s) } : s;
144
+ }
138
145
 
139
146
  /** Records what happened to the card on screen and moves on. */
140
147
  export function settle(s: Session, outcome: Outcome, key = s.order[s.pos]): Session {
@@ -139,8 +139,12 @@ export type AnswerDraft = {
139
139
  own: boolean;
140
140
  /** What Send records: a letter, OTHER, the free answer, or null while Send can't send yet. */
141
141
  answer: string | null;
142
- /** Words sent with a lettered pick. */
143
- note?: string;
142
+ /**
143
+ * The words Send sends with `answer`, whatever the field's role: Something else's answer, or a lettered pick's
144
+ * note (undefined with none, and for a free answer, which is `answer` itself). Every send, Retry, Copy and Put in
145
+ * chat reads it, so what the developer typed is what reaches the agent (what-you-typed-is-what-gets-sent).
146
+ */
147
+ words: string | undefined;
144
148
  placeholder: string;
145
149
  /** The field's visible label, which stays once the placeholder is gone. */
146
150
  heading: string | null;
@@ -154,13 +158,13 @@ export type AnswerDraft = {
154
158
  };
155
159
  export function answerDraft(q: { id: string; options: readonly { letter?: string; label?: string }[] }, s: { choice: string | null; words: string; noteOpen: boolean }): AnswerDraft {
156
160
  const words = s.words.trim();
157
- if (!q.options.length) return { field: "answer", own: false, answer: words || null, placeholder: "Your answer", heading: null, label: `Your answer to ${q.id}`, hint: null, canAddNote: false, canRemoveNote: false };
161
+ if (!q.options.length) return { field: "answer", own: false, answer: words || null, words: undefined, placeholder: "Your answer", heading: null, label: `Your answer to ${q.id}`, hint: null, canAddNote: false, canRemoveNote: false };
158
162
  const own = isOther(s.choice) || (!s.choice && !!words);
159
- if (own) return { field: "answer", own, answer: words ? OTHER : null, placeholder: "Your answer (required)", heading: "Your answer", label: `Your answer to ${q.id}, required`, hint: words ? null : OWN_ANSWER_HINT, canAddNote: false, canRemoveNote: false };
163
+ if (own) return { field: "answer", own, answer: words ? OTHER : null, words: words || undefined, placeholder: "Your answer (required)", heading: "Your answer", label: `Your answer to ${q.id}, required`, hint: words ? null : OWN_ANSWER_HINT, canAddNote: false, canRemoveNote: false };
160
164
  // A lettered pick: the field is a note, shown once asked for (or once it holds words, e.g. Something else's words
161
165
  // kept when the developer picks a letter after all, so they read as the note they now are).
162
166
  const field = s.choice && (s.noteOpen || !!words) ? "note" as const : null;
163
- return { field, own, answer: s.choice, note: field && words ? words : undefined, placeholder: "Add a note for the agent (optional)", heading: s.choice ? noteHeading(q, s.choice) : null,
167
+ return { field, own, answer: s.choice, words: field && words ? words : undefined, placeholder: "Add a note for the agent (optional)", heading: s.choice ? noteHeading(q, s.choice) : null,
164
168
  label: `Note for the agent, sent with ${s.choice} on ${q.id}, optional`, hint: s.choice ? null : PICK_HINT, canAddNote: !!s.choice && !field, canRemoveNote: field === "note" };
165
169
  }
166
170
  /** "Note, sent with A · The English text": the option by name too, since it may have scrolled out of view. */