paseo-follow-up 1.4.0-beta.19 → 1.4.0-beta.20
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 +1 -1
- package/client/about.tsx +22 -12
- package/client/brief.tsx +11 -4
- package/client/header.tsx +40 -19
- package/client/home-chrome.tsx +65 -25
- package/client/home-list.tsx +72 -27
- package/client/home.tsx +200 -74
- package/client/kit.tsx +46 -15
- package/client/needs-you.tsx +36 -8
- package/client/onboarding.tsx +14 -0
- package/client/panel.tsx +49 -17
- package/client/pill.tsx +31 -15
- package/client/pr-controls.tsx +17 -5
- package/client/pr-sheet.tsx +8 -7
- package/client/questions.tsx +6 -4
- package/client/settings-shell.tsx +3 -3
- package/client/settings.tsx +8 -7
- package/client/shipping.tsx +12 -9
- package/client/spec.tsx +1 -1
- package/client/stacks.tsx +1 -1
- package/client/tasks.tsx +1 -1
- package/client/theme.ts +21 -0
- package/index.client.tsx +2 -1
- package/package.json +1 -1
- package/shared/about.ts +2 -0
- package/shared/headline.ts +5 -0
- package/shared/home.ts +6 -0
package/README.md
CHANGED
|
@@ -205,7 +205,7 @@ The choices live in `agents.json` in Follow-up's data folder. Anything missing o
|
|
|
205
205
|
Install the beta:
|
|
206
206
|
|
|
207
207
|
```sh
|
|
208
|
-
paseo plugin update follow-through --version 1.4.0-beta.
|
|
208
|
+
paseo plugin update follow-through --version 1.4.0-beta.20
|
|
209
209
|
# or, for a fresh install:
|
|
210
210
|
paseo plugin install npm:paseo-follow-up@beta
|
|
211
211
|
```
|
package/client/about.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { openExternalUrl, useRpc } from "@getpaseo/plugin/client";
|
|
|
4
4
|
import { Icon } from "@getpaseo/plugin/client/ui";
|
|
5
5
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
6
|
import { workspaceAboutRpc } from "../shared/contracts";
|
|
7
|
-
import { aboutDisplay, linkLine, SOURCE_LABEL, type AboutLink, type AboutView } from "../shared/about";
|
|
7
|
+
import { aboutDisplay, linkLine, shortFooter, SOURCE_LABEL, type AboutLink, type AboutView } from "../shared/about";
|
|
8
8
|
import { errorText } from "../shared/errors";
|
|
9
9
|
import { Button, text, type Theme } from "./kit";
|
|
10
10
|
import { Spinner } from "./motion";
|
|
@@ -30,8 +30,10 @@ export const aboutKey = (workspaceId: string) => ["follow-through", "about", wor
|
|
|
30
30
|
* is cached, the one-line gist. Open: the overview, what's linked, and when it was written with a Refresh.
|
|
31
31
|
*/
|
|
32
32
|
export function AboutSection({ workspaceId, theme, compact, flush = false }: { workspaceId: string; theme: Theme; compact: boolean; flush?: boolean }) {
|
|
33
|
-
const c = theme.colors; const t = text(c);
|
|
34
|
-
|
|
33
|
+
const c = theme.colors; const t = text(c, compact);
|
|
34
|
+
// Phones start every pane collapsed and keep the choice for this mount only: one tap mustn't push the ask below the
|
|
35
|
+
// fold in every workspace. Desktop keeps the per-device choice.
|
|
36
|
+
const [open, setOpenState] = useState(() => compact ? false : readOpen());
|
|
35
37
|
const [refreshing, setRefreshing] = useState(false);
|
|
36
38
|
const read = useRpc(workspaceAboutRpc);
|
|
37
39
|
const client = useQueryClient();
|
|
@@ -45,7 +47,7 @@ export function AboutSection({ workspaceId, theme, compact, flush = false }: { w
|
|
|
45
47
|
useTick(60_000);
|
|
46
48
|
const view = query.data ?? null;
|
|
47
49
|
const d = aboutDisplay(view, Date.now());
|
|
48
|
-
const toggle = () => { const next = !open; writeOpen(next); setOpenState(next); };
|
|
50
|
+
const toggle = () => { const next = !open; if (!compact) writeOpen(next); setOpenState(next); };
|
|
49
51
|
const refresh = async () => {
|
|
50
52
|
if (refreshing) return;
|
|
51
53
|
setRefreshing(true);
|
|
@@ -53,6 +55,7 @@ export function AboutSection({ workspaceId, theme, compact, flush = false }: { w
|
|
|
53
55
|
catch { /* the query's error shows */ } finally { setRefreshing(false); }
|
|
54
56
|
};
|
|
55
57
|
const busy = refreshing || view?.status === "pending";
|
|
58
|
+
const peek = compact && !open && !!d.gist;
|
|
56
59
|
|
|
57
60
|
const failedKinds = new Set(view?.record?.failed ?? []);
|
|
58
61
|
|
|
@@ -60,24 +63,31 @@ export function AboutSection({ workspaceId, theme, compact, flush = false }: { w
|
|
|
60
63
|
return <View style={{ borderRadius: 10, borderWidth: open ? 1 : 0, borderColor: c.border, marginHorizontal: flush ? 0 : compact ? 16 : 12, marginTop: flush ? 0 : 8 }}>
|
|
61
64
|
<Pressable accessibilityRole="button" aria-expanded={open} accessibilityState={{ expanded: open }} accessibilityLabel={`${open ? "Hide" : "Show"} what this workspace is about`}
|
|
62
65
|
accessibilityHint={d.gist && !open ? d.gist : undefined} onPress={toggle}
|
|
63
|
-
style={state => ({ flexDirection: "row", alignItems: "center", gap: 8, paddingHorizontal: open ? 12 : 8, marginHorizontal: open ? 0 : -8, minHeight: compact ?
|
|
66
|
+
style={state => ({ flexDirection: "row", alignItems: peek ? "flex-start" : "center", gap: 8, paddingHorizontal: open ? 12 : 8, marginHorizontal: open ? 0 : -8, minHeight: compact ? 48 : 32, paddingVertical: compact ? 8 : 6, borderRadius: 8,
|
|
64
67
|
backgroundColor: state.pressed ? c.surface2 : (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
|
|
65
|
-
<Icon name={open ? "ChevronDown" : "ChevronRight"} size={14} color={c.foregroundMuted}
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
+
<View style={peek ? { paddingTop: 3 } : undefined}><Icon name={open ? "ChevronDown" : "ChevronRight"} size={14} color={c.foregroundMuted} /></View>
|
|
69
|
+
{/* Phones: the gist wraps under the label (two lines) instead of being cut to a few words beside it. */}
|
|
70
|
+
{peek ? <View style={{ flex: 1, minWidth: 0, gap: 2 }}>
|
|
71
|
+
<Text style={t.label}>What's this about?</Text>
|
|
72
|
+
<Text numberOfLines={2} style={[t.meta, { fontSize: 13, lineHeight: 18 }]}>{d.gist}</Text>
|
|
73
|
+
</View> : <>
|
|
74
|
+
<Text style={[t.label, { flexShrink: 0 }]}>What's this about?</Text>
|
|
75
|
+
{!open && d.gist ? <Text numberOfLines={1} style={[t.meta, { flex: 1, minWidth: 0 }]}>{d.gist}</Text> : <View style={{ flex: 1 }} />}
|
|
76
|
+
</>}
|
|
68
77
|
{!open && view?.status === "pending" && !d.gist && <Spinner color={c.foregroundMuted} size={11} label="Summarizing" />}
|
|
69
78
|
</Pressable>
|
|
70
79
|
{open && <View style={{ paddingHorizontal: 12, paddingBottom: 10, gap: 12 }}>
|
|
71
80
|
<Overview d={d} view={view} c={c} compact={compact} loading={query.isPending} error={query.error ? errorText(query.error) : null} />
|
|
72
81
|
{/* Nothing is claimed about links until an overview exists: "none found" only after a finished write. */}
|
|
73
82
|
{d.body === "overview" && <View style={{ gap: 4 }}>
|
|
74
|
-
<Text accessibilityRole="header" style={[t.small, { fontWeight: "600", letterSpacing: 0.5, textTransform: "uppercase" }]}>Linked</Text>
|
|
83
|
+
<Text accessibilityRole="header" style={compact ? t.section : [t.small, { fontWeight: "600", letterSpacing: 0.5, textTransform: "uppercase" }]}>Linked</Text>
|
|
75
84
|
{d.links.length ? d.links.map(l => <LinkRow key={l.key} l={l} c={c} compact={compact} failed={failedKinds.has(SOURCE_LABEL[l.kind])} />)
|
|
76
85
|
: <Text style={t.meta}>{d.empty}</Text>}
|
|
77
86
|
</View>}
|
|
78
87
|
{view?.record && <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
|
|
79
|
-
|
|
80
|
-
<
|
|
88
|
+
{/* Phones: one meta line ("Haiku · 2m ago"); what it was built from goes to Refresh's hint. */}
|
|
89
|
+
<Text numberOfLines={compact ? 1 : undefined} style={[t.small, { flex: 1, minWidth: 0 }]}>{compact ? shortFooter(d.footer) : d.footer}</Text>
|
|
90
|
+
<Button theme={theme} compact={compact} kind="ghost" icon="RefreshCw" title={busy ? "Summarizing…" : "Refresh"} accessibilityLabel="Summarize again" accessibilityHint={compact ? d.footer ?? undefined : undefined} disabled={busy} onPress={() => void refresh()} />
|
|
81
91
|
</View>}
|
|
82
92
|
{!view?.record && view?.status === "failed" && <View style={{ flexDirection: "row" }}>
|
|
83
93
|
<Button theme={theme} compact={compact} kind="ghost" icon="RefreshCw" title={busy ? "Summarizing…" : "Try again"} disabled={busy} onPress={() => void refresh()} />
|
|
@@ -95,7 +105,7 @@ function Overview({ d, view, c, compact, loading, error }: { d: ReturnType<typeo
|
|
|
95
105
|
if (d.body === "overview") return <View style={{ gap: 4 }}>
|
|
96
106
|
<Text selectable numberOfLines={compact && !more ? 4 : undefined}
|
|
97
107
|
style={[t.body, { lineHeight: 19, color: c.foreground, opacity: 0.88 }]}>{d.overview}</Text>
|
|
98
|
-
{long && <Pressable accessibilityRole="button" onPress={() => setMore(m => !m)} hitSlop={12}><Text style={[t.small, { color: c.foreground }]}>{more ? "Less" : "More"}</Text></Pressable>}
|
|
108
|
+
{long && <Pressable accessibilityRole="button" onPress={() => setMore(m => !m)} hitSlop={compact ? { top: 14, bottom: 14, left: 12, right: 24 } : 12}><Text style={[t.small, { color: c.foreground, fontWeight: "600" }]}>{more ? "Less" : "More"}</Text></Pressable>}
|
|
99
109
|
{d.refreshing && <View style={{ flexDirection: "row", alignItems: "center", gap: 6 }}><Spinner color={c.foregroundMuted} size={10} label="Summarizing" /><Text style={t.small}>Updating…</Text></View>}
|
|
100
110
|
</View>;
|
|
101
111
|
if (d.body === "summarizing" || loading) return <View style={{ gap: 6 }}>
|
package/client/brief.tsx
CHANGED
|
@@ -12,7 +12,7 @@ const word = (kind: Brief["kind"]) => HEADLINE_WORD[briefKey(kind)];
|
|
|
12
12
|
import { briefActionRpc, browserStatusRpc } from "../shared/contracts";
|
|
13
13
|
import { errorText } from "../shared/errors";
|
|
14
14
|
import type { Workspace } from "../shared/model";
|
|
15
|
-
import { useNow } from "./kit";
|
|
15
|
+
import { text, useNow } from "./kit";
|
|
16
16
|
import { PrSheet } from "./pr-sheet";
|
|
17
17
|
import { isLight, withAlpha, type Colors } from "./theme";
|
|
18
18
|
|
|
@@ -255,6 +255,7 @@ export function BriefCard({ item, theme, layout, agentId, deps, embedded = false
|
|
|
255
255
|
const browserRead = useRpc(browserStatusRpc);
|
|
256
256
|
const [busy, setBusy] = useState<string | null>(null);
|
|
257
257
|
const [error, setError] = useState<string | null>(null);
|
|
258
|
+
const [why, setWhy] = useState(false);
|
|
258
259
|
const picks = usePicks(b.id);
|
|
259
260
|
const [sheet, setSheet] = useState<{ key: string; intent: "merge" | "reviewers" } | null>(null);
|
|
260
261
|
const workspace = b.workspaceId ? deps.workspace(b.workspaceId) : undefined;
|
|
@@ -325,8 +326,14 @@ export function BriefCard({ item, theme, layout, agentId, deps, embedded = false
|
|
|
325
326
|
{multi && <Text accessibilityLiveRegion="polite" style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16, fontVariant: ["tabular-nums"] }}>· {pickedCount(b, picks)} of {askedDecisions(b).length} picked</Text>}
|
|
326
327
|
<View style={{ flex: 1 }} />
|
|
327
328
|
<Text style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16, fontVariant: ["tabular-nums"] }}>{ageText}</Text>
|
|
329
|
+
{/* Phones: where the card's facts come from sits behind ⓘ instead of a footer under every card. */}
|
|
330
|
+
{compact && <Pressable accessibilityRole="button" accessibilityLabel={why ? "Hide where this comes from" : "Where this comes from"} aria-expanded={why} accessibilityState={{ expanded: why }}
|
|
331
|
+
onPress={() => setWhy(v => !v)} style={{ width: 44, height: 44, marginVertical: -15, marginRight: -14, alignItems: "center", justifyContent: "center" }}>
|
|
332
|
+
<Icon name="Info" size={14} color={why ? c.foreground : c.foregroundMuted} />
|
|
333
|
+
</Pressable>}
|
|
328
334
|
</View>
|
|
329
|
-
|
|
335
|
+
{/* The ask role on phones (react-native-web ignores hitSlop, so the ⓘ above is a real 44 box); desktop keeps 19/26. */}
|
|
336
|
+
<Text accessibilityRole="header" style={compact ? text(c, true).ask : { color: c.foreground, fontSize: 19, lineHeight: 26, fontWeight: "600", letterSpacing: -0.2 }}>{b.ask}</Text>
|
|
330
337
|
</View>
|
|
331
338
|
|
|
332
339
|
<BriefBody b={b} c={c} compact={compact} tight={tight} embedded={embedded} height={height} mode={multi ? "select" : "send"} picks={picks}
|
|
@@ -346,10 +353,10 @@ export function BriefCard({ item, theme, layout, agentId, deps, embedded = false
|
|
|
346
353
|
{!tight && !!b.also.context && <Text numberOfLines={3} style={{ color: c.foregroundMuted, fontSize: 13, lineHeight: 19 }}>{b.also.context}</Text>}
|
|
347
354
|
</View>}
|
|
348
355
|
</View>
|
|
349
|
-
<View style={{ borderTopWidth: 1, borderTopColor: c.border, paddingHorizontal: pad, paddingVertical: 8, flexDirection: "row", alignItems: "center", gap: 6 }}>
|
|
356
|
+
{(!compact || why) && <View style={{ borderTopWidth: 1, borderTopColor: c.border, paddingHorizontal: pad, paddingVertical: 8, flexDirection: "row", alignItems: "center", gap: 6 }}>
|
|
350
357
|
<Icon name="Info" size={12} color={c.foregroundMuted} />
|
|
351
358
|
<Text style={{ flex: 1, color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>{b.sourceLine}</Text>
|
|
352
|
-
</View>
|
|
359
|
+
</View>}
|
|
353
360
|
{workspace && sheet && <PrSheet workspace={workspace} prKey={sheet.key} intent={sheet.intent} theme={theme} compact={compact} browserReady={browser.data?.ready ?? false} onClose={() => setSheet(null)} />}
|
|
354
361
|
</View>;
|
|
355
362
|
}
|
package/client/header.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { Pressable, Text, View } from "react-native";
|
|
|
2
2
|
import { Icon } from "@getpaseo/plugin/client/ui";
|
|
3
3
|
import type { Workspace } from "../shared/model";
|
|
4
4
|
import { ago, headline, liveLine, stackBar, type LiveIcon } from "../shared/attention";
|
|
5
|
-
import { IconButton, Switch, text, type Theme } from "./kit";
|
|
5
|
+
import { Button, IconButton, Switch, text, type Theme } from "./kit";
|
|
6
6
|
import { IconSwap, Spinner } from "./motion";
|
|
7
7
|
import { segmentPaint, type Colors } from "./theme";
|
|
8
8
|
import { SpecChip } from "./spec";
|
|
@@ -41,36 +41,28 @@ function LiveGlyph({ icon, colors }: { icon: LiveIcon; colors: Colors }) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings, onRefresh, refreshing, onAuto, autoPending, notice, onOpenPr, resize, hideTitle = false }: {
|
|
44
|
+
export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings, onRefresh, refreshing, onAuto, autoPending, notice, onOpenPr, resize, hideTitle = false, onHome }: {
|
|
45
45
|
workspace: Workspace; theme: Theme; compact: boolean; now: number; onSettings: () => void; onRefresh: () => void; refreshing: boolean; onAuto: (next: boolean) => void; autoPending: boolean; notice: string | null; onOpenPr?: (key: string) => void;
|
|
46
46
|
/** Expand to the larger view, or collapse back to the panel. Absent where the panel is already as wide as it gets. */
|
|
47
47
|
resize?: { icon: "Maximize2" | "Minimize2"; label: string; onPress: () => void } | null;
|
|
48
48
|
/** The larger view's screen bar already names the workspace. */
|
|
49
49
|
hideTitle?: boolean;
|
|
50
|
+
/** Phones: the panel's Home link joins the header's own bar, one 44px row instead of two. */
|
|
51
|
+
onHome?: () => void;
|
|
50
52
|
}) {
|
|
51
|
-
const c = theme.colors; const t = text(c);
|
|
53
|
+
const c = theme.colors; const t = text(c, compact);
|
|
52
54
|
const parts = headline(w, now);
|
|
53
55
|
const live = liveLine(w, now);
|
|
54
56
|
const checked = w.prs.map(p => p.snapshot?.observedAt).filter((v): v is string => !!v).sort().at(-1);
|
|
55
57
|
const stale = !!checked && w.prs.some(p => p.snapshot?.state === "OPEN") && now - Date.parse(checked) > STALE_MS;
|
|
56
58
|
const toneOf = (tone?: string) => tone === "warning" ? c.statusWarning : tone === "danger" ? c.statusDanger : tone === "success" ? c.statusSuccess : undefined;
|
|
57
59
|
const pad = compact ? 16 : 12;
|
|
58
|
-
|
|
59
|
-
<View style={{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
{!!w.spec?.url && <View style={{ marginRight: 4 }}><SpecChip workspace={w} theme={theme} compact={compact} /></View>}
|
|
65
|
-
{resize && <IconButton icon={resize.icon} label={resize.label} onPress={resize.onPress} theme={theme} compact={compact} />}
|
|
66
|
-
<IconButton icon="Settings" label="Follow-up settings" onPress={onSettings} theme={theme} compact={compact} />
|
|
67
|
-
</View>
|
|
68
|
-
</View>
|
|
69
|
-
{!compact && !hideTitle && w.goal && w.goal !== w.title && <Text numberOfLines={2} style={t.meta}>{w.goal}</Text>}
|
|
70
|
-
<Text accessibilityLiveRegion="polite" style={[t.meta, { color: c.foregroundMuted, marginTop: 2 }]}>
|
|
71
|
-
{parts.map((part, i) => <Text key={part.text} style={toneOf(part.tone) ? { color: toneOf(part.tone), fontWeight: "600" } : { color: c.foreground }}>{i ? <Text style={{ color: c.foregroundMuted, fontWeight: "400" }}>{" · "}</Text> : null}{part.text}</Text>)}
|
|
72
|
-
</Text>
|
|
73
|
-
<StackBar workspace={w} theme={theme} onOpen={onOpenPr} />
|
|
60
|
+
const controls = <View style={{ flexDirection: "row", alignItems: "center", gap: 2, marginVertical: compact ? -12 : -4, marginRight: compact ? -10 : -4 }}>
|
|
61
|
+
{!!w.spec?.url && <View style={{ marginRight: 4 }}><SpecChip workspace={w} theme={theme} compact={compact} /></View>}
|
|
62
|
+
{resize && <IconButton icon={resize.icon} label={resize.label} onPress={resize.onPress} theme={theme} compact={compact} />}
|
|
63
|
+
<IconButton icon="Settings" label="Follow-up settings" onPress={onSettings} theme={theme} compact={compact} />
|
|
64
|
+
</View>;
|
|
65
|
+
const tail = <>
|
|
74
66
|
<View style={{ flexDirection: "row", gap: 6, marginTop: 2 }}>
|
|
75
67
|
<View style={{ paddingTop: 3 }}><IconSwap swapKey={live.icon} size={12}><LiveGlyph icon={live.icon} colors={c} /></IconSwap></View>
|
|
76
68
|
<Text accessibilityLiveRegion="polite" style={[t.meta, { flex: 1, color: live.icon === "spinner" ? c.foreground : c.foregroundMuted }]}>
|
|
@@ -88,5 +80,34 @@ export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings,
|
|
|
88
80
|
<Switch theme={theme} compact={compact} label="Auto-send" accessibilityLabel="Auto-send repairs" hint="Send repair batches to the main agent on its own when the agent is idle. Off means each batch waits for your click."
|
|
89
81
|
value={w.enable_auto_sends} disabled={autoPending} onChange={onAuto} />
|
|
90
82
|
</View>
|
|
83
|
+
</>;
|
|
84
|
+
if (compact && onHome) return <View style={{ paddingHorizontal: pad, paddingTop: 4, paddingBottom: 12, gap: 8, borderBottomWidth: 1, borderBottomColor: c.border }}>
|
|
85
|
+
{/* One bar: Home on the left, the Spec chip and settings on the right. The host header above names the workspace,
|
|
86
|
+
so the goal shows only when it says something the title doesn't. */}
|
|
87
|
+
<View style={{ flexDirection: "row", alignItems: "center", minHeight: 44, marginLeft: -14 }}>
|
|
88
|
+
<Button theme={theme} compact kind="ghost" icon="House" title="Home" accessibilityHint="Opens Follow-up Home with every workspace" onPress={onHome} />
|
|
89
|
+
<View style={{ flex: 1 }} />
|
|
90
|
+
<View style={{ marginVertical: 12 }}>{controls}</View>
|
|
91
|
+
</View>
|
|
92
|
+
{!!w.goal && w.goal.trim() !== w.title.trim() && <Text numberOfLines={2} style={t.meta}>{w.goal}</Text>}
|
|
93
|
+
<Text accessibilityLiveRegion="polite" style={[t.ask, { color: c.foregroundMuted }]}>
|
|
94
|
+
{parts.map((part, i) => <Text key={part.text} style={toneOf(part.tone) ? { color: toneOf(part.tone) } : { color: c.foreground }}>{i ? <Text style={{ color: c.foregroundMuted, fontWeight: "400" }}>{" · "}</Text> : null}{part.text}</Text>)}
|
|
95
|
+
</Text>
|
|
96
|
+
<StackBar workspace={w} theme={theme} onOpen={onOpenPr} />
|
|
97
|
+
{tail}
|
|
98
|
+
</View>;
|
|
99
|
+
return <View style={{ paddingHorizontal: pad, paddingTop: compact ? 14 : 12, paddingBottom: 10, gap: 6, borderBottomWidth: 1, borderBottomColor: c.border }}>
|
|
100
|
+
<View style={{ flexDirection: "row", alignItems: "flex-start", gap: 8 }}>
|
|
101
|
+
{/* On phones the host header right above already shows the workspace name. */}
|
|
102
|
+
{compact || hideTitle ? <Text numberOfLines={2} style={[t.meta, { flex: 1, paddingTop: 2 }, hideTitle && !compact ? { fontSize: 13, lineHeight: 19, color: c.foreground } : null]}>{w.goal}</Text>
|
|
103
|
+
: <Text accessibilityRole="header" style={[t.title, { flex: 1 }]}>{w.title}</Text>}
|
|
104
|
+
{controls}
|
|
105
|
+
</View>
|
|
106
|
+
{!compact && !hideTitle && w.goal && w.goal !== w.title && <Text numberOfLines={2} style={t.meta}>{w.goal}</Text>}
|
|
107
|
+
<Text accessibilityLiveRegion="polite" style={[t.meta, { color: c.foregroundMuted, marginTop: 2 }]}>
|
|
108
|
+
{parts.map((part, i) => <Text key={part.text} style={toneOf(part.tone) ? { color: toneOf(part.tone), fontWeight: "600" } : { color: c.foreground }}>{i ? <Text style={{ color: c.foregroundMuted, fontWeight: "400" }}>{" · "}</Text> : null}{part.text}</Text>)}
|
|
109
|
+
</Text>
|
|
110
|
+
<StackBar workspace={w} theme={theme} onOpen={onOpenPr} />
|
|
111
|
+
{tail}
|
|
91
112
|
</View>;
|
|
92
113
|
}
|
package/client/home-chrome.tsx
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore, type ReactNode } from "react";
|
|
2
|
-
import { Platform, Pressable, Text, TextInput, View } from "react-native";
|
|
2
|
+
import { Platform, Pressable, ScrollView, Text, TextInput, View } from "react-native";
|
|
3
3
|
import { Icon, useToast } from "@getpaseo/plugin/client/ui";
|
|
4
4
|
import { GROUP_TITLE, homeCounts, type HomeGroupId, type HomeModel } from "../shared/home";
|
|
5
5
|
import { FIELD_LABEL, excerpt, highlightRuns, homeSearchDocs, indexDocs, defaultActive, omniboxResults, overseerProvider, workspaceProvider, type OmniboxItem, type OmniboxProvider, type Range, type WorkspaceItem } from "../shared/search";
|
|
6
|
-
import { SORT_HINT, SORT_LABEL, SORT_MODES, type SortMode } from "../shared/sort";
|
|
6
|
+
import { DEFAULT_SORT, SORT_HINT, SORT_LABEL, SORT_MODES, type SortMode } from "../shared/sort";
|
|
7
7
|
import { priorityNote, PRIORITY_SOURCE_LABEL } from "../shared/priorities";
|
|
8
8
|
import { rankCost } from "../shared/ranker";
|
|
9
9
|
import { meters, meterText, type Meter } from "../shared/usage";
|
|
10
10
|
import { resourceMeter, type Resources } from "../shared/resources";
|
|
11
11
|
import type { HomeSources } from "./home-data";
|
|
12
12
|
import type { Workstream } from "../shared/home";
|
|
13
|
-
import { Age, PrChipView } from "./home-list";
|
|
13
|
+
import { Age, glyphColor, PrChipView, PrSummaryText } from "./home-list";
|
|
14
14
|
import { useMinute } from "./home-data";
|
|
15
15
|
import { Spinner } from "./motion";
|
|
16
16
|
import { withAlpha, type Colors } from "./theme";
|
|
@@ -89,10 +89,11 @@ export function SearchField({ theme, omnibox, dense, onEnter }: { theme: Theme;
|
|
|
89
89
|
const c = theme.colors;
|
|
90
90
|
const [focused, setFocused] = useState(false);
|
|
91
91
|
const { query, setQuery, results, active, move, inputRef, askOn } = omnibox;
|
|
92
|
-
const placeholder = askOn ? "Search, or ask the Overseer" : "Search workspaces, branches, PRs";
|
|
93
|
-
|
|
92
|
+
const placeholder = askOn ? dense ? "Search or ask the Overseer" : "Search, or ask the Overseer" : "Search workspaces, branches, PRs";
|
|
93
|
+
// `dense` is the phone layout: a 44px field with a rounder shape and body-size text.
|
|
94
|
+
return <View style={{ flex: 1, minWidth: 0, flexDirection: "row", alignItems: "center", gap: dense ? 8 : 6, height: dense ? 44 : 32, paddingHorizontal: dense ? 12 : 8, borderRadius: dense ? 12 : 6,
|
|
94
95
|
borderWidth: 1, borderColor: focused ? withAlpha(c.foreground, 0.35) : c.border, backgroundColor: c.surface1 }}>
|
|
95
|
-
<Icon name="Search" size={13} color={c.foregroundMuted} />
|
|
96
|
+
<Icon name="Search" size={dense ? 16 : 13} color={c.foregroundMuted} />
|
|
96
97
|
<TextInput ref={inputRef} value={query} onChangeText={setQuery} placeholder={placeholder} placeholderTextColor={c.foregroundMuted}
|
|
97
98
|
accessibilityLabel={placeholder} autoCorrect={false} autoCapitalize="none" spellCheck={false} returnKeyType="go"
|
|
98
99
|
onFocus={() => setFocused(true)} onBlur={() => setFocused(false)}
|
|
@@ -103,11 +104,11 @@ export function SearchField({ theme, omnibox, dense, onEnter }: { theme: Theme;
|
|
|
103
104
|
else if (key === "ArrowUp") { e.preventDefault?.(); move(-1); }
|
|
104
105
|
else if (key === "Escape") { if (query) setQuery(""); else inputRef.current?.blur(); }
|
|
105
106
|
}}
|
|
106
|
-
style={{ flex: 1, minWidth: 0, color: c.foreground, fontSize: 13, paddingVertical: 0, ...(Platform.OS === "web" ? { outlineStyle: "none" } as object : {}) }} />
|
|
107
|
-
{!!query && <Pressable accessibilityRole="button" accessibilityLabel="Clear search" hitSlop={8} onPress={() => { setQuery(""); inputRef.current?.focus(); }}>
|
|
108
|
-
<Icon name="X" size={13} color={c.foregroundMuted} />
|
|
107
|
+
style={{ flex: 1, minWidth: 0, color: c.foreground, fontSize: dense ? 15 : 13, paddingVertical: 0, ...(Platform.OS === "web" ? { outlineStyle: "none" } as object : {}) }} />
|
|
108
|
+
{!!query && <Pressable accessibilityRole="button" accessibilityLabel="Clear search" hitSlop={dense ? 14 : 8} onPress={() => { setQuery(""); inputRef.current?.focus(); }}>
|
|
109
|
+
<Icon name="X" size={dense ? 16 : 13} color={c.foregroundMuted} />
|
|
109
110
|
</Pressable>}
|
|
110
|
-
{!query && !focused && Platform.OS === "web" && <Text style={{ color: c.foregroundMuted, fontSize: 11, paddingHorizontal: 4, borderRadius: 3, borderWidth: 1, borderColor: c.border }}>/</Text>}
|
|
111
|
+
{!query && !focused && !dense && Platform.OS === "web" && <Text style={{ color: c.foregroundMuted, fontSize: 11, paddingHorizontal: 4, borderRadius: 3, borderWidth: 1, borderColor: c.border }}>/</Text>}
|
|
111
112
|
</View>;
|
|
112
113
|
}
|
|
113
114
|
|
|
@@ -137,15 +138,18 @@ export function SortMenu({ theme, mode, onChange, rankedAt, touch, rank = null,
|
|
|
137
138
|
const note = [priorityNote(rankedAt, now), rankedAt && rank?.enabled ? rankCost(rank) : "", rank?.enabled ? rank.healthLine : ""].filter(Boolean).join(" · ");
|
|
138
139
|
return <View style={{ position: "relative", zIndex: 20 }}>
|
|
139
140
|
<Pressable accessibilityRole="button" accessibilityLabel={`Sort: ${SORT_LABEL[mode]}${running ? ", ranking" : ""}`} aria-expanded={open} accessibilityState={{ expanded: open }} onPress={() => setOpen(o => !o)}
|
|
140
|
-
style={state => ({ flexDirection: "row", alignItems: "center", gap: 4, height: touch ?
|
|
141
|
-
{
|
|
142
|
-
<
|
|
143
|
-
|
|
141
|
+
style={state => ({ flexDirection: "row", alignItems: "center", justifyContent: "center", gap: 4, height: touch ? 44 : 30, minWidth: touch ? 44 : undefined, paddingHorizontal: touch ? 0 : 8, borderRadius: touch ? 8 : 6, backgroundColor: open || (state as { hovered?: boolean }).hovered ? c.surface2 : "transparent" })}>
|
|
142
|
+
{/* Phones: an icon; the mode's name lives in the menu (and the accessible name). */}
|
|
143
|
+
{running ? <Spinner color={c.foreground} size={12} label="Ranking" /> : <Icon name="ArrowUpDown" size={touch ? 18 : 13} color={touch && mode !== DEFAULT_SORT ? c.foreground : c.foregroundMuted} />}
|
|
144
|
+
{/* Phones: the icon carries no label, so a non-default sort shows as a dot on it. */}
|
|
145
|
+
{touch && mode !== DEFAULT_SORT && <View style={{ position: "absolute", top: 9, right: 9, width: 7, height: 7, borderRadius: 4, backgroundColor: c.accent }} />}
|
|
146
|
+
{!touch && <Text numberOfLines={1} style={{ color: c.foreground, fontSize: 12 }}>{SORT_LABEL[mode]}</Text>}
|
|
147
|
+
{!touch && <Icon name="ChevronDown" size={12} color={c.foregroundMuted} />}
|
|
144
148
|
</Pressable>
|
|
145
|
-
{open && <View accessibilityRole="menu" style={{ position: "absolute", top: touch ?
|
|
149
|
+
{open && <View accessibilityRole="menu" style={{ position: "absolute", top: touch ? 48 : 34, right: 0, minWidth: touch ? 240 : 220, paddingVertical: 4, borderRadius: 8, borderWidth: 1, borderColor: c.border, backgroundColor: c.surface1,
|
|
146
150
|
shadowColor: "#000", shadowOpacity: 0.25, shadowRadius: 12, shadowOffset: { width: 0, height: 4 }, elevation: 8 }}>
|
|
147
151
|
{SORT_MODES.map(m => <Pressable key={m} accessibilityRole="menuitem" accessibilityState={{ selected: m === mode }} onPress={() => { onChange(m); setOpen(false); }}
|
|
148
|
-
style={state => ({ flexDirection: "row", alignItems: "center", gap: 8, minHeight: touch ?
|
|
152
|
+
style={state => ({ flexDirection: "row", alignItems: "center", gap: 8, minHeight: touch ? 48 : 34, paddingHorizontal: touch ? 12 : 10, backgroundColor: (state as { hovered?: boolean }).hovered ? c.surface2 : "transparent" })}>
|
|
149
153
|
<View style={{ width: 14, alignSelf: "flex-start", paddingTop: 2 }}>{m === mode && <Icon name="Check" size={13} color={c.foreground} />}</View>
|
|
150
154
|
<View style={{ flex: 1 }}>
|
|
151
155
|
<Text style={{ color: c.foreground, fontSize: 13, lineHeight: 17 }}>{SORT_LABEL[m]}</Text>
|
|
@@ -158,7 +162,8 @@ export function SortMenu({ theme, mode, onChange, rankedAt, touch, rank = null,
|
|
|
158
162
|
<View style={{ width: 14 }}>{running ? <Spinner color={c.foregroundMuted} size={12} label="Ranking" /> : <Icon name="RefreshCw" size={13} color={c.foreground} />}</View>
|
|
159
163
|
<Text style={{ color: running ? c.foregroundMuted : c.foreground, fontSize: 13 }}>{running ? "Ranking…" : "Re-rank now"}</Text>
|
|
160
164
|
</Pressable>}
|
|
161
|
-
|
|
165
|
+
{/* Phones: before anything is ranked, "Priority: By urgency" only repeats the checked row's hint. */}
|
|
166
|
+
{!(touch && !rankedAt) && <Text style={{ color: c.foregroundMuted, fontSize: 11, paddingHorizontal: 10, paddingTop: 4, paddingBottom: 4 }}>Priority: {note}</Text>}
|
|
162
167
|
</View>
|
|
163
168
|
</View>}
|
|
164
169
|
</View>;
|
|
@@ -180,19 +185,32 @@ export function StatusStrip({ theme, model, filter, onFilter, touch, dense }: {
|
|
|
180
185
|
const chip = (key: string, label: string, n: number | null, selected: boolean, onPress: () => void, tone?: string) => {
|
|
181
186
|
const muted = n === 0;
|
|
182
187
|
const color = selected ? c.foreground : muted ? withAlpha(c.foregroundMuted, 0.6) : tone ?? c.foreground;
|
|
188
|
+
const pill = (hovered?: boolean) => ({ flexDirection: "row" as const, alignItems: "center" as const, gap: 5, height: touch ? 32 : 30, paddingHorizontal: touch ? 10 : 8, borderRadius: 16,
|
|
189
|
+
borderWidth: 1, borderColor: selected ? withAlpha(c.foreground, 0.4) : "transparent",
|
|
190
|
+
backgroundColor: selected ? c.surface2 : hovered ? c.surface1 : "transparent" });
|
|
183
191
|
return <Pressable key={key} accessibilityRole="button" accessibilityState={{ selected }} accessibilityLabel={n === null ? label : `${label}, ${n}${selected ? ". Showing only these; press to show all" : ". Show only these"}`} onPress={onPress}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
192
|
+
// Phones: a 32-tall chip inside a real 44 touch box (react-native-web ignores hitSlop).
|
|
193
|
+
style={touch ? { paddingVertical: 6 } : state => pill((state as { hovered?: boolean }).hovered)}>
|
|
194
|
+
{state => {
|
|
195
|
+
const inner = <>
|
|
196
|
+
{n !== null && <Text style={{ color, fontSize: 13, fontWeight: "600", fontVariant: ["tabular-nums"] }}>{n}</Text>}
|
|
197
|
+
<Text style={{ color: selected ? c.foreground : muted ? withAlpha(c.foregroundMuted, 0.6) : c.foregroundMuted, fontSize: 12 }}>{label}</Text>
|
|
198
|
+
{selected && <Icon name="X" size={11} color={c.foregroundMuted} />}
|
|
199
|
+
</>;
|
|
200
|
+
return touch ? <View style={pill((state as { hovered?: boolean }).hovered)}>{inner}</View> : inner;
|
|
201
|
+
}}
|
|
190
202
|
</Pressable>;
|
|
191
203
|
};
|
|
192
|
-
|
|
193
|
-
{STRIP.map(s => chip(s.id, s.label, counts[s.id], filter === s.id, () => onFilter(filter === s.id ? null : s.id), s.id === "needs" && counts.needs ? c.statusWarning : undefined))}
|
|
204
|
+
const chips = <>
|
|
205
|
+
{STRIP.filter(s => !touch || counts[s.id] > 0 || filter === s.id).map(s => chip(s.id, s.label, counts[s.id], filter === s.id, () => onFilter(filter === s.id ? null : s.id), s.id === "needs" && counts.needs ? c.statusWarning : undefined))}
|
|
194
206
|
{counts.later > 0 && chip("later", "Later", counts.later, filter === "later", () => onFilter(filter === "later" ? null : "later"))}
|
|
195
207
|
{counts.archivable > 0 && <Text style={{ color: c.statusSuccess, fontSize: 12, paddingHorizontal: 6 }}>{counts.archivable} to archive</Text>}
|
|
208
|
+
</>;
|
|
209
|
+
// Phones: only groups that have something, on one line that scrolls sideways instead of wrapping.
|
|
210
|
+
if (touch) return <ScrollView horizontal showsHorizontalScrollIndicator={false} accessibilityRole="toolbar" accessibilityLabel="Status"
|
|
211
|
+
contentContainerStyle={{ flexDirection: "row", alignItems: "center", gap: 4, paddingHorizontal: 12, paddingVertical: 2 }}>{chips}</ScrollView>;
|
|
212
|
+
return <View accessibilityRole="toolbar" accessibilityLabel="Status" style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", columnGap: dense ? 0 : 2, rowGap: 2, paddingHorizontal: dense ? 4 : 10 }}>
|
|
213
|
+
{chips}
|
|
196
214
|
</View>;
|
|
197
215
|
}
|
|
198
216
|
|
|
@@ -272,6 +290,28 @@ export function ResultRow({ item, theme, active, dense, touch, onPress, s: row }
|
|
|
272
290
|
const { hit } = item;
|
|
273
291
|
const via = hit.via ? excerpt(hit.via.text, hit.via.ranges, dense ? 56 : 90) : null;
|
|
274
292
|
const archived = hit.group === "archived";
|
|
293
|
+
// Phones: the list's own row (glyph, two-line 15/20 title with the age, state word in tone, PRs as text, a divider),
|
|
294
|
+
// with the match highlighted. No group pill: the state word already says it.
|
|
295
|
+
if (touch) {
|
|
296
|
+
const tone = row ? glyphColor(row, c, true) : c.foregroundMuted;
|
|
297
|
+
return <Pressable accessibilityRole="button" accessibilityState={{ selected: active }} accessibilityLabel={`${hit.title}${row?.word ? `. ${row.word}` : ""}${hit.via ? `, ${FIELD_LABEL[hit.via.field]}: ${hit.via.text}` : ""}`} onPress={onPress}
|
|
298
|
+
style={state => ({ flexDirection: "row", alignItems: "flex-start", gap: 10, minHeight: 56, paddingLeft: 14, paddingRight: 16, paddingVertical: 12, borderBottomWidth: 1, borderBottomColor: withAlpha(c.border, 0.6),
|
|
299
|
+
backgroundColor: active || state.pressed ? c.surface2 : "transparent" })}>
|
|
300
|
+
<View style={{ paddingTop: 2 }}><Icon name={archived ? "Archive" : row?.icon ?? "Circle"} size={17} color={archived ? c.foregroundMuted : tone} /></View>
|
|
301
|
+
<View style={{ flex: 1, minWidth: 0, gap: 3 }}>
|
|
302
|
+
<View style={{ flexDirection: "row", alignItems: "flex-start", gap: 8 }}>
|
|
303
|
+
<View style={{ flex: 1, minWidth: 0 }}><Highlighted text={hit.title} ranges={hit.titleRanges} color={archived ? c.foregroundMuted : c.foreground} hit={c.foreground} mark={c.statusWarning} size={15} weight="500" lines={2} /></View>
|
|
304
|
+
{row && <Age iso={row.at} c={c} size={12} />}
|
|
305
|
+
</View>
|
|
306
|
+
{via ? <Text numberOfLines={2} style={{ color: c.foregroundMuted, fontSize: 13, lineHeight: 18 }}>{FIELD_LABEL[hit.via!.field]} · <Highlighted text={via.text} ranges={via.ranges} color={c.foregroundMuted} hit={c.foreground} mark={c.statusWarning} size={13} /></Text>
|
|
307
|
+
: archived ? <Text style={{ color: c.foregroundMuted, fontSize: 13, lineHeight: 18 }}>Archived</Text>
|
|
308
|
+
: row && (row.word || row.line) ? <Text numberOfLines={2} style={{ color: c.foregroundMuted, fontSize: 13, lineHeight: 18 }}>
|
|
309
|
+
{row.word ? <Text style={{ color: tone, fontWeight: "600" }}>{row.word}</Text> : null}{row.word && row.line ? " · " : ""}{row.line}
|
|
310
|
+
</Text> : null}
|
|
311
|
+
{row?.pr && <Text numberOfLines={1} style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 17 }}><PrSummaryText s={row} c={c} /></Text>}
|
|
312
|
+
</View>
|
|
313
|
+
</Pressable>;
|
|
314
|
+
}
|
|
275
315
|
return <Pressable accessibilityRole="button" accessibilityState={{ selected: active }} accessibilityLabel={`${hit.title}${hit.via ? `, ${FIELD_LABEL[hit.via.field]}: ${hit.via.text}` : ""}`} onPress={onPress}
|
|
276
316
|
style={state => ({ flexDirection: "row", alignItems: "center", gap: 10, minHeight: touch ? 56 : dense ? 40 : 44, paddingHorizontal: dense ? 8 : 16, paddingVertical: 4,
|
|
277
317
|
borderLeftWidth: 2, borderLeftColor: active ? withAlpha(c.foreground, 0.5) : "transparent",
|