paseo-follow-up 2.6.0 → 2.7.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -17
- package/client/about.tsx +8 -2
- package/client/agents.tsx +1 -1
- package/client/brief-since.tsx +13 -7
- package/client/brief.tsx +61 -39
- package/client/button-visibility.ts +7 -3
- package/client/card-data.ts +24 -2
- package/client/catch-up.tsx +13 -10
- package/client/chat.tsx +15 -4
- package/client/created.tsx +15 -34
- package/client/daily-brief.tsx +83 -0
- package/client/dismiss.tsx +21 -6
- package/client/display.tsx +64 -38
- package/client/floating-surface.tsx +2 -1
- package/client/home-chrome.tsx +33 -9
- package/client/home-data.ts +18 -4
- package/client/home-list.tsx +80 -25
- package/client/home-view.ts +38 -3
- package/client/home.tsx +77 -48
- package/client/i18n.tsx +45 -0
- package/client/inbox-store.ts +34 -4
- package/client/inbox.tsx +19 -5
- package/client/install-scope.ts +80 -0
- package/client/job-rows.tsx +11 -4
- package/client/kit.tsx +11 -4
- package/client/last-known.ts +70 -0
- package/client/live.tsx +29 -14
- package/client/moments.tsx +66 -0
- package/client/more-context.tsx +19 -3
- package/client/motion.tsx +25 -2
- package/client/move-testids.ts +6 -0
- package/client/needs-you.tsx +15 -10
- package/client/onboarding-read.ts +12 -0
- package/client/onboarding.tsx +97 -152
- package/client/panel.tsx +37 -1
- package/client/pending-removals.ts +45 -0
- package/client/pill.tsx +16 -11
- package/client/pr-controls.tsx +6 -1
- package/client/pr-sheet.tsx +72 -3
- package/client/question-context.tsx +30 -18
- package/client/question-draft.ts +117 -0
- package/client/questions.tsx +193 -81
- package/client/release-notes.tsx +8 -7
- package/client/review-mode.tsx +2 -2
- package/client/row-actions.ts +30 -8
- package/client/row-chips.tsx +246 -0
- package/client/search-focus.ts +24 -4
- package/client/search-key.ts +8 -4
- package/client/settings.tsx +3 -3
- package/client/setup-gate.tsx +28 -4
- package/client/setup-ui.ts +10 -3
- package/client/shipping.tsx +23 -6
- package/client/shown-cards.tsx +18 -10
- package/client/sidebar-view.tsx +19 -4
- package/client/stacks.tsx +2 -1
- package/client/timeline-card.tsx +54 -0
- package/client/toast-store.ts +22 -7
- package/client/toasts.tsx +2 -2
- package/client/turn-view.tsx +68 -10
- package/client/updates.tsx +2 -0
- package/client/view-at.ts +19 -0
- package/client/view-r-header.tsx +155 -0
- package/client/view-r.tsx +715 -0
- package/client/workspace-data.ts +7 -1
- package/index.client.tsx +42 -7
- package/index.server.ts +117 -31
- package/package.json +2 -1
- package/scripts/inline.mjs +22 -8
- package/server/about.ts +30 -4
- package/server/agent-actions.ts +71 -18
- package/server/agent-hook.mjs +24 -6
- package/server/agent-hooks.ts +29 -0
- package/server/agent-parity.ts +7 -3
- package/server/ai-jobs.ts +44 -10
- package/server/ask.ts +2 -2
- package/server/brief-sources.ts +5 -5
- package/server/brief-timeline.ts +9 -1
- package/server/compass.ts +4 -1
- package/server/daemon-endpoint/index.d.mts +24 -0
- package/server/daemon-endpoint/index.mjs +145 -0
- package/{shared → server}/daemon-url.d.mts +3 -1
- package/server/daemon-url.mjs +48 -0
- package/server/daemon.ts +5 -4
- package/server/discovery.ts +3 -3
- package/server/engine.ts +57 -8
- package/server/github.ts +7 -3
- package/server/hook-source.ts +72 -35
- package/server/inbox.ts +65 -6
- package/server/mcp-source.ts +252 -81
- package/server/mcp.mjs +33 -36
- package/server/message-queue.ts +5 -0
- package/server/onboarding.ts +16 -3
- package/server/pr-actions.ts +3 -0
- package/server/pr-workflow.ts +9 -6
- package/server/ranker.ts +29 -8
- package/server/rename.ts +1 -1
- package/server/tasks.ts +17 -4
- package/server/turn-end.ts +17 -0
- package/server/turn-events.ts +2 -2
- package/server/turn-usage.ts +47 -0
- package/server/update-watchdog-source.ts +174 -18
- package/server/update-watchdog.mjs +3 -2
- package/server/usage-record.ts +69 -0
- package/server/wait-jobs.ts +11 -8
- package/shared/about.ts +2 -1
- package/shared/agent-settings.ts +10 -1
- package/shared/agent-text.d.mts +5 -1
- package/shared/agent-text.mjs +48 -29
- package/shared/attention.ts +29 -19
- package/shared/brief-sources.ts +6 -3
- package/shared/brief.ts +35 -4
- package/shared/catch-up.ts +6 -0
- package/shared/chat.ts +30 -22
- package/shared/contracts.ts +24 -6
- package/shared/daily-brief.ts +184 -0
- package/shared/display.ts +34 -2
- package/shared/errors.ts +3 -1
- package/shared/headline.ts +6 -2
- package/shared/home.ts +70 -12
- package/shared/i18n.ts +224 -0
- package/shared/inbox.ts +46 -5
- package/shared/job-rows.ts +7 -4
- package/shared/last-known.ts +63 -0
- package/shared/model.ts +28 -1
- package/shared/moments.ts +166 -0
- package/shared/onboarding.ts +77 -67
- package/shared/optimistic-removals.ts +145 -0
- package/shared/peek.ts +26 -1
- package/shared/pr-workflow.ts +64 -4
- package/shared/question-draft.ts +60 -0
- package/shared/questions.ts +21 -1
- package/shared/row-chips.ts +167 -0
- package/shared/row-menu.ts +26 -13
- package/shared/search-focus.ts +34 -2
- package/shared/search-key.ts +10 -0
- package/shared/send-decision.ts +32 -2
- package/shared/settings-nav.ts +1 -1
- package/shared/settings.ts +11 -0
- package/shared/setup-popup.ts +10 -3
- package/shared/spin.ts +17 -0
- package/shared/status-invariants.ts +187 -5
- package/shared/status.ts +21 -4
- package/shared/task-status.ts +23 -1
- package/shared/task-view.ts +1 -1
- package/shared/usage-record.ts +84 -0
- package/shared/view-r.ts +173 -0
- package/client/card-store.ts +0 -21
- package/shared/daemon-url.mjs +0 -39
package/client/home-list.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { NEW_NAME } from "../shared/new-name";
|
|
|
3
3
|
import { View, type FlatList as NativeFlatList } from "react-native";
|
|
4
4
|
import { Pressable, Text } from "./text";
|
|
5
5
|
import { Icon, FlatList } from "@getpaseo/plugin/client/ui";
|
|
6
|
-
import { type Badge, type HomeGroupId, type HomeModel, type Workstream, blocksOn, lineBasis, lineWidth, prChipSpoken, railChips, railKeeps } from "../shared/home";
|
|
6
|
+
import { type Badge, type HomeGroupId, type HomeModel, type Workstream, blocksOn, lineBasis, lineWidth, prChipSpoken, railChips, railKeeps, runningMark } from "../shared/home";
|
|
7
7
|
import { ASK_KEY, excerpt, FIELD_LABEL, type OmniboxItem, type Range, type RowHit, type SearchHit, sameHit } from "../shared/search";
|
|
8
8
|
import { AskRow, PriorityLine } from "./home-chrome";
|
|
9
9
|
import { age, wakeLabel, wakeShort } from "../shared/inbox";
|
|
@@ -15,6 +15,9 @@ import { Spinner } from "./motion";
|
|
|
15
15
|
import { Button, focusRing, rowDomId, type Theme } from "./kit";
|
|
16
16
|
import { useListKeys } from "./list-keys";
|
|
17
17
|
import { bindRowDoubleClick, useRowOpen } from "./row-open";
|
|
18
|
+
import { ChipLine, heldKey, isHeld, useHeldVersion, type ChipRow } from "./row-chips";
|
|
19
|
+
import { keepInPlace } from "../shared/keep-in-place";
|
|
20
|
+
import type { RowChip } from "../shared/row-chips";
|
|
18
21
|
import { walkOrder } from "../shared/list-keys";
|
|
19
22
|
import { BRIEF_KEY, OVERSEER_KEY, QUIET_PAGE, listEntries, type Entry } from "../shared/list-entries";
|
|
20
23
|
import { RowMenu, useRowMenuTrigger, type OpenRowMenu, type RowMenuOpen } from "./row-menu";
|
|
@@ -22,7 +25,7 @@ import type { RowMenuItem, RowMenuSection } from "../shared/row-menu";
|
|
|
22
25
|
import { homeGroupOpen, writeHomeGroupOpen } from "../shared/settings-nav";
|
|
23
26
|
import { useViewVersion } from "./view-store";
|
|
24
27
|
import { usePeekLine } from "./turn-view";
|
|
25
|
-
import { linePress } from "../shared/peek";
|
|
28
|
+
import { linePress, questionPeekId } from "../shared/peek";
|
|
26
29
|
import { DEFAULT_HOME_VIEW, rowTitle, type ArrangedHome, type HomeView } from "../shared/home-arrange";
|
|
27
30
|
import type { PaseoWorkspaceLite } from "../shared/home";
|
|
28
31
|
|
|
@@ -103,6 +106,8 @@ export type HomeListProps = {
|
|
|
103
106
|
keys?: { mode: "select" | "focus"; onOpen: (key: string) => void; onKeys?: () => void; scope?: { current: unknown }; claimBody?: boolean };
|
|
104
107
|
/** The selected row's fill. Paseo's sidebar view passes its own selected-item colour (sidebarSelected); Home: surface2. */
|
|
105
108
|
selectedBg?: string;
|
|
109
|
+
/** Needs-you rows' one-click chips (client/row-chips.tsx useRowChipActions). Absent: no chip line. */
|
|
110
|
+
onChip?: (s: ChipRow, chip: RowChip) => void;
|
|
106
111
|
};
|
|
107
112
|
|
|
108
113
|
const noMenu: OpenRowMenu = () => undefined;
|
|
@@ -110,7 +115,7 @@ const noMenu: OpenRowMenu = () => undefined;
|
|
|
110
115
|
/** Where a phone row's text starts: its 14 padding, the 18 glyph, the 10 gap. Older's explainer lines up with it. */
|
|
111
116
|
export const TOUCH_ROW_TEXT = 14 + 18 + 10;
|
|
112
117
|
|
|
113
|
-
export function HomeList({ model, theme, dense = false, touch, selectedKey, onSelect, briefLine, renderExpanded, header, footer, top, afterNeeds, raised, emptyAction, results, hits = null, activeResult = 0, onResult, filter = null, arranged = null, view = DEFAULT_HOME_VIEW, facts, overseer = null, stackOverseer = false, asking = false, menu, onSendNow, keys, selectedBg, overseerInResults = false, overseerActive = false, activeBg }: HomeListProps) {
|
|
118
|
+
export function HomeList({ model, theme, dense = false, touch, selectedKey, onSelect, briefLine, renderExpanded, header, footer, top, afterNeeds, raised, emptyAction, results, hits = null, activeResult = 0, onResult, filter = null, arranged = null, view = DEFAULT_HOME_VIEW, facts, overseer = null, stackOverseer = false, asking = false, menu, onSendNow, keys, selectedBg, overseerInResults = false, overseerActive = false, activeBg, onChip }: HomeListProps) {
|
|
114
119
|
const c = theme.colors;
|
|
115
120
|
const onOpen = useRowOpen(keys?.onOpen);
|
|
116
121
|
const [openMenu, setOpenMenu] = useState<RowMenuOpen | null>(null);
|
|
@@ -130,9 +135,27 @@ export function HomeList({ model, theme, dense = false, touch, selectedKey, onSe
|
|
|
130
135
|
const toggle = useCallback((key: string) => { if (key === "needs") setNeedsClosed(v => !v); else writeHomeGroupOpen(key, !homeGroupOpen(key)); }, []);
|
|
131
136
|
const toggleProject = useCallback((p: string) => setOpenProjects(s => { const n = new Set(s); if (n.has(p)) n.delete(p); else n.add(p); return n; }), []);
|
|
132
137
|
|
|
133
|
-
const
|
|
138
|
+
const entries = useMemo(() => listEntries({ model, closed, openProjects, pages, briefLine, results, hits, filter, overseer: !!overseer, touch, afterNeeds: !!afterNeeds, arranged, overseerInResults }),
|
|
134
139
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
135
140
|
[model, closed, openProjects, pages, briefLine, results, hits, filter, !!overseer, touch, !!afterNeeds, arranged, overseerInResults]);
|
|
141
|
+
// a-clicked-row-holds-its-place (#397): a row whose chip just sent stays where it was, showing "Sent", until its
|
|
142
|
+
// line clears, even when the send takes it out of Needs you; rows nobody touched come and go as usual.
|
|
143
|
+
const heldV = useHeldVersion();
|
|
144
|
+
const drawn = useRef<Entry[]>([]);
|
|
145
|
+
const data = useMemo(() => {
|
|
146
|
+
if (!onChip || results) return entries;
|
|
147
|
+
// Only a Needs-you row draws the held line, so the same workspace in another group doesn't count as still shown.
|
|
148
|
+
const nextHeld = new Set(entries.flatMap(e => e.type === "row" && e.s.group === "needs" ? [heldKey(e.s)] : []));
|
|
149
|
+
// A row is itself in its group: the same workspace can come back in Waiting under the same key while its Needs-you
|
|
150
|
+
// row still shows "Sent". The kept copy gets its own key, so the list never draws two items with one key.
|
|
151
|
+
const k = (e: Entry) => e.type === "row" ? `${e.s.group}|${e.key}` : e.key;
|
|
152
|
+
const prevBy = new Map(drawn.current.map(e => [k(e), e]));
|
|
153
|
+
const nextKeys = new Set(entries.map(k));
|
|
154
|
+
return keepInPlace(drawn.current, entries, k, key => { const e = prevBy.get(key); return e?.type === "row" && isHeld(heldKey(e.s)) && !nextHeld.has(heldKey(e.s)); })
|
|
155
|
+
.map(e => nextKeys.has(k(e)) || e.key.startsWith("held:") ? e : { ...e, key: `held:${e.key}` });
|
|
156
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
157
|
+
}, [entries, heldV, !!onChip, !!results]);
|
|
158
|
+
drawn.current = data;
|
|
136
159
|
// A result picks through onResult; Row only knows its key.
|
|
137
160
|
// Read through a ref, so a key that brings new results (and Home's new onResult) never hands every row a new onSelect
|
|
138
161
|
// (typing-never-redraws-unchanged-rows).
|
|
@@ -164,7 +187,7 @@ export function HomeList({ model, theme, dense = false, touch, selectedKey, onSe
|
|
|
164
187
|
case "result": { const detail = item.archived ? undefined : rowDetail(item.s, view, facts, dense || touch);
|
|
165
188
|
const open = !!selectedBg && selectedKey === item.s.key;
|
|
166
189
|
return <Row s={item.s} sig={item.s.sig} hit={item.hit} theme={theme} dense={dense} touch={touch} selected={open || (!(touch && selectedBg) && item.index === activeResult)} menuOpen={menuKey === item.s.key}
|
|
167
|
-
onSelect={pickResult} onOpen={onOpen} onMenu={item.archived ? noMenu : onMenu} selectedBg={open ? selectedBg : activeBg} detail={detail} detailSig={detail?.sig} />; }
|
|
190
|
+
onSelect={pickResult} onOpen={onOpen} onMenu={item.archived ? noMenu : onMenu} selectedBg={open ? selectedBg : activeBg} detail={detail} detailSig={detail?.sig} onChip={onChip} />; }
|
|
168
191
|
case "ask": return <AskRow ask={item.ask} theme={theme} active={item.index === activeResult} dense={dense} touch={touch} sending={!!asking} onPress={() => onResult?.({ provider: "overseer", key: ASK_KEY, ask: item.ask })} />;
|
|
169
192
|
case "brief": return <BriefRow theme={theme} line={briefLine ?? ""} selected={!touch && (selectedKey === null || selectedKey === BRIEF_KEY)} touch={touch} onSelect={onSelect} />;
|
|
170
193
|
case "overseer": return overseer ? <OverseerRow theme={theme} o={overseer} pinned={!!item.pinned} selected={selectedKey === OVERSEER_KEY || (overseerActive && !touch)} touch={touch} stacked={stackOverseer} onSelect={onSelect} selectedBg={selectedKey === OVERSEER_KEY ? selectedBg : activeBg} /> : null;
|
|
@@ -185,12 +208,12 @@ export function HomeList({ model, theme, dense = false, touch, selectedKey, onSe
|
|
|
185
208
|
const selected = selectedKey === item.key;
|
|
186
209
|
const detail = rowDetail(item.s, view, facts, dense || touch);
|
|
187
210
|
return <View>
|
|
188
|
-
<Row s={item.s} theme={theme} dense={dense} touch={touch} selected={selected} onSelect={onSelect} onOpen={onOpen} sig={item.s.sig} onMenu={onMenu} menuOpen={menuKey === item.key} hit={item.hit} onSendNow={onSendNow} selectedBg={selectedBg} detail={detail} detailSig={detail.sig} />
|
|
211
|
+
<Row s={item.s} theme={theme} dense={dense} touch={touch} selected={selected} onSelect={onSelect} onOpen={onOpen} sig={item.s.sig} onMenu={onMenu} menuOpen={menuKey === item.key} hit={item.hit} onSendNow={onSendNow} selectedBg={selectedBg} detail={detail} detailSig={detail.sig} onChip={onChip} />
|
|
189
212
|
{selected && renderExpanded ? renderExpanded(item.s) : null}
|
|
190
213
|
</View>;
|
|
191
214
|
}
|
|
192
215
|
}
|
|
193
|
-
}, [theme, c, dense, touch, selectedKey, onSelect, briefLine, renderExpanded, toggle, toggleProject, activeResult, onResult, pickResult, model, overseer?.state, overseer?.line, overseer?.ranges, stackOverseer, asking, afterNeeds, raised, emptyAction, onMenu, menuKey, onSendNow, selectedBg, onOpen, view, facts, overseerActive, activeBg]);
|
|
216
|
+
}, [theme, c, dense, touch, selectedKey, onSelect, briefLine, renderExpanded, toggle, toggleProject, activeResult, onResult, pickResult, model, overseer?.state, overseer?.line, overseer?.ranges, stackOverseer, asking, afterNeeds, raised, emptyAction, onMenu, menuKey, onSendNow, selectedBg, onOpen, view, facts, overseerActive, activeBg, onChip]);
|
|
194
217
|
|
|
195
218
|
const listRef = useRef<NativeFlatList<Entry>>(null);
|
|
196
219
|
const rootRef = useRef<View>(null);
|
|
@@ -338,9 +361,9 @@ export function WakeTime({ until, c, size = 12 }: { until: string; c: Colors; si
|
|
|
338
361
|
let rowDraws = 0, chipRails = 0;
|
|
339
362
|
export const rowRenders = () => ({ rows: rowDraws, rails: chipRails });
|
|
340
363
|
/** The right-hand time: when a Later row comes back, otherwise how long ago. */
|
|
341
|
-
const RowTime = memo(function RowTime({ s, c, size }: { s: Workstream; c: Colors; size: number }) {
|
|
342
|
-
return <View testID="follow-up-row-time" style={{ flexShrink: 0 }}>{s.group === "later" && s.wakeAt ? <WakeTime until={s.wakeAt} c={c} size={size} /> : <Age iso={s.at} c={c} size={size} />}</View>;
|
|
343
|
-
}, (a, b) => a.s.sig === b.s.sig && a.c === b.c && a.size === b.size);
|
|
364
|
+
const RowTime = memo(function RowTime({ s, c, size, top = 0 }: { s: Workstream; c: Colors; size: number; top?: number }) {
|
|
365
|
+
return <View testID="follow-up-row-time" style={{ flexShrink: 0, paddingTop: top }}>{s.group === "later" && s.wakeAt ? <WakeTime until={s.wakeAt} c={c} size={size} /> : <Age iso={s.at} c={c} size={size} />}</View>;
|
|
366
|
+
}, (a, b) => a.s.sig === b.s.sig && a.c === b.c && a.size === b.size && a.top === b.top);
|
|
344
367
|
|
|
345
368
|
/**
|
|
346
369
|
* row-chips-never-cover-the-time: a desktop row's badges and PR chip, in priority order (most telling first). They yield
|
|
@@ -404,22 +427,30 @@ export function rowDetail(s: Workstream, view: HomeView, facts: HomeListProps["f
|
|
|
404
427
|
const lineText = (s: Workstream, hit: RowHit | null): string => hit?.via ? `${FIELD_LABEL[hit.via.field]} · ${hit.via.text}`.slice(0, 60)
|
|
405
428
|
: [s.lead && [s.lead.text, s.lead.position].filter(Boolean).join(" "), s.word && s.group !== "needs" ? s.word : null, s.line].filter(Boolean).join(" · ") + (s.word && s.group === "needs" && s.line ? " · " : "");
|
|
406
429
|
|
|
407
|
-
type RowProps = { s: Workstream; sig: string; detail?: RowDetail; detailSig?: string; theme: Theme; dense: boolean; touch: boolean; selected: boolean; onSelect: (key: string) => void; onOpen?: (key: string) => void; onMenu: OpenRowMenu; menuOpen?: boolean; hit?: RowHit | null; onSendNow?: (s: Workstream) => Promise<void>; selectedBg?: string };
|
|
408
|
-
const Row = memo(function Row({ s: raw, theme, dense, touch, selected, onSelect, onOpen, onMenu, menuOpen = false, hit = null, onSendNow, selectedBg, detail }: RowProps) {
|
|
430
|
+
type RowProps = { s: Workstream; sig: string; detail?: RowDetail; detailSig?: string; theme: Theme; dense: boolean; touch: boolean; selected: boolean; onSelect: (key: string) => void; onOpen?: (key: string) => void; onMenu: OpenRowMenu; menuOpen?: boolean; hit?: RowHit | null; onSendNow?: (s: Workstream) => Promise<void>; selectedBg?: string; onChip?: (s: ChipRow, chip: RowChip) => void };
|
|
431
|
+
const Row = memo(function Row({ s: raw, theme, dense, touch, selected, onSelect, onOpen, onMenu, menuOpen = false, hit = null, onSendNow, selectedBg, detail, onChip }: RowProps) {
|
|
409
432
|
rowDraws++;
|
|
410
433
|
// Title › Branch name swaps the row's title; everything else reads the workstream as built.
|
|
411
434
|
const s = detail && detail.title !== raw.title ? { ...raw, title: detail.title } : raw;
|
|
412
435
|
const showTime = detail?.time ?? true;
|
|
413
436
|
// Show › Pull request off takes the PR chip off the wide row's rail too.
|
|
414
|
-
const
|
|
437
|
+
const railed = detail && !detail.pr ? { ...s, pr: null } : s;
|
|
415
438
|
const c = theme.colors;
|
|
416
439
|
const trigger = useRowMenuTrigger(s, onMenu, touch);
|
|
417
440
|
// Desktop rows with an agent peek at its turn under a PeekHost (Home); touch rows keep opening the detail pane.
|
|
418
|
-
|
|
441
|
+
// A question row peeks its question card instead (invariant 200): the whole ask before a chip is picked. Not the
|
|
442
|
+
// selected row's: Home's pane already shows that card.
|
|
443
|
+
const asks = !touch && s.group === "needs" && s.chips?.target.kind === "question" ? questionPeekId(s.chips.target.workspaceId, s.chips.target.questionId) : null;
|
|
444
|
+
const peek = usePeekLine(touch ? null : asks ? (selected ? null : asks) : s.agentId, () => trigger.ref.current);
|
|
445
|
+
const anchor = useCallback(() => trigger.ref.current, [trigger.ref]);
|
|
419
446
|
useEffect(() => {
|
|
420
447
|
if (touch || menuOpen || !onOpen) return;
|
|
421
448
|
return bindRowDoubleClick(trigger.ref.current as unknown as Parameters<typeof bindRowDoubleClick>[0], () => onOpen(s.key));
|
|
422
449
|
}, [touch, menuOpen, onOpen, s.key, trigger.ref]);
|
|
450
|
+
// #397: a Needs-you row's one line of chips (never Older or Later, never an archived search hit).
|
|
451
|
+
const chips = !!onChip && s.group === "needs" && !!s.chips?.chips.length && !(s.icon === "Archive" && s.sig.startsWith("archived:"));
|
|
452
|
+
// On a chip row the chips are the ask, so "Asks you" gives its room to the question line.
|
|
453
|
+
const rail = railed;
|
|
423
454
|
const archived = s.icon === "Archive" && s.sig.startsWith("archived:");
|
|
424
455
|
// An Older row is demoted at one level: its title muted, and its glyph and chips keep their hue at 60 % (still
|
|
425
456
|
// readable as an error or a review), never full red beside a grey title.
|
|
@@ -445,17 +476,17 @@ const Row = memo(function Row({ s: raw, theme, dense, touch, selected, onSelect,
|
|
|
445
476
|
// A Later row says when it comes back on screen; the label also keeps how long it has waited.
|
|
446
477
|
const wake = s.group === "later" && s.wakeAt ? wakeLabel({ until: s.wakeAt, at: s.at ?? new Date().toISOString() }, Date.now()) : "";
|
|
447
478
|
const waited = s.group === "later" && s.at ? age(s.at, Date.now()) : "";
|
|
448
|
-
const label = [s.title + (s.agent ? ` › ${s.agent}` : ""), s.word, s.lead && [s.lead.text, s.lead.position].filter(Boolean).join(" "), s.line, hit?.via && `${FIELD_LABEL[hit.via.field]}: ${hit.via.text}`,
|
|
479
|
+
const label = [s.title + (s.agent ? ` › ${s.agent}` : ""), s.word, s.lead && [s.lead.text, s.lead.position].filter(Boolean).join(" "), s.line, runningMark(s), hit?.via && `${FIELD_LABEL[hit.via.field]}: ${hit.via.text}`,
|
|
449
480
|
// Every chip, even one a narrow row hides (row-chips-never-cover-the-time).
|
|
450
481
|
...s.badges.map(b => b.text), s.pr && prChipSpoken(s.pr), wake && `Later until ${wake}`, waited && (waited === "now" ? "just now" : `waiting ${waited}`)].filter(Boolean).join(". ");
|
|
451
482
|
return <Pressable ref={trigger.ref} nativeID={rowDomId(s.key)} accessibilityRole="button" accessibilityState={{ selected }} accessibilityLabel={label} accessibilityHint={quickActionsHint(touch)}
|
|
452
483
|
{...peek} onPress={linePress(peek?.onPress, () => onSelect(s.key))} onLongPress={trigger.onLongPress} delayLongPress={450}
|
|
453
|
-
style={state => ({ ...focusRing((state as { focused?: boolean }).focused, c, true), flexDirection: "row", alignItems: dense ? "flex-start" : "center", gap: touch ? 10 : dense ? 8 : 10, minHeight: touch ? 56 : dense ? 36 : 38, paddingLeft: touch ? 14 : dense ? 8 : 16, paddingRight: touch ? 16 : dense ? 8 : 16, paddingVertical: touch ? 12 : dense ? 6 : 0,
|
|
484
|
+
style={state => ({ ...focusRing((state as { focused?: boolean }).focused, c, true), flexDirection: "row", alignItems: dense || chips ? "flex-start" : "center", gap: touch ? 10 : dense ? 8 : 10, minHeight: touch ? 56 : dense ? 36 : 38, paddingLeft: touch ? 14 : dense ? 8 : 16, paddingRight: touch ? 16 : dense ? 8 : 16, paddingVertical: touch ? 12 : dense ? 6 : 0,
|
|
454
485
|
...(touch ? { borderBottomWidth: 1, borderBottomColor: withAlpha(c.border, 0.6) } : {}),
|
|
455
486
|
borderLeftWidth: 2, borderLeftColor: "transparent",
|
|
456
487
|
backgroundColor: selected ? selectedBg ?? c.surface2 : menuOpen || state.pressed && touch ? c.surface2 : (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
|
|
457
488
|
{blocking && <BlockingBar color={withAlpha(color, 0.9)} inset={touch ? 8 : 6} />}
|
|
458
|
-
<View style={{ width: touch ? 18 : 16, alignItems: "center", paddingTop: touch ? 2 : dense ? 1 : 0 }}>
|
|
489
|
+
<View style={{ width: touch ? 18 : 16, alignItems: "center", paddingTop: touch ? 2 : dense ? 1 : chips ? 7 : 0 }}>
|
|
459
490
|
{s.tone === "running" && s.icon === "LoaderCircle" ? <Spinner color={color} size={13} label="Working" /> : <Icon name={s.icon} size={touch ? 17 : 15} color={color} />}
|
|
460
491
|
</View>
|
|
461
492
|
{/* Phones: title 15/20 over two lines, then state · reason, then the PRs as plain text (no bordered chips). */}
|
|
@@ -465,13 +496,14 @@ const Row = memo(function Row({ s: raw, theme, dense, touch, selected, onSelect,
|
|
|
465
496
|
{showTime && <View style={{ paddingTop: 2 }}><RowTime s={s} c={c} size={12} /></View>}
|
|
466
497
|
</View>
|
|
467
498
|
{via ? <Text numberOfLines={2} style={{ color: c.foregroundMuted, fontSize: 13, lineHeight: 18 }}>{via}</Text>
|
|
468
|
-
: (!!s.word || !!s.line || !!s.lead) && !generic && <Text numberOfLines={2} style={{ color: c.foregroundMuted, fontSize: 13, lineHeight: 18 }}>
|
|
499
|
+
: (!!s.word || !!s.line || !!s.lead) && !generic && <Marked s={s} c={c} size={13} lineHeight={18} align="flex-end"><Text numberOfLines={2} style={{ flexShrink: 1, minWidth: 0, color: c.foregroundMuted, fontSize: 13, lineHeight: 18 }}>
|
|
469
500
|
{s.word && s.group === "needs" ? <Text style={{ color, fontWeight: "600" }}>{s.word}</Text> : null}{s.word && s.group === "needs" && s.line ? " · " : ""}{line}
|
|
470
|
-
</Text>}
|
|
501
|
+
</Text></Marked>}
|
|
471
502
|
{!!why && <PriorityLine reason={why.reason} source={why.source} c={c} size={12} lines={2} />}
|
|
472
503
|
{detail ? detail.meta && <MetaLine s={s} d={detail} c={c} touch dim={older} />
|
|
473
504
|
: !!s.pr && <Text numberOfLines={1} style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 17, fontVariant: ["tabular-nums"], ...(older ? { opacity: 0.6 } : {}) }}><PrSummaryText s={s} c={c} /></Text>}
|
|
474
505
|
{sendNow && <View style={{ flexDirection: "row", marginTop: 6 }}>{sendNow}</View>}
|
|
506
|
+
{chips && <ChipLine s={s} theme={theme} layout="touch" onChip={onChip!} anchor={anchor} top={8} />}
|
|
475
507
|
</View> : dense ? <View style={{ flex: 1, minWidth: 0, gap: 1 }}>
|
|
476
508
|
{/* Paseo's row: the title with the time on its line, Follow-up's line (one line, cut with "…"), then the detail line. */}
|
|
477
509
|
<View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
|
|
@@ -479,13 +511,14 @@ const Row = memo(function Row({ s: raw, theme, dense, touch, selected, onSelect,
|
|
|
479
511
|
{showTime && <RowTime s={s} c={c} size={11} />}
|
|
480
512
|
</View>
|
|
481
513
|
{via ? <Text numberOfLines={1} style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>{via}</Text>
|
|
482
|
-
: (!!s.word || !!s.line || !!s.lead) && <Text numberOfLines={1} style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>
|
|
514
|
+
: (!!s.word || !!s.line || !!s.lead) && <Marked s={s} c={c} size={12} lineHeight={16} align="center"><Text numberOfLines={1} style={{ flexShrink: 1, minWidth: 0, color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>
|
|
483
515
|
{s.word && s.group === "needs" ? <Text style={{ color, fontWeight: "600" }}>{s.word}</Text> : null}{s.word && s.group === "needs" && s.line ? " · " : ""}{line}
|
|
484
|
-
</Text>}
|
|
516
|
+
</Text></Marked>}
|
|
485
517
|
{/* Three lines at most, like Paseo's rows plus Follow-up's line: the reason line stays on Home and in the workspace view. */}
|
|
486
518
|
{!detail && !!why && <PriorityLine reason={why.reason} source={why.source} c={c} size={11} lines={2} />}
|
|
487
519
|
{detail?.meta && <MetaLine s={s} d={detail} c={c} touch={false} dim={older} />}
|
|
488
|
-
|
|
520
|
+
{chips && <ChipLine s={s} theme={theme} layout="dense" onChip={onChip!} anchor={anchor} top={4} />}
|
|
521
|
+
</View> : <View style={{ flex: 1, minWidth: 0, gap: 1, paddingVertical: why ? 4 : 0, ...(chips ? { paddingTop: 6, paddingBottom: 5 } : {}) }}><View style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
|
|
489
522
|
{/* The title keeps its width (up to 55 %) and the chips yield; only beside Send now, which can't, does it shrink. */}
|
|
490
523
|
<Text numberOfLines={1} style={{ flexShrink: sendNow ? 1 : 0, minWidth: 0, maxWidth: "55%", color: muted ? c.foregroundMuted : c.foreground, fontSize: 13, fontWeight: muted ? "400" : "500" }}>{title}</Text>
|
|
491
524
|
{/* A Needs-you row's word (Permission, Question…) is why it's there: it keeps its place, the chips yield first. */}
|
|
@@ -500,12 +533,34 @@ const Row = memo(function Row({ s: raw, theme, dense, touch, selected, onSelect,
|
|
|
500
533
|
<Text numberOfLines={1} style={{ flexGrow: 1000, flexShrink: 1, flexBasis: lineBasis(lineText(s, hit), railKeeps(rail)), maxWidth: lineWidth(lineText(s, hit)), minWidth: 0, color: c.foregroundMuted, fontSize: 12, marginLeft: !via && s.word && s.group === "needs" ? -10 : 0 }}>
|
|
501
534
|
{via ?? <>{s.word && s.group === "needs" && s.line ? "\u00a0· " : ""}{line}</>}
|
|
502
535
|
</Text>
|
|
536
|
+
{!via && <RunningMark s={s} c={c} size={12} lineHeight={16} tight />}
|
|
503
537
|
<ChipRail s={rail} c={c} dim={older} />
|
|
504
538
|
{sendNow}
|
|
505
|
-
</View>{!!why && <View style={{ paddingRight: 40 }}><PriorityLine reason={why.reason} source={why.source} c={c} /></View>}
|
|
506
|
-
|
|
539
|
+
</View>{!!why && <View style={{ paddingRight: 40 }}><PriorityLine reason={why.reason} source={why.source} c={c} /></View>}
|
|
540
|
+
{chips && <ChipLine s={s} theme={theme} layout="wide" onChip={onChip!} anchor={anchor} top={4} />}</View>}
|
|
541
|
+
{!touch && !dense && showTime && <RowTime s={s} c={c} size={12} top={chips ? 7 : 0} />}
|
|
507
542
|
</Pressable>;
|
|
508
|
-
}, (a, b) => a.sig === b.sig && a.selected === b.selected && a.theme === b.theme && a.dense === b.dense && a.touch === b.touch && a.onSelect === b.onSelect && a.onOpen === b.onOpen && a.onMenu === b.onMenu && a.menuOpen === b.menuOpen && sameHit(a.hit, b.hit) && a.onSendNow === b.onSendNow && a.selectedBg === b.selectedBg && a.detailSig === b.detailSig);
|
|
543
|
+
}, (a, b) => a.sig === b.sig && a.selected === b.selected && a.theme === b.theme && a.dense === b.dense && a.touch === b.touch && a.onSelect === b.onSelect && a.onOpen === b.onOpen && a.onMenu === b.onMenu && a.menuOpen === b.menuOpen && sameHit(a.hit, b.hit) && a.onSendNow === b.onSendNow && a.selectedBg === b.selectedBg && a.detailSig === b.detailSig && a.onChip === b.onChip);
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* running-and-needs-you-are-separate (invariant 240): a Needs-you row whose agents still run says so after its line,
|
|
547
|
+
* "· ◌ 2 running", with the spinner Working rows draw. It never shrinks (the line gives way first), and it holds no
|
|
548
|
+
* clock: the spinner turns natively, so the row draws again only when the count moves (its `sig`).
|
|
549
|
+
*/
|
|
550
|
+
/** A narrow row's line with its running mark after it; the line alone (no extra view) when nothing runs. */
|
|
551
|
+
function Marked({ s, c, size, lineHeight, align, children }: { s: Workstream; c: Colors; size: number; lineHeight: number; align: "center" | "flex-end"; children: ReactNode }) {
|
|
552
|
+
if (!runningMark(s)) return <>{children}</>;
|
|
553
|
+
return <View style={{ flexDirection: "row", alignItems: align, minWidth: 0 }}>{children}<RunningMark s={s} c={c} size={size} lineHeight={lineHeight} /></View>;
|
|
554
|
+
}
|
|
555
|
+
function RunningMark({ s, c, size, lineHeight, tight = false }: { s: Workstream; c: Colors; size: number; lineHeight: number; /** Wide rows: take back the row gap. */ tight?: boolean }) {
|
|
556
|
+
const text = runningMark(s);
|
|
557
|
+
if (!text) return null;
|
|
558
|
+
return <View style={{ flexShrink: 0, flexDirection: "row", alignItems: "center", gap: 4, height: lineHeight, marginLeft: tight ? -6 : 0 }}>
|
|
559
|
+
<Text style={{ color: c.foregroundMuted, fontSize: size, lineHeight }}>{"\u00a0·"}</Text>
|
|
560
|
+
<Spinner color={runningColor(c)} size={size - 1} label="Working" />
|
|
561
|
+
<Text numberOfLines={1} style={{ color: c.foregroundMuted, fontSize: size, lineHeight, fontVariant: ["tabular-nums"] }}>{text}</Text>
|
|
562
|
+
</View>;
|
|
563
|
+
}
|
|
509
564
|
|
|
510
565
|
/**
|
|
511
566
|
* Paseo's detail line under a row: branch, project, the PR with its checks, labels (as Display › Show leaves them),
|
package/client/home-view.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DispatchRecord } from "../shared/dispatch";
|
|
2
|
+
import { reportInstalledVersion } from "./install-scope";
|
|
2
3
|
import type { PluginClientContext } from "@getpaseo/plugin/client";
|
|
3
4
|
import type { ImageUpload } from "../shared/images";
|
|
4
5
|
import { contextAskRpc, contextListRpc, questionActionRpc, dispatchRecordsRpc, homeFeed, queueNeedsSchema, overseerAskRpc, overseerRestartRpc, overseerStartRpc, overseerStatusRpc, prioritiesRpc, prStatsSettingsRpc, rankNowRpc, rankStatusRpc, usageRpc } from "../shared/contracts";
|
|
@@ -18,7 +19,11 @@ export type QueueNeeds = z.infer<typeof queueNeedsSchema>;
|
|
|
18
19
|
const NO_QUEUE: QueueNeeds = { needs: [], timeZone: "UTC", revision: "" };
|
|
19
20
|
import { onVisible, whileVisible } from "./visibility";
|
|
20
21
|
import { createWebSearchFocus } from "./search-focus";
|
|
22
|
+
import { createFilterStep } from "../shared/search-focus";
|
|
21
23
|
import type { ContextRequest } from "../shared/catch-up";
|
|
24
|
+
import { pendingRemovals, settleRemovals, subscribePendingRemovals } from "./pending-removals";
|
|
25
|
+
import { settledIssues, withPendingIssues } from "../shared/optimistic-removals";
|
|
26
|
+
import { recallLastKnown, registerLastKnown } from "./last-known";
|
|
22
27
|
|
|
23
28
|
/**
|
|
24
29
|
* What Home adds on top of the inbox, live and Paseo stores (1.3.0-beta.2): the sort choice, external
|
|
@@ -76,7 +81,20 @@ export function createHomeExtras(client: PluginClientContext) {
|
|
|
76
81
|
/** Each workspace's first live Compass note as one line (Home rows, Catch up), from the worker with the priorities. */
|
|
77
82
|
let compass: Record<string, string> = {};
|
|
78
83
|
const setCompass = (next: Record<string, string> | undefined) => { if (!next || JSON.stringify(next) === JSON.stringify(compass)) return false; compass = next; return true; };
|
|
79
|
-
const setQueue = (next: QueueNeeds | undefined) => {
|
|
84
|
+
const setQueue = (next: QueueNeeds | undefined) => {
|
|
85
|
+
if (!next || JSON.stringify(next) === JSON.stringify(queue)) return false;
|
|
86
|
+
queue = next;
|
|
87
|
+
const settled = settledIssues(queue, pendingRemovals()); if (settled.length) settleRemovals(settled);
|
|
88
|
+
return true;
|
|
89
|
+
};
|
|
90
|
+
// every-remove-is-instant: a "Nobody's on it" row removed or brought back on the click (client/pending-removals.ts)
|
|
91
|
+
// reads so here, the one place Home's rows, Needs you's count and the brief line take the queue from.
|
|
92
|
+
let shownQueue = { from: queue, pending: pendingRemovals(), out: queue };
|
|
93
|
+
const readQueue = () => {
|
|
94
|
+
const pending = pendingRemovals();
|
|
95
|
+
if (shownQueue.from !== queue || shownQueue.pending !== pending) shownQueue = { from: queue, pending, out: withPendingIssues(queue, pending) };
|
|
96
|
+
return shownQueue.out;
|
|
97
|
+
};
|
|
80
98
|
const setContext = (next: ContextRequest[]) => { if (JSON.stringify(next) === JSON.stringify(context)) return false; context = next; return true; };
|
|
81
99
|
const readContext = async () => setContext((await client.rpc(contextListRpc, {})).requests);
|
|
82
100
|
const agents = new Map<string, AgentLite>();
|
|
@@ -87,6 +105,18 @@ export function createHomeExtras(client: PluginClientContext) {
|
|
|
87
105
|
const emit = () => { version++; for (const l of listeners) l(); };
|
|
88
106
|
// Agent updates arrive in bursts (every status change); only title or workspace changes matter, coalesced.
|
|
89
107
|
const emitSoon = () => { if (pending) return; pending = setTimeout(() => { pending = null; emit(); }, 250); };
|
|
108
|
+
const offRemovals = subscribePendingRemovals(() => { const before = shownQueue.out; if (readQueue() !== before) emit(); });
|
|
109
|
+
// a-client-restart-never-blanks-follow-up (invariant 213): the last client's home-feed values draw the first frame
|
|
110
|
+
// (Home, the badge's queue, Compass lines); the feed's first event replaces them. Values only: no side effects.
|
|
111
|
+
const kept = recallLastKnown("home", homeFeed.event.extend({ rank: homeFeed.event.shape.rank.nullable(), overseer: homeFeed.event.shape.overseer.nullable() }));
|
|
112
|
+
let heard = !!kept;
|
|
113
|
+
if (kept) {
|
|
114
|
+
priorities = kept.priorities; rank = kept.rank; overseer = kept.overseer;
|
|
115
|
+
context = kept.context ?? []; dispatches = kept.dispatches ?? []; prStatsOn = kept.prStats ?? false;
|
|
116
|
+
queue = kept.queue ?? NO_QUEUE; compass = kept.compass ?? {}; if (kept.usage) usage = kept.usage;
|
|
117
|
+
}
|
|
118
|
+
const offKeep = registerLastKnown("home", () => heard
|
|
119
|
+
? { priorities, rank, overseer, usage, usageLive: true, context, dispatches, prStats: prStatsOn, queue, compass } : null);
|
|
90
120
|
|
|
91
121
|
// One pending timer per poll (it used to append one per run and never drop it: about 8 a minute for an open Home).
|
|
92
122
|
const timers = new Set<ReturnType<typeof setTimeout>>();
|
|
@@ -109,6 +139,7 @@ export function createHomeExtras(client: PluginClientContext) {
|
|
|
109
139
|
};
|
|
110
140
|
const searchFocus = createWebSearchFocus();
|
|
111
141
|
const offSearchFocus = searchFocus.install();
|
|
142
|
+
const filterStep = createFilterStep();
|
|
112
143
|
const offVisible = onVisible(() => { for (const r of runs) void r(); });
|
|
113
144
|
const together = (stops: (() => void)[]) => () => { for (const s of stops) s(); };
|
|
114
145
|
const readRank = async () => {
|
|
@@ -153,6 +184,8 @@ export function createHomeExtras(client: PluginClientContext) {
|
|
|
153
184
|
const home = openFeed(client, homeFeed, {}, {
|
|
154
185
|
event: event => {
|
|
155
186
|
if (stopped) return;
|
|
187
|
+
reportInstalledVersion(event.version);
|
|
188
|
+
heard = true;
|
|
156
189
|
priorities = event.priorities; rank = event.rank; overseer = event.overseer;
|
|
157
190
|
if (event.context) setContext(event.context);
|
|
158
191
|
if (event.dispatches) dispatches = event.dispatches;
|
|
@@ -299,7 +332,7 @@ export function createHomeExtras(client: PluginClientContext) {
|
|
|
299
332
|
/** Whether Home shows the PR stats icon (some repository has PR statistics). */
|
|
300
333
|
prStatsOn: () => prStatsOn,
|
|
301
334
|
/** The raised Linear issues in Needs you and the queue's revision (Q8), from the worker. */
|
|
302
|
-
queue:
|
|
335
|
+
queue: readQueue,
|
|
303
336
|
/** Each workspace's first live Compass note as one line. */
|
|
304
337
|
compass: () => compass,
|
|
305
338
|
/** A dismissal on a 0.15 host (or with the feed down): read the answer once now; the feed pushes it itself. */
|
|
@@ -325,6 +358,8 @@ export function createHomeExtras(client: PluginClientContext) {
|
|
|
325
358
|
* key, ⌘K "Follow-up: Search" and `/` ask it; the search field on screen takes it (client/search-focus.ts).
|
|
326
359
|
*/
|
|
327
360
|
searchFocus,
|
|
361
|
+
/** The search key's first stop, the sidebar view's filter (the-search-key-tries-the-sidebar-filter-first). */
|
|
362
|
+
filterStep,
|
|
328
363
|
/** Calls `listener` when an agent's status, attention or permissions change (see above). */
|
|
329
364
|
onActivity(listener: () => void) { activity.add(listener); return () => { activity.delete(listener); }; },
|
|
330
365
|
/** Each update Paseo sends about one agent (null when it's removed). */
|
|
@@ -332,7 +367,7 @@ export function createHomeExtras(client: PluginClientContext) {
|
|
|
332
367
|
const set = agentWatchers.get(agentId) ?? new Set(); set.add(listener); agentWatchers.set(agentId, set);
|
|
333
368
|
return () => { set.delete(listener); if (!set.size) agentWatchers.delete(agentId); };
|
|
334
369
|
},
|
|
335
|
-
async stop() { stopped = true; stopFeeds(); offVisible(); offSearchFocus(); activity.clear(); for (const t of timers) clearTimeout(t); timers.clear(); if (pending) clearTimeout(pending); listeners.clear(); unsubscribe(); await release?.(); },
|
|
370
|
+
async stop() { stopped = true; offKeep(); stopFeeds(); offRemovals(); offVisible(); offSearchFocus(); activity.clear(); for (const t of timers) clearTimeout(t); timers.clear(); if (pending) clearTimeout(pending); listeners.clear(); unsubscribe(); await release?.(); },
|
|
336
371
|
};
|
|
337
372
|
}
|
|
338
373
|
export type HomeExtras = ReturnType<typeof createHomeExtras>;
|