paseo-follow-up 2.1.0-beta.3 → 2.1.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/icon.png +0 -0
- package/assets/icon.svg +1 -1
- package/client/brief.tsx +12 -7
- package/client/chat.tsx +15 -6
- package/client/display.tsx +10 -2
- package/client/follow-up-icon.ts +28 -0
- package/client/home-chrome.tsx +15 -7
- package/client/home-list.tsx +32 -12
- package/client/home-view.ts +9 -3
- package/client/home.tsx +47 -6
- package/client/kit.tsx +3 -3
- package/client/large.tsx +2 -1
- package/client/list-keys.ts +3 -2
- package/client/live.tsx +5 -4
- package/client/needs-you.tsx +25 -7
- package/client/pane-allowlist.ts +10 -0
- package/client/questions.tsx +21 -15
- package/client/report-issue.tsx +2 -2
- package/client/search-key.ts +69 -0
- package/client/spec.tsx +1 -1
- package/client/split.tsx +150 -0
- package/index.client.tsx +18 -6
- package/index.server.ts +114 -22
- package/package.json +2 -2
- package/server/agent-actions.ts +7 -6
- package/server/agent-hook.mjs +7 -2
- package/server/agent-parity.ts +5 -0
- package/server/daemon.ts +86 -32
- package/server/engine.ts +212 -122
- package/server/hook-source.ts +7 -2
- package/server/inbox.ts +64 -64
- package/server/linked.ts +28 -6
- package/server/local-titles.ts +67 -0
- package/server/mcp-source.ts +5 -3
- package/server/mcp.mjs +5 -3
- package/server/message-queue.ts +384 -0
- package/server/overseer.ts +12 -3
- package/server/questions.ts +4 -2
- package/server/report-send.ts +3 -2
- package/server/spec.ts +18 -29
- package/server/store.ts +98 -13
- package/server/teardown.ts +10 -2
- package/server/transcript-titles.ts +165 -0
- package/shared/about.ts +1 -0
- package/shared/attention.ts +12 -3
- package/shared/brief.ts +2 -3
- package/shared/chat.ts +1 -1
- package/shared/contracts.ts +5 -1
- package/shared/display.ts +31 -10
- package/shared/headline.ts +1 -0
- package/shared/home.ts +14 -0
- package/shared/linked-display.ts +6 -1
- package/shared/linked.ts +2 -2
- package/shared/local-titles.ts +68 -0
- package/shared/model.ts +6 -0
- package/shared/overseer.ts +3 -0
- package/shared/questions.ts +35 -7
- package/shared/queue.ts +173 -0
- package/shared/search-key.ts +85 -0
- package/shared/spec.ts +1 -0
- package/shared/split.ts +24 -0
- package/shared/status-invariants.ts +22 -0
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"/><
|
|
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>
|
package/client/brief.tsx
CHANGED
|
@@ -4,8 +4,9 @@ import { Platform, View, useWindowDimensions } from "react-native";
|
|
|
4
4
|
import { Pressable, Text } from "./text";
|
|
5
5
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
6
|
import { openExternalUrl, useRpc, type PluginClientContext, type PluginTimelineItemProps } from "@getpaseo/plugin/client";
|
|
7
|
+
import { deliveryStatus } from "../shared/queue";
|
|
7
8
|
import { Icon, TextInput, copyText, useToast } from "@getpaseo/plugin/client/ui";
|
|
8
|
-
import { BRIEF_KIND, BRIEF_VERSION, askedDecisions, cardPicks, notedCount, pickedCount, briefSchema, collapsedLine, extrasFit, hasOriginal, nothingNeededLine, isTight, pastRows, pastTone, selectsFirst, sendBar, shownBrief, pastAsk, liveBrief, newAnswerId,
|
|
9
|
+
import { BRIEF_KIND, BRIEF_VERSION, askedDecisions, cardPicks, notedCount, pickedCount, briefSchema, collapsedLine, extrasFit, hasOriginal, nothingNeededLine, isTight, pastRows, pastTone, selectsFirst, sendBar, shownBrief, pastAsk, liveBrief, newAnswerId, type Brief, type BriefDecision, type BriefMove } from "../shared/brief";
|
|
9
10
|
import { age } from "../shared/inbox";
|
|
10
11
|
import { noReviewReposVersion, onNoReviewRepos } from "../shared/pr-workflow";
|
|
11
12
|
import { briefKey, HEADLINE_WORD } from "../shared/headline";
|
|
@@ -287,17 +288,21 @@ function Past({ b, c, now, compact, height, pending = false, onResend, resending
|
|
|
287
288
|
const picked = answered && asked.some(d => d.chosen);
|
|
288
289
|
// The answer is recorded the moment Send is pressed; getting it to the agent can take Paseo a minute or more (a dormant
|
|
289
290
|
// agent resumes first). Until it lands the card reads as in progress, and if every retry failed it says so with Send again.
|
|
290
|
-
|
|
291
|
+
// The message queue's state, worded as on every card (shared/queue.ts deliveryStatus).
|
|
292
|
+
const delivery = b.delivery ? deliveryStatus({ state: b.delivery.state, reason: b.delivery.error, nextAt: b.delivery.nextAt }) : null;
|
|
293
|
+
const sending = pending || !!delivery?.pending || unsent;
|
|
291
294
|
const failed = b.delivery?.state === "failed";
|
|
295
|
+
const cancelled = b.delivery?.state === "cancelled";
|
|
292
296
|
// Pending reads as in progress (a dashed circle), and becomes the solid check when the send lands.
|
|
293
297
|
const icon = b.state === "superseded" ? "History" : failed ? "CircleAlert" : sending ? "CircleDashed" : "CircleCheck";
|
|
294
298
|
const spoken = pending ? `Done, sending (undo available): ${ask}` : unsent ? `${status!.label}: ${ask}` : failed ? `Answer not delivered: ${ask}` : sending ? `Answered, sending to the agent: ${ask}` : undefined;
|
|
295
|
-
const color = failed ? c.
|
|
299
|
+
const color = failed ? c.statusWarning : pastTone(b.state, sending) === "success" ? c.statusSuccess : c.foregroundMuted;
|
|
296
300
|
// A Done card already says "Done" as its outcome; its time stands alone rather than repeating it.
|
|
297
|
-
const right =
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
+
const right = delivery && !pending ? delivery.label : unsent ? status!.label : answered && b.outcomeAt ? (b.outcome === "Done" ? clock(b.outcomeAt) : `Answered ${clock(b.outcomeAt)}`) : age(b.outcomeAt ?? b.at, now);
|
|
302
|
+
// Failed (the rare loud case) says so with Retry; a timer's wait (Queued, Retrying) offers Try now; Cancelled says why.
|
|
303
|
+
const undelivered = (indent: number) => delivery && !pending && (failed || cancelled || delivery.action === "try-now") && <View style={{ paddingLeft: indent, gap: 8, alignItems: "flex-start" }}>
|
|
304
|
+
<Text accessibilityRole={failed ? "alert" : undefined} style={{ color: failed ? c.statusWarning : c.foregroundMuted, fontSize: 13, lineHeight: 18 }}>{failed ? `${delivery.detail} Your answer is kept.` : delivery.detail}</Text>
|
|
305
|
+
{onResend && delivery.action && <Btn label={resending ? "Sending…" : delivery.action === "retry" ? "Retry" : "Try now"} icon="RotateCcw" primary={delivery.action === "retry"} onPress={onResend} disabled={resending} c={c} compact={compact} hint={delivery.action === "retry" ? "Sends the same answer again" : "Tries sending it now"} />}
|
|
301
306
|
</View>;
|
|
302
307
|
const body = expanded && <View style={{ gap: 10, paddingTop: 4 }}>
|
|
303
308
|
<BriefBody b={b} c={c} compact={compact} tight={false} embedded height={height} mode="readonly" picks={{}} onPick={() => undefined} busy={null} />
|
package/client/chat.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import type { PluginClientContext, PluginTimelineItemProps } from "@getpaseo/plu
|
|
|
5
5
|
import { Icon, ScrollView } from "@getpaseo/plugin/client/ui";
|
|
6
6
|
import { answerCardSchema, answerCardWhose, batchCardSchema, createMomentLedger, followTimelineItem, parseBatchPrompt, toolRowSchema, type AnswerCard, type BatchCard, type ToolRow } from "../shared/chat";
|
|
7
7
|
import { parseAnswerMessage, parseAnswersMessage } from "../shared/questions";
|
|
8
|
+
import { envelopeParts } from "../shared/queue";
|
|
8
9
|
import { CREATED_KIND, CREATED_VERSION, createdCard } from "../shared/created";
|
|
9
10
|
import { timelineSupported } from "./created";
|
|
10
11
|
import { unconfirmedNote, unconfirmedRefs } from "../shared/status";
|
|
@@ -138,6 +139,16 @@ function AnswerCardView({ item, theme }: PluginTimelineItemProps<AnswerCard>) {
|
|
|
138
139
|
</View>;
|
|
139
140
|
}
|
|
140
141
|
|
|
142
|
+
/** One Follow-up part of a user message as its chat card: an answer (one or several decisions) or a repair batch. */
|
|
143
|
+
function promptCard(text: string) {
|
|
144
|
+
const several = parseAnswersMessage(text);
|
|
145
|
+
if (several) return { type: "plugin" as const, kind: ANSWER_KIND, version: 1, data: { id: several.answers.map(a => a.id).join(", "), title: several.title, choice: "", label: null, words: null, text, answers: several.answers } as Record<string, unknown> };
|
|
146
|
+
const answer = parseAnswerMessage(text);
|
|
147
|
+
if (answer) return { type: "plugin" as const, kind: ANSWER_KIND, version: 1, data: { ...answer, text } as Record<string, unknown> };
|
|
148
|
+
const card = parseBatchPrompt(text);
|
|
149
|
+
return card ? { type: "plugin" as const, kind: BATCH_KIND, version: 1, data: card as Record<string, unknown> } : null;
|
|
150
|
+
}
|
|
151
|
+
|
|
141
152
|
export function contributeChat(client: PluginClientContext) {
|
|
142
153
|
// A host whose client API has no timeline transformers or renderers keeps every plain row.
|
|
143
154
|
if (!timelineSupported(client)) return () => {};
|
|
@@ -159,12 +170,10 @@ export function contributeChat(client: PluginClientContext) {
|
|
|
159
170
|
client.addTimelineTransformer({
|
|
160
171
|
id: "follow-batch-prompts", query: { itemType: "user_message" },
|
|
161
172
|
transform({ item }) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
const card = parseBatchPrompt(item.text);
|
|
167
|
-
return card ? { items: [{ type: "plugin" as const, kind: BATCH_KIND, version: 1, data: card }] } : undefined;
|
|
173
|
+
// One message can carry several parts (an answer and the repairs that rode along, shared/queue.ts): a card each,
|
|
174
|
+
// in order. A part no card recognises keeps the whole message as Paseo's plain row.
|
|
175
|
+
const cards = envelopeParts(item.text).map(promptCard);
|
|
176
|
+
return cards.every(Boolean) ? { items: cards as never } : undefined;
|
|
168
177
|
},
|
|
169
178
|
}),
|
|
170
179
|
client.addTimelineRenderer({ kind: TOOL_KIND, version: 1, schema: toolRowSchema, Component: ToolRowView }),
|
package/client/display.tsx
CHANGED
|
@@ -3,9 +3,10 @@ import { useRpc, useSettings } from "@getpaseo/plugin/client";
|
|
|
3
3
|
import { useQuery } from "@tanstack/react-query";
|
|
4
4
|
import { displayFeed, inboxListRpc, trustBypassRpc } from "../shared/contracts";
|
|
5
5
|
import { openFeed } from "./feeds";
|
|
6
|
-
import { SettingsAction, SettingsCard, SettingsSection, SettingsSwitch } from "@getpaseo/plugin/client/ui";
|
|
6
|
+
import { SettingsAction, SettingsCard, SettingsSection, SettingsSelect, SettingsSwitch } from "@getpaseo/plugin/client/ui";
|
|
7
|
+
import { isMac, searchShortcutOf, searchShortcutOptions, type SearchShortcut } from "../shared/search-key";
|
|
7
8
|
import { useEffect } from "react";
|
|
8
|
-
import { ActivityIndicator, View } from "react-native";
|
|
9
|
+
import { ActivityIndicator, Platform, View } from "react-native";
|
|
9
10
|
import { Text } from "./text";
|
|
10
11
|
import { displayPreferences, displayRpc, trustCountText } from "../shared/display";
|
|
11
12
|
import { sidebarVisibility } from "./sidebar-visibility";
|
|
@@ -97,6 +98,13 @@ export function DisplaySections({ theme }: Pick<PluginSurfaceProps, "theme">) {
|
|
|
97
98
|
</SettingsCard>
|
|
98
99
|
{settings.saveError && <Text accessibilityRole="alert" style={{ color: theme.colors.statusDanger }}>{settings.saveError}</Text>}
|
|
99
100
|
</SettingsSection>
|
|
101
|
+
{Platform.OS === "web" && <SettingsSection title="Keyboard" info="Follow-up's key never takes one Paseo uses, and inside a code editor the editor keeps it. Pick None to keep it free.">
|
|
102
|
+
<SettingsCard>
|
|
103
|
+
<SettingsSelect label="Search from anywhere" hint="Jumps to Home's search from any screen, even mid-message. On Home, / works too."
|
|
104
|
+
value={searchShortcutOf(settings.values.search_shortcut)} options={searchShortcutOptions(isMac())} disabled={settings.saving}
|
|
105
|
+
onValueChange={(search_shortcut: SearchShortcut) => save({ search_shortcut })} />
|
|
106
|
+
</SettingsCard>
|
|
107
|
+
</SettingsSection>}
|
|
100
108
|
<SettingsSection title="Needs-you inbox" trailing={<BetaChip theme={theme} />} info="Agents stay in Needs you until you sign them off or write to them. Opening an agent doesn't clear it.">
|
|
101
109
|
<SettingsCard>
|
|
102
110
|
<SettingsSwitch label="Needs-you inbox" hint="Off: no agent is flagged. The pill still shows workspace items, and the sidebar badge counts workspaces instead." value={settings.values.enable_inbox} disabled={settings.saving} onValueChange={(enable_inbox) => save({ enable_inbox })} />
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PluginSvgIcon } from "@getpaseo/plugin/client";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Follow-up's own mark: a loop that runs on from a start ring to a filled dot (the work, followed until it's done).
|
|
5
|
+
* One 24-unit glyph in `currentColor`, so the host `Icon` colours it with the theme. It is the brand icon on every
|
|
6
|
+
* surface that stands for Follow-up itself (sidebar row, header button, panel tab, Settings, the open command, the
|
|
7
|
+
* large view's empty state). Pull requests keep lucide GitPullRequest. assets/icon.svg is the same mark on the app tile.
|
|
8
|
+
* tests/follow-up-icon.test.ts checks it with the SDK's validator and that no brand surface falls back to GitPullRequest.
|
|
9
|
+
*/
|
|
10
|
+
export const FOLLOW_UP_ICON: PluginSvgIcon = {
|
|
11
|
+
svg: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.2 19C11 19 15.6 17.8 15.6 13.6C15.6 10.9 13.6 9.6 11.9 9.6C10.2 9.6 8.6 10.9 8.6 12.9C8.6 15.3 11 16.2 13 15.1C15.2 13.9 15.9 10.5 16.6 7.8" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/><circle cx="4.6" cy="19" r="2.3" fill="none" stroke="currentColor" stroke-width="1.6"/><circle cx="17.4" cy="4.9" r="2.9" fill="currentColor"/></svg>`,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** Where the end dot sits, as a fraction of the icon box: the header button's Needs-you badge covers it. */
|
|
15
|
+
export const FOLLOW_UP_DOT = { x: 17.4 / 24, y: 4.9 / 24 };
|
|
16
|
+
|
|
17
|
+
/** The header button's Needs-you dot, in px. */
|
|
18
|
+
export const NEED_DOT = 7;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Where the Needs-you dot goes in a `size` icon box: centred on the end dot, clamped inside the box. Paseo draws a
|
|
22
|
+
* header button's icon in a box of exactly that size with `overflow: hidden` (`ButtonIcon`, 16 px on 0.15 and 0.16),
|
|
23
|
+
* so any part outside it is cut off: centred at 16 px the dot's top sat 0.23 px above the box and drew flat-topped.
|
|
24
|
+
*/
|
|
25
|
+
export function needDotBox(size: number): { left: number; top: number } {
|
|
26
|
+
const clamp = (v: number) => Math.min(Math.max(v, 0), Math.max(size - NEED_DOT, 0));
|
|
27
|
+
return { left: clamp(size * FOLLOW_UP_DOT.x - NEED_DOT / 2), top: clamp(size * FOLLOW_UP_DOT.y - NEED_DOT / 2) };
|
|
28
|
+
}
|
package/client/home-chrome.tsx
CHANGED
|
@@ -64,9 +64,9 @@ export function useOmnibox(model: HomeModel, sources: HomeSources, extraProvider
|
|
|
64
64
|
const current = active ?? fallback;
|
|
65
65
|
const move = useCallback((delta: number) => setActive(a => Math.max(0, Math.min((results?.length ?? 1) - 1, (a ?? fallback) + delta))), [results, fallback]);
|
|
66
66
|
// ⌘K "Follow-up: Search".
|
|
67
|
+
// A request made before this field mounted (the search key opening Home) is taken on mount.
|
|
67
68
|
const token = useSyncExternalStore(sources.extras.subscribe, sources.extras.focusToken, sources.extras.focusToken);
|
|
68
|
-
|
|
69
|
-
useEffect(() => { if (token !== first.current) inputRef.current?.focus(); }, [token]);
|
|
69
|
+
useEffect(() => { if (sources.extras.takeFocus()) inputRef.current?.focus(); }, [token, sources.extras]);
|
|
70
70
|
return { query, setQuery, results, active: Math.min(current, Math.max(0, (results?.length ?? 1) - 1)), move, inputRef, askOn };
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -92,7 +92,7 @@ export function useSlashToFocus(omnibox: Omnibox, enabled = true) {
|
|
|
92
92
|
* The one query field: Home's omnibox (SearchField) and the sidebar view's filter (FilterField) are this with
|
|
93
93
|
* different words. `dense` is the phone layout: a 44px field with a rounder shape and body-size text.
|
|
94
94
|
*/
|
|
95
|
-
export function QueryField({ theme, value, onChange, placeholder, icon, dense, inputRef, slashHint, onSubmit, onArrow, listKeys = false, count, autoFocus = false, onEscape }: {
|
|
95
|
+
export function QueryField({ theme, value, onChange, placeholder, icon, dense, inputRef, slashHint, slashTitle, onSubmit, onArrow, listKeys = false, count, autoFocus = false, onEscape }: {
|
|
96
96
|
/** Its arrows step into the list below (client/list-keys.ts): the sidebar filter, and Home's search while empty. */
|
|
97
97
|
listKeys?: boolean;
|
|
98
98
|
/** "2 of 12" at the field's end (a panel section's search), in place of the field's own ✕: the section has its own. */
|
|
@@ -101,7 +101,10 @@ export function QueryField({ theme, value, onChange, placeholder, icon, dense, i
|
|
|
101
101
|
/** Esc's own action (a section search closes); without it Esc clears, then leaves the field. */
|
|
102
102
|
onEscape?: () => void;
|
|
103
103
|
theme: Theme; value: string; onChange: (q: string) => void; placeholder: string; icon: string; dense: boolean;
|
|
104
|
-
|
|
104
|
+
/** The key chip at the field's end (web, desktop width): "/" or the search-from-anywhere key; false for none. */
|
|
105
|
+
/** The chip's hover title (web): what each key does. */
|
|
106
|
+
slashTitle?: string;
|
|
107
|
+
inputRef: { current: TextInput | null }; slashHint: string | false; onSubmit?: () => void; onArrow?: (delta: number) => void;
|
|
105
108
|
}) {
|
|
106
109
|
const c = theme.colors;
|
|
107
110
|
const [focused, setFocused] = useState(false);
|
|
@@ -124,14 +127,19 @@ export function QueryField({ theme, value, onChange, placeholder, icon, dense, i
|
|
|
124
127
|
: !!value && <Pressable accessibilityRole="button" accessibilityLabel={`Clear ${placeholder.toLowerCase()}`} hitSlop={dense ? 14 : 8} onPress={() => { onChange(""); inputRef.current?.focus(); }}>
|
|
125
128
|
<Icon name="X" size={dense ? 16 : 13} color={c.foregroundMuted} />
|
|
126
129
|
</Pressable>}
|
|
127
|
-
{slashHint && !value && !focused && !dense && Platform.OS === "web" && <Text style={{ color: c.foregroundMuted, fontSize: 11, paddingHorizontal: 4, borderRadius: 3, borderWidth: 1, borderColor: c.border }}
|
|
130
|
+
{slashHint && !value && !focused && !dense && Platform.OS === "web" && <Text accessibilityElementsHidden importantForAccessibility="no" {...(slashTitle ? { title: slashTitle } as object : null)} style={{ color: c.foregroundMuted, fontSize: 11, paddingHorizontal: 4, borderRadius: 3, borderWidth: 1, borderColor: c.border, fontVariant: ["tabular-nums"] }}>{slashHint}</Text>}
|
|
128
131
|
</View>;
|
|
129
132
|
}
|
|
130
133
|
|
|
131
|
-
|
|
134
|
+
/**
|
|
135
|
+
* Home's search. Its chip names the search-from-anywhere key when one is set (it works here too), else "/"; plain "/"
|
|
136
|
+
* focuses it on Home either way (useSlashToFocus).
|
|
137
|
+
*/
|
|
138
|
+
export function SearchField({ theme, omnibox, dense, onEnter, anywhereKey }: { theme: Theme; omnibox: Omnibox; dense: boolean; onEnter: (item: OmniboxItem) => void; anywhereKey?: string | null }) {
|
|
132
139
|
const { query, setQuery, results, active, move, inputRef, askOn } = omnibox;
|
|
133
140
|
const placeholder = askOn ? dense ? "Search or ask the Overseer" : "Search, or ask the Overseer" : "Search workspaces, branches, PRs";
|
|
134
|
-
return <QueryField theme={theme} value={query} onChange={setQuery} placeholder={placeholder} icon="Search" dense={dense} inputRef={inputRef} slashHint
|
|
141
|
+
return <QueryField theme={theme} value={query} onChange={setQuery} placeholder={placeholder} icon="Search" dense={dense} inputRef={inputRef} slashHint={anywhereKey || "/"}
|
|
142
|
+
slashTitle={anywhereKey ? `${anywhereKey} from anywhere · / on Home` : "/ focuses the search"}
|
|
135
143
|
onSubmit={() => { const item = results?.[active]; if (item) onEnter(item); }} onArrow={move} listKeys={!query.trim()} />;
|
|
136
144
|
}
|
|
137
145
|
|
package/client/home-list.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { memo, useCallback, useEffect, useMemo, useRef, useState, type ReactNode
|
|
|
2
2
|
import { View, type FlatList as NativeFlatList } from "react-native";
|
|
3
3
|
import { Pressable, Text } from "./text";
|
|
4
4
|
import { Icon, FlatList } from "@getpaseo/plugin/client/ui";
|
|
5
|
-
import { type Badge, type HomeGroupId, type HomeModel, type Workstream } from "../shared/home";
|
|
5
|
+
import { type Badge, type HomeGroupId, type HomeModel, type Workstream, railChips } from "../shared/home";
|
|
6
6
|
import { ASK_KEY, excerpt, FIELD_LABEL, type OmniboxItem, type Range, type RowHit, type SearchHit } from "../shared/search";
|
|
7
7
|
import { AskRow, PriorityLine } from "./home-chrome";
|
|
8
8
|
import { age, wakeLabel, wakeShort } from "../shared/inbox";
|
|
@@ -250,7 +250,7 @@ const badgeColor = (b: Badge, c: Colors) => b.tone === "danger" ? c.statusDanger
|
|
|
250
250
|
|
|
251
251
|
export function BadgeView({ b, c }: { b: Badge; c: Colors }) {
|
|
252
252
|
const col = badgeColor(b, c);
|
|
253
|
-
return <View style={{ paddingHorizontal: 6, height: 20, justifyContent: "center", borderRadius: 4, backgroundColor: b.tone === "muted" ? c.surface2 : tint(col, c) }}>
|
|
253
|
+
return <View testID="follow-up-row-chip" style={{ flexShrink: 1, minWidth: 0, paddingHorizontal: 6, height: 20, justifyContent: "center", borderRadius: 4, backgroundColor: b.tone === "muted" ? c.surface2 : tint(col, c) }}>
|
|
254
254
|
<Text numberOfLines={1} style={{ color: col, fontSize: 11, lineHeight: 14, fontWeight: "500" }}>{b.text}</Text>
|
|
255
255
|
</View>;
|
|
256
256
|
}
|
|
@@ -258,10 +258,10 @@ export function BadgeView({ b, c }: { b: Badge; c: Colors }) {
|
|
|
258
258
|
export function PrChipView({ s, c }: { s: Workstream; c: Colors }) {
|
|
259
259
|
if (!s.pr) return null;
|
|
260
260
|
const checks = s.pr.checks;
|
|
261
|
-
return <View style={{ flexDirection: "row", alignItems: "center", gap: 4, paddingHorizontal: 6, height: 20, borderRadius: 4, borderWidth: 1, borderColor: c.border }}>
|
|
261
|
+
return <View testID="follow-up-row-chip" style={{ flexShrink: 1, minWidth: 0, flexDirection: "row", alignItems: "center", gap: 4, paddingHorizontal: 6, height: 20, borderRadius: 4, borderWidth: 1, borderColor: c.border }}>
|
|
262
262
|
<Icon name="GitPullRequest" size={11} color={toneColor(c, s.pr.tone)} />
|
|
263
|
-
<Text style={{ color: c.foreground, fontSize: 11, lineHeight: 14, fontVariant: ["tabular-nums"] }}>{s.pr.label}</Text>
|
|
264
|
-
{checks && <Text style={{ color: checks.tone === "muted" ? c.foregroundMuted : badgeColor({ text: "", tone: checks.tone }, c), fontSize: 11, lineHeight: 14 }}>{checks.text}</Text>}
|
|
263
|
+
<Text numberOfLines={1} style={{ flexShrink: 0, color: c.foreground, fontSize: 11, lineHeight: 14, fontVariant: ["tabular-nums"] }}>{s.pr.label}</Text>
|
|
264
|
+
{checks && <Text numberOfLines={1} style={{ flexShrink: 1, minWidth: 0, color: checks.tone === "muted" ? c.foregroundMuted : badgeColor({ text: "", tone: checks.tone }, c), fontSize: 11, lineHeight: 14 }}>{checks.text}</Text>}
|
|
265
265
|
</View>;
|
|
266
266
|
}
|
|
267
267
|
|
|
@@ -281,7 +281,21 @@ export function WakeTime({ until, c, size = 12 }: { until: string; c: Colors; si
|
|
|
281
281
|
}
|
|
282
282
|
/** The right-hand time: when a Later row comes back, otherwise how long ago. */
|
|
283
283
|
function RowTime({ s, c, size }: { s: Workstream; c: Colors; size: number }) {
|
|
284
|
-
return s.group === "later" && s.wakeAt ? <WakeTime until={s.wakeAt} c={c} size={size} /> : <Age iso={s.at} c={c} size={size}
|
|
284
|
+
return <View testID="follow-up-row-time" style={{ flexShrink: 0 }}>{s.group === "later" && s.wakeAt ? <WakeTime until={s.wakeAt} c={c} size={size} /> : <Age iso={s.at} c={c} size={size} />}</View>;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* row-chips-never-cover-the-time: a desktop row's badges and PR chip, in priority order (most telling first). They yield
|
|
289
|
+
* before the time column ever moves: the rail shrinks first, a chip that doesn't fit wraps onto a second line the rail
|
|
290
|
+
* clips (so the lowest-priority chips drop, last first), and a lone chip truncates. Guarded by
|
|
291
|
+
* `scripts/screenshots.mjs --only rowchips` (CDP boxes at list widths 320, 360 and 400) and tests/row-chips.test.ts.
|
|
292
|
+
*/
|
|
293
|
+
function ChipRail({ s, c }: { s: Workstream; c: Colors }) {
|
|
294
|
+
const chips = railChips(s);
|
|
295
|
+
if (chips.length === 0) return null;
|
|
296
|
+
return <View testID="follow-up-row-chips" style={{ flexShrink: 1000, minWidth: 0, height: 20, overflow: "hidden", flexDirection: "row", flexWrap: "wrap", justifyContent: "flex-end", columnGap: 10, rowGap: 4 }}>
|
|
297
|
+
{chips.map(ch => ch.kind === "badge" ? <BadgeView key={ch.badge.text} b={ch.badge} c={c} /> : <PrChipView key="pr" s={s} c={c} />)}
|
|
298
|
+
</View>;
|
|
285
299
|
}
|
|
286
300
|
|
|
287
301
|
/** The age on the right. It re-renders on the shared minute clock without touching its row. */
|
|
@@ -325,7 +339,9 @@ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMe
|
|
|
325
339
|
// A Later row says when it comes back on screen; the label also keeps how long it has waited.
|
|
326
340
|
const wake = s.group === "later" && s.wakeAt ? wakeLabel({ until: s.wakeAt, at: s.at ?? new Date().toISOString() }, Date.now()) : "";
|
|
327
341
|
const waited = s.group === "later" && s.at ? age(s.at, Date.now()) : "";
|
|
328
|
-
const label = [s.title + (s.agent ? ` › ${s.agent}` : ""), s.word, s.line, hit?.via && `${FIELD_LABEL[hit.via.field]}: ${hit.via.text}`,
|
|
342
|
+
const label = [s.title + (s.agent ? ` › ${s.agent}` : ""), s.word, s.line, hit?.via && `${FIELD_LABEL[hit.via.field]}: ${hit.via.text}`,
|
|
343
|
+
// Every chip, even one a narrow row hides (row-chips-never-cover-the-time).
|
|
344
|
+
...s.badges.map(b => b.text), s.pr && `Pull request ${s.pr.label}${s.pr.checks ? ` ${s.pr.checks.text}` : ""}`, wake && `Later until ${wake}`, waited && (waited === "now" ? "just now" : `waiting ${waited}`)].filter(Boolean).join(". ");
|
|
329
345
|
return <Pressable ref={trigger.ref} nativeID={rowDomId(s.key)} accessibilityRole="button" accessibilityState={{ selected }} accessibilityLabel={label} accessibilityHint={quickActionsHint(touch)}
|
|
330
346
|
onPress={() => onSelect(s.key)} onLongPress={trigger.onLongPress} delayLongPress={450}
|
|
331
347
|
style={state => ({ ...focusRing((state as { focused?: boolean }).focused, c, true), flexDirection: "row", alignItems: dense ? "flex-start" : "center", gap: touch ? 10 : dense ? 8 : 10, minHeight: touch ? 56 : dense ? 36 : 38, paddingLeft: touch ? 14 : dense ? 8 : 16, paddingRight: touch ? 16 : dense ? 8 : 16, paddingVertical: touch ? 12 : dense ? 6 : 0,
|
|
@@ -359,12 +375,16 @@ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMe
|
|
|
359
375
|
{s.badges.map(b => <BadgeView key={b.text} b={b} c={c} />)}<PrChipView s={s} c={c} />
|
|
360
376
|
</View>}
|
|
361
377
|
</View> : <View style={{ flex: 1, minWidth: 0, gap: 1, paddingVertical: s.priority?.reason ? 4 : 0 }}><View style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
|
|
362
|
-
|
|
363
|
-
<Text numberOfLines={1} style={{
|
|
364
|
-
|
|
378
|
+
{/* The title keeps its width (up to 55 %) and the chips yield; only beside Send now, which can't, does it shrink. */}
|
|
379
|
+
<Text numberOfLines={1} style={{ flexShrink: sendNow ? 1 : 0, minWidth: 0, maxWidth: "55%", color: muted ? c.foregroundMuted : c.foreground, fontSize: 13, fontWeight: muted ? "400" : "500" }}>{title}</Text>
|
|
380
|
+
{/* A Needs-you row's word (Permission, Question…) is why it's there: it keeps its place, the chips yield first. */}
|
|
381
|
+
{!via && s.word && s.group === "needs" ? <Text numberOfLines={1} style={{ flexShrink: 0, color, fontSize: 12 }}>{s.word}</Text> : null}
|
|
382
|
+
{/* -10 takes back the row gap and the separator opens with a no-break space (a leading plain space is trimmed), so
|
|
383
|
+
"Permission · Accept…" reads as one line, and the dot goes with the line when there's no room for it. */}
|
|
384
|
+
<Text numberOfLines={1} style={{ flex: 1, minWidth: 0, color: c.foregroundMuted, fontSize: 12, marginLeft: !via && s.word && s.group === "needs" ? -10 : 0 }}>
|
|
385
|
+
{via ?? <>{s.word && s.group === "needs" && s.line ? "\u00a0· " : ""}{line}</>}
|
|
365
386
|
</Text>
|
|
366
|
-
|
|
367
|
-
<PrChipView s={s} c={c} />
|
|
387
|
+
<ChipRail s={s} c={c} />
|
|
368
388
|
{sendNow}
|
|
369
389
|
</View>{!!s.priority?.reason && <View style={{ paddingRight: 40 }}><PriorityLine reason={s.priority.reason} source={s.priority.source} c={c} /></View>}</View>}
|
|
370
390
|
{!touch && <RowTime s={s} c={c} size={dense ? 11 : 12} />}
|
package/client/home-view.ts
CHANGED
|
@@ -43,7 +43,7 @@ export function createHomeExtras(client: PluginClientContext) {
|
|
|
43
43
|
let rank: RpcOutput<typeof rankStatusRpc> | null = null;
|
|
44
44
|
const agents = new Map<string, AgentLite>();
|
|
45
45
|
let version = 0;
|
|
46
|
-
let focusToken = 0;
|
|
46
|
+
let focusToken = 0; let focusPending = false;
|
|
47
47
|
let stopped = false;
|
|
48
48
|
const listeners = new Set<() => void>();
|
|
49
49
|
let pending: ReturnType<typeof setTimeout> | null = null;
|
|
@@ -222,9 +222,15 @@ export function createHomeExtras(client: PluginClientContext) {
|
|
|
222
222
|
/** Settings → Agents changed: a new Overseer on the configured agent, handed the old one's last steps. */
|
|
223
223
|
async restartOverseer() { overseer = await client.rpc(overseerRestartRpc, {}); emit(); return overseer; },
|
|
224
224
|
agents: () => [...agents.values()],
|
|
225
|
-
/** Bumped by ⌘K "Follow-up: Search"; the visible search field focuses when it changes. */
|
|
225
|
+
/** Bumped by ⌘K "Follow-up: Search" and the search key; the visible search field focuses when it changes. */
|
|
226
226
|
focusToken: () => focusToken,
|
|
227
|
-
|
|
227
|
+
/**
|
|
228
|
+
* Asks Home's search to take the cursor: now if Home is mounted, else as soon as it mounts (a Home opened by this
|
|
229
|
+
* very request mounts after the call, so a bare token bump would be missed).
|
|
230
|
+
*/
|
|
231
|
+
focusSearch() { focusToken++; focusPending = true; emit(); },
|
|
232
|
+
/** True once per focusSearch: the search field that takes it focuses. */
|
|
233
|
+
takeFocus() { const was = focusPending; focusPending = false; return was; },
|
|
228
234
|
/** Calls `listener` when an agent's status, attention or permissions change (see above). */
|
|
229
235
|
onActivity(listener: () => void) { activity.add(listener); return () => { activity.delete(listener); }; },
|
|
230
236
|
/** Each update Paseo sends about one agent (null when it's removed). */
|
package/client/home.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
1
|
+
import { type ReactNode, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
2
2
|
import { browserKey } from "./keys";
|
|
3
3
|
import { Platform, TextInput, useWindowDimensions, View } from "react-native";
|
|
4
4
|
import { Pressable, Text } from "./text";
|
|
5
|
-
import { usePaseo, useRpc, type PluginScreenProps } from "@getpaseo/plugin/client";
|
|
5
|
+
import { usePaseo, useRpc, useSettings, type PluginScreenProps } from "@getpaseo/plugin/client";
|
|
6
6
|
import { Icon, ScrollView, Modal, useToast } from "@getpaseo/plugin/client/ui";
|
|
7
7
|
import { useQuery } from "@tanstack/react-query";
|
|
8
8
|
import { browserStatusRpc, controlRpc, inboxBriefRpc, sendRpc } from "../shared/contracts";
|
|
@@ -34,6 +34,11 @@ import { withAlpha, isLight, mergedColor, type Colors } from "./theme";
|
|
|
34
34
|
import { UpdateNotice, VersionMark } from "./updates";
|
|
35
35
|
import { WhatsNewGate } from "./release-notes";
|
|
36
36
|
import { ViewSync } from "./view-store";
|
|
37
|
+
import { ResizableSplit } from "./split";
|
|
38
|
+
import type { SearchKey } from "./search-key";
|
|
39
|
+
|
|
40
|
+
import { displayPreferences, displayRpc, writeDisplay, HOME_DETAIL_DEFAULT, HOME_DETAIL_MAX, HOME_DETAIL_MIN, type DisplayClient } from "../shared/display";
|
|
41
|
+
import { subscribeDisplay } from "./display";
|
|
37
42
|
import { useRowMenu } from "./row-actions";
|
|
38
43
|
import { laterChoices } from "../shared/row-menu";
|
|
39
44
|
import { PrLinksProvider, RichText } from "./rich-text";
|
|
@@ -41,6 +46,10 @@ import { TOAST_ANCHOR, ToastHost, useQuestionOpener } from "./toasts";
|
|
|
41
46
|
import { openRowCopy, useDetailGate, useWorkspace } from "./workspace-data";
|
|
42
47
|
import type { ListWorkspace } from "../shared/list";
|
|
43
48
|
|
|
49
|
+
/** Home without a search key (tests, older wiring): no subscription, no label. */
|
|
50
|
+
const noSubscribe = () => () => undefined;
|
|
51
|
+
const noLabel = () => null;
|
|
52
|
+
|
|
44
53
|
export const HOME_SCREEN = "follow-up";
|
|
45
54
|
|
|
46
55
|
const mono = Platform.OS === "ios" ? "Menlo" : "ui-monospace, SFMono-Regular, Menlo, monospace";
|
|
@@ -56,6 +65,8 @@ export type HomeDeps = {
|
|
|
56
65
|
/** Phones: open one Home item as its own screen, so the host's ← (and Android back) returns to the list. */
|
|
57
66
|
openItem?(key: string, extra?: { question?: string }): void;
|
|
58
67
|
briefDeps: BriefDeps;
|
|
68
|
+
/** The search-from-anywhere key (client/search-key.ts), for the search field's chip. */
|
|
69
|
+
searchKey?: SearchKey;
|
|
59
70
|
};
|
|
60
71
|
|
|
61
72
|
/**
|
|
@@ -82,6 +93,8 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
|
|
|
82
93
|
const compact = layout.compact;
|
|
83
94
|
const model = useHomeModel(deps.sources);
|
|
84
95
|
const omnibox = useOmnibox(model, deps.sources);
|
|
96
|
+
const searchKey = deps.searchKey;
|
|
97
|
+
const anywhereKey = useSyncExternalStore(searchKey?.subscribe ?? noSubscribe, searchKey?.label ?? noLabel, searchKey?.label ?? noLabel);
|
|
85
98
|
useSlashToFocus(omnibox, params.view !== "log");
|
|
86
99
|
const [filter, setFilter] = useState<HomeGroupId | null>(null);
|
|
87
100
|
const [selected, setSelected] = useState<string | null>(() => params.item ?? (params.select ? `agent:${params.select}` : null));
|
|
@@ -201,7 +214,7 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
|
|
|
201
214
|
{/* zIndex: on web every View is its own stacking context, so the sort menu only paints and hit-tests above the
|
|
202
215
|
strip and meters below if this row sits above them. */}
|
|
203
216
|
<View style={{ zIndex: 2, flexDirection: "row", alignItems: "center", gap: compact ? 2 : 6, paddingLeft: compact ? 16 : 16, paddingRight: compact ? 6 : 16 }}>
|
|
204
|
-
<SearchField theme={theme} omnibox={omnibox} dense={compact} onEnter={item => void pick(item)} />
|
|
217
|
+
<SearchField theme={theme} omnibox={omnibox} dense={compact} onEnter={item => void pick(item)} anywhereKey={anywhereKey} />
|
|
205
218
|
{!(compact && nothing) && <SortMenu theme={theme} mode={model.sort} onChange={deps.sources.extras.setSort} rankedAt={model.rankedAt} touch={compact} rank={rank} onRerank={deps.sources.extras.rankNow} />}
|
|
206
219
|
{compact && <IconButton theme={theme} compact icon="Settings" label="Follow-up settings" onPress={deps.openSettings} />}
|
|
207
220
|
</View>
|
|
@@ -225,15 +238,43 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
|
|
|
225
238
|
<View style={{ position: "absolute", left: 12, right: 12, bottom: bottomGap(true) + (current || selected === OVERSEER_KEY ? 132 : 0) }}><UndoBar store={inbox} theme={theme} touch /></View>
|
|
226
239
|
</View>;
|
|
227
240
|
return <View ref={homeRef} style={{ flex: 1, flexDirection: "row", backgroundColor: c.surface0 }}>
|
|
228
|
-
<View style={{ flex: 1, minWidth: 0
|
|
241
|
+
<HomeSplit theme={theme} detail={detail} main={<View style={{ flex: 1, minWidth: 0 }}>
|
|
229
242
|
{list}
|
|
230
243
|
{updateSheets}
|
|
231
244
|
<View style={{ position: "absolute", left: 12, right: 12, bottom: 12 }}><UndoBar store={inbox} theme={theme} touch={false} /></View>
|
|
232
|
-
</View>
|
|
233
|
-
<View style={{ width: "42%", minWidth: 380, maxWidth: 680 }}>{detail}</View>
|
|
245
|
+
</View>} />
|
|
234
246
|
</View>;
|
|
235
247
|
}
|
|
236
248
|
|
|
249
|
+
/**
|
|
250
|
+
* Home's list beside its right pane (the brief, or the selected item), with the divider between them
|
|
251
|
+
* (side-panes-are-resizable). The pane's share is the Display setting `home_detail_fraction`, so set_display reaches it.
|
|
252
|
+
*/
|
|
253
|
+
function HomeSplit({ theme, main, detail }: { theme: Theme; main: ReactNode; detail: ReactNode }) {
|
|
254
|
+
const settings = useSettings(displayPreferences);
|
|
255
|
+
const readDisplay = useRpc(displayRpc.read); const saveDisplay = useRpc(displayRpc.write);
|
|
256
|
+
const toast = useToast();
|
|
257
|
+
// The host's settings read paints first; the Display feed (an agent's set_display, another device) and this
|
|
258
|
+
// device's own saves replace it. undefined = never set (the default); null = nothing pushed yet.
|
|
259
|
+
const [pushed, setPushed] = useState<number | undefined | null>(null);
|
|
260
|
+
useEffect(() => subscribeDisplay(values => setPushed(values.home_detail_fraction)), []);
|
|
261
|
+
const fraction = pushed !== null ? pushed : settings.status === "ready" ? settings.values.home_detail_fraction : undefined;
|
|
262
|
+
const commit = (next: number) => {
|
|
263
|
+
setPushed(next);
|
|
264
|
+
const client: DisplayClient = { rpc: (contract, input) => (contract as unknown) === displayRpc.read ? readDisplay(input as never) : saveDisplay(input as never) };
|
|
265
|
+
void writeDisplay(client, { home_detail_fraction: next })
|
|
266
|
+
.then(ok => { if (!ok) toast.error("Couldn't save the pane's width. It resets when Home reopens."); })
|
|
267
|
+
.catch(e => toast.error(errorText(e)));
|
|
268
|
+
};
|
|
269
|
+
return <ResizableSplit theme={theme} main={main} side={detail} testID="follow-up-home-split" label="Resize the detail pane"
|
|
270
|
+
fraction={fraction} defaultFraction={HOME_DETAIL_DEFAULT} range={[HOME_DETAIL_MIN, HOME_DETAIL_MAX]}
|
|
271
|
+
minSide={HOME_DETAIL_MIN_PX} minMain={HOME_LIST_MIN_PX} onCommit={commit} />;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/** The right pane is never narrower than this, and the list keeps at least HOME_LIST_MIN_PX (its rows keep their reason line). */
|
|
275
|
+
const HOME_DETAIL_MIN_PX = 360;
|
|
276
|
+
const HOME_LIST_MIN_PX = 480;
|
|
277
|
+
|
|
237
278
|
function ListHeader({ theme, compact, onSettings }: { theme: Theme; compact: boolean; onSettings: () => void }) {
|
|
238
279
|
const c = theme.colors;
|
|
239
280
|
return <View style={{ flexDirection: "row", alignItems: "center", gap: 8, paddingHorizontal: 16 }}>
|
package/client/kit.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { useEffect, useRef, useState, type ReactNode } from "react";
|
|
|
2
2
|
import { Platform, View, type StyleProp, type ViewStyle } from "react-native";
|
|
3
3
|
import { Pressable, Text } from "./text";
|
|
4
4
|
import { Icon } from "@getpaseo/plugin/client/ui";
|
|
5
|
-
import { openExternalUrl } from "@getpaseo/plugin/client";
|
|
5
|
+
import { openExternalUrl, type PluginSvgIcon } from "@getpaseo/plugin/client";
|
|
6
6
|
import { PressScale, Spinner } from "./motion";
|
|
7
7
|
import { raised, tint, withAlpha, type Colors, type Theme } from "./theme";
|
|
8
8
|
|
|
@@ -173,14 +173,14 @@ export type CardTone = "plain" | "attention" | "success";
|
|
|
173
173
|
* is being searched (client/section-search.tsx), and its field takes the title's place in the header.
|
|
174
174
|
*/
|
|
175
175
|
export function Card({ theme, icon, title, tone = "plain", count, right, children, compact = false, style, search }: {
|
|
176
|
-
theme: Theme; icon: string; title: string; tone?: CardTone; count?: string | number; right?: ReactNode; children: ReactNode; compact?: boolean; style?: StyleProp<ViewStyle>; search?: ReactNode;
|
|
176
|
+
theme: Theme; icon: string | PluginSvgIcon; title: string; tone?: CardTone; count?: string | number; right?: ReactNode; children: ReactNode; compact?: boolean; style?: StyleProp<ViewStyle>; search?: ReactNode;
|
|
177
177
|
}) {
|
|
178
178
|
const c = theme.colors;
|
|
179
179
|
const accent = tone === "attention" ? c.statusWarning : tone === "success" ? c.statusSuccess : null;
|
|
180
180
|
return <View style={[{ marginHorizontal: compact ? 16 : 12, marginTop: 12, borderRadius: 8, overflow: "hidden", backgroundColor: c.surface0 },
|
|
181
181
|
accent ? { borderWidth: 1, borderColor: withAlpha(accent, 0.7) } : raised(c), style]}>
|
|
182
182
|
<View style={{ flexDirection: "row", alignItems: "center", gap: compact ? 8 : 7, paddingHorizontal: compact ? 14 : 12, paddingTop: 10, paddingBottom: 8, minHeight: compact ? 44 : undefined }}>
|
|
183
|
-
<Icon name={icon} size={compact ? 16 : 14} color={accent ?? c.foregroundMuted} />
|
|
183
|
+
{typeof icon === "string" ? <Icon name={icon} size={compact ? 16 : 14} color={accent ?? c.foregroundMuted} /> : <Icon icon={icon} size={compact ? 16 : 14} color={accent ?? c.foregroundMuted} />}
|
|
184
184
|
{search ?? <>
|
|
185
185
|
<Text accessibilityRole="header" style={{ color: accent ?? c.foreground, fontSize: compact ? 14 : 13, lineHeight: compact ? 20 : 18, fontWeight: "600" }}>{title}</Text>
|
|
186
186
|
{count !== undefined && count !== "" && <Chip theme={theme} color={accent ?? c.foregroundMuted} label={String(count)} />}
|
package/client/large.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import { useWorkspace } from "./workspace-data";
|
|
|
6
6
|
import type { LiveStore } from "./live";
|
|
7
7
|
import { Button, Card, CardRow, errorText, text } from "./kit";
|
|
8
8
|
import { Skeleton } from "./motion";
|
|
9
|
+
import { FOLLOW_UP_ICON } from "./follow-up-icon";
|
|
9
10
|
import { PanelTop, WorkspaceView, useSessionFolds, type PanelLinks } from "./panel";
|
|
10
11
|
|
|
11
12
|
export const LARGE_SCREEN = "follow-up-workspace";
|
|
@@ -44,7 +45,7 @@ export function FollowLarge(props: PluginScreenProps & PanelLinks & { live?: Liv
|
|
|
44
45
|
</View>;
|
|
45
46
|
const w = query.workspace;
|
|
46
47
|
if (!w) return <View style={{ flex: 1, backgroundColor: c.surface0, padding: layout.compact ? 16 : 24 }}>
|
|
47
|
-
<Card theme={theme} compact={layout.compact} icon=
|
|
48
|
+
<Card theme={theme} compact={layout.compact} icon={FOLLOW_UP_ICON} title="Nothing to show here" style={{ marginHorizontal: 0, marginTop: 0, maxWidth: 520 }}>
|
|
48
49
|
<CardRow theme={theme}>
|
|
49
50
|
<Text style={[text(c).meta, { marginBottom: 10 }]}>{query.error ? `Couldn't read Follow-up: ${errorText(query.error)}` : "Follow-up has nothing on this workspace yet, or it no longer exists."}</Text>
|
|
50
51
|
{navigation && workspaceId ? <Button theme={theme} icon="ArrowLeft" title="Back to the workspace" onPress={back} /> : null}
|
package/client/list-keys.ts
CHANGED
|
@@ -49,8 +49,9 @@ export function useListKeys(options: ListKeysOptions): void {
|
|
|
49
49
|
const target = e.target as Target;
|
|
50
50
|
const typing = !!target && (!!target.isContentEditable || ["INPUT", "TEXTAREA", "SELECT"].includes(target.tagName ?? ""));
|
|
51
51
|
if (typing && !target?.closest?.("[data-list-keys]")) return;
|
|
52
|
-
// A row menu or a dialog over the list keeps its own keys
|
|
53
|
-
|
|
52
|
+
// A row menu or a dialog over the list keeps its own keys, and so does a control whose keys move it (Home's
|
|
53
|
+
// divider: arrows, Home and End resize the pane, never walk the list).
|
|
54
|
+
if (target?.closest?.('[role="menu"],[role="dialog"],[aria-modal="true"],[role="separator"],[role="slider"]')) return;
|
|
54
55
|
const root = scope();
|
|
55
56
|
const onBody = !target || target === doc.body;
|
|
56
57
|
if (!ownsKey({ inside: !!target && !!root?.contains(target), onBody, claimBody: !!claimBody,
|
package/client/live.tsx
CHANGED
|
@@ -12,6 +12,7 @@ import { useSidebarViewActive } from "./inbox";
|
|
|
12
12
|
import { homeCounts } from "../shared/home";
|
|
13
13
|
import { useHomeModel, type HomeSources } from "./home-data";
|
|
14
14
|
import { onVisible, whileVisible } from "./visibility";
|
|
15
|
+
import { FOLLOW_UP_ICON, NEED_DOT, needDotBox } from "./follow-up-icon";
|
|
15
16
|
import { WhatsNewGate } from "./release-notes";
|
|
16
17
|
import { ViewSync } from "./view-store";
|
|
17
18
|
import { ToastHost } from "./toasts";
|
|
@@ -95,13 +96,13 @@ export function useLive<T>(store: LiveStore, select: () => T): T {
|
|
|
95
96
|
return select();
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
/** The header button's icon:
|
|
99
|
+
/** The header button's icon: Follow-up's mark. While the workspace needs you, its end dot turns into the warning dot. */
|
|
99
100
|
export function headerIcon(store: LiveStore) {
|
|
100
101
|
return function HeaderIcon(props: PluginButtonIconProps) {
|
|
101
102
|
const need = useLive(store, () => { const w = store.get(props.workspaceId); return w ? activeNeeds(w).length : 0; });
|
|
102
103
|
return <View style={{ width: props.size, height: props.size }}>
|
|
103
|
-
<Icon
|
|
104
|
-
{need > 0 && <View accessibilityLabel={`${need} need you`} style={{ position: "absolute",
|
|
104
|
+
<Icon icon={FOLLOW_UP_ICON} size={props.size} color={props.color} />
|
|
105
|
+
{need > 0 && <View testID="follow-up-need-dot" accessibilityLabel={`${need} need you`} style={{ position: "absolute", ...needDotBox(props.size), width: NEED_DOT, height: NEED_DOT, borderRadius: NEED_DOT / 2, backgroundColor: props.theme.colors.statusWarning }} />}
|
|
105
106
|
</View>;
|
|
106
107
|
};
|
|
107
108
|
}
|
|
@@ -120,7 +121,7 @@ export function sidebarItem(sources: HomeSources, screenId: string) {
|
|
|
120
121
|
const c = theme.colors;
|
|
121
122
|
const shown = count > 0 && !inSidebarView;
|
|
122
123
|
// What's new mounts here too (the sidebar is always there), so it shows even if you live in agent chats.
|
|
123
|
-
return <><ViewSync /><WhatsNewGate surface="sidebar" theme={theme} compact={layout.compact} /><ToastHost theme={theme} compact={layout.compact} /><SidebarRow icon=
|
|
124
|
+
return <><ViewSync /><WhatsNewGate surface="sidebar" theme={theme} compact={layout.compact} /><ToastHost theme={theme} compact={layout.compact} /><SidebarRow icon={FOLLOW_UP_ICON} active={currentScreen?.screenId === screenId} onPress={() => openScreen({ screenId, params: { section: "needs" } })}
|
|
124
125
|
trailing={shown ? <View accessibilityLabel={`${count} need${count === 1 ? "s" : ""} you`} style={{ minWidth: 18, height: 18, paddingHorizontal: 5, borderRadius: 9, alignItems: "center", justifyContent: "center", backgroundColor: c.statusWarning }}>
|
|
125
126
|
<Text style={{ color: c.surface0, fontSize: 11, lineHeight: 14, fontWeight: "700", fontVariant: ["tabular-nums"] }}>{count}</Text>
|
|
126
127
|
</View> : undefined} /></>;
|