paseo-follow-up 2.5.0 → 2.6.0-beta.2
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/OVERVIEW.md +1 -1
- package/README.md +0 -1
- package/client/brief-since.tsx +4 -3
- package/client/catch-up.tsx +56 -15
- package/client/header.tsx +5 -3
- package/client/home-data.ts +3 -1
- package/client/home-list.tsx +19 -11
- package/client/home-view.ts +8 -1
- package/client/home.tsx +29 -10
- package/client/keys.ts +2 -0
- package/client/kit.tsx +5 -2
- package/client/large.tsx +5 -3
- package/client/live.tsx +4 -3
- package/client/merge-button.tsx +3 -2
- package/client/messages.tsx +5 -1
- package/client/more-context.tsx +17 -4
- package/client/morning-brief-settings.tsx +5 -4
- package/client/needs-you.tsx +5 -4
- package/client/new-settings.tsx +8 -7
- package/client/now-lines.tsx +60 -0
- package/client/onboarding.tsx +55 -123
- package/client/paged-list.tsx +115 -0
- package/client/panel.tsx +24 -8
- package/client/pr-stats-settings.tsx +3 -2
- package/client/pr-stats.tsx +10 -10
- package/client/questions.tsx +63 -40
- package/client/release-notes.tsx +10 -9
- package/client/reviewers.tsx +8 -3
- package/client/row-open.ts +28 -0
- package/client/section-search.tsx +5 -3
- package/client/settings.tsx +11 -8
- package/client/setup-dialog.tsx +168 -0
- package/client/setup-gate.tsx +69 -0
- package/client/setup-ui.ts +27 -0
- package/client/shipping.tsx +5 -4
- package/client/stacks.tsx +11 -3
- package/client/tasks.tsx +5 -1
- package/client/your-questions.tsx +375 -0
- package/index.client.tsx +11 -3
- package/index.server.ts +162 -32
- package/package.json +1 -1
- package/server/agent-actions.ts +23 -14
- package/server/agent-hook.mjs +7 -5
- package/server/agent-parity.ts +21 -6
- package/server/ai-jobs.ts +26 -5
- package/server/brief-timeline.ts +47 -0
- package/server/context-requests.ts +90 -21
- package/server/directory.ts +6 -0
- package/server/discovery.ts +2 -0
- package/server/engine.ts +3 -0
- package/server/hook-source.ts +7 -5
- package/server/inbox-classifier.ts +17 -0
- package/server/inbox.ts +9 -3
- package/server/job-agent.ts +13 -2
- package/server/mcp-source.ts +23 -15
- package/server/mcp.mjs +23 -15
- package/server/obligations.ts +4 -1
- package/server/session-prompt.ts +30 -3
- package/server/turn-end.ts +133 -0
- package/server/wait-jobs.ts +18 -2
- package/server/wait.ts +17 -12
- package/shared/activity.ts +2 -1
- package/shared/agent-settings.ts +9 -8
- package/shared/catch-up.ts +65 -20
- package/shared/chat.ts +2 -2
- package/shared/compass.ts +5 -4
- package/shared/contracts.ts +52 -8
- package/shared/history.ts +160 -0
- package/shared/home-keys.ts +1 -0
- package/shared/home.ts +54 -8
- package/shared/job-rows.ts +2 -2
- package/shared/list.ts +4 -1
- package/shared/message-sender.ts +2 -0
- package/shared/model.ts +8 -0
- package/shared/new-name.ts +4 -1
- package/shared/now.ts +228 -0
- package/shared/onboarding.ts +17 -13
- package/shared/paged.ts +96 -0
- package/shared/provider-support.ts +83 -34
- package/shared/recommend.ts +1 -1
- package/shared/settings-nav.ts +3 -1
- package/shared/setup-popup.ts +28 -0
- package/shared/sort.ts +8 -1
- package/shared/status.ts +3 -1
- package/shared/wait.ts +2 -2
- package/shared/your-questions.ts +133 -0
- package/skills/follow-up/SKILL.md +1 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { useEffect, useRef, type ReactNode, type RefObject } from "react";
|
|
2
|
+
import { Modal as RNModal, View, useWindowDimensions, type ScrollView as NativeScrollView } from "react-native";
|
|
3
|
+
import { Pressable, Text } from "./text";
|
|
4
|
+
import { Icon, Modal } from "@getpaseo/plugin/client/ui";
|
|
5
|
+
import { DockedPane } from "./docked-pane";
|
|
6
|
+
import { FOLLOW_UP_DOT, FOLLOW_UP_ICON } from "./follow-up-icon";
|
|
7
|
+
import { bottomInset, text, type Theme } from "./kit";
|
|
8
|
+
import { useReducedMotion } from "./motion";
|
|
9
|
+
import { isLight, raised, tint, withAlpha } from "./theme";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Setup's popup: one dialog (desktop) or sheet (phone) from the welcome page through the steps to done. Home never
|
|
13
|
+
* draws the steps itself; it keeps a "Finish setup" line that opens this again where it was left.
|
|
14
|
+
*
|
|
15
|
+
* The shell is the What's new dialog's (same dim, card, radius and X) at a fixed height, so moving between steps never
|
|
16
|
+
* resizes it: a header (the mark, "Set up Follow-up", where you are, Close) with a hairline progress rule under it, a
|
|
17
|
+
* scrolling body, and a pinned footer for the moves (both through DockedPane, so on a phone a focused field and its
|
|
18
|
+
* Send stay in view: invariant 43). The welcome and done pages drop the header for a centred cover.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
export const SETUP_TITLE = "Set up Follow-up";
|
|
22
|
+
const WIDTH = 640; const HEIGHT = 560; const INSET = 32;
|
|
23
|
+
|
|
24
|
+
/** The mark without its end dot: the tile paints that dot in the brand violet itself. */
|
|
25
|
+
const TILE_GLYPH = { svg: FOLLOW_UP_ICON.svg.replace(/<circle cx="20\.01"[^>]*\/>/, "") };
|
|
26
|
+
|
|
27
|
+
/** The app tile: assets/icon.svg drawn with the host's Icon (the mark in white, its end dot in the brand violet). */
|
|
28
|
+
export function FollowUpTile({ size = 64 }: { size?: number }) {
|
|
29
|
+
const glyph = size * 206 / 256; const pad = (size - glyph) / 2; const dot = glyph * 3.84 / 24;
|
|
30
|
+
return <View accessibilityElementsHidden importantForAccessibility="no-hide-descendants"
|
|
31
|
+
style={{ width: size, height: size, borderRadius: size * 52 / 256, backgroundColor: "#222126", overflow: "hidden" }}>
|
|
32
|
+
<View style={{ position: "absolute", left: pad, top: pad }}><Icon icon={TILE_GLYPH} size={glyph} color="#ffffff" /></View>
|
|
33
|
+
<View style={{ position: "absolute", left: pad + glyph * FOLLOW_UP_DOT.x - dot / 2, top: pad + glyph * FOLLOW_UP_DOT.y - dot / 2, width: dot, height: dot, borderRadius: dot / 2, backgroundColor: "#B79CF0", zIndex: 1 }} />
|
|
34
|
+
</View>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type SetupPage = { kind: "cover" } | { kind: "step"; index: number; count: number };
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The frame. `page` decides the header: a cover page (welcome, done) has none, only Close in the corner; a step has the
|
|
41
|
+
* title row with "2 of 7" and the progress rule. `footer` is the pinned row of moves.
|
|
42
|
+
*/
|
|
43
|
+
export function SetupShell({ theme, compact, open, page, onClose, footer, scrollRef, children }: {
|
|
44
|
+
theme: Theme; compact: boolean; open: boolean; page: SetupPage; onClose: () => void; footer: ReactNode; scrollRef?: RefObject<NativeScrollView | null>; children: ReactNode;
|
|
45
|
+
}) {
|
|
46
|
+
const c = theme.colors; const t = text(c, compact);
|
|
47
|
+
const win = useWindowDimensions();
|
|
48
|
+
const reduced = useReducedMotion();
|
|
49
|
+
const close = useRef<View>(null);
|
|
50
|
+
useEffect(() => { if (open && !compact) (close.current as unknown as { focus?: () => void } | null)?.focus?.(); }, [open, compact]);
|
|
51
|
+
const progress = page.kind === "step" ? (page.index + 1) / page.count : 0;
|
|
52
|
+
const rule = page.kind === "step" && <View accessibilityRole="progressbar" accessibilityLabel={`Step ${page.index + 1} of ${page.count}`}
|
|
53
|
+
accessibilityValue={{ min: 1, max: page.count, now: page.index + 1 }} style={{ height: 2, backgroundColor: c.surface2 }}>
|
|
54
|
+
<View style={{ width: `${progress * 100}%`, height: 2, backgroundColor: withAlpha(c.foreground, 0.7) }} />
|
|
55
|
+
</View>;
|
|
56
|
+
const foot = <View style={[{ borderTopWidth: 1, borderTopColor: c.border, backgroundColor: compact ? c.surface1 : c.surface0, flexDirection: "row", alignItems: "center", gap: 8,
|
|
57
|
+
paddingHorizontal: compact ? 16 : INSET - 8, paddingTop: compact ? 8 : 12, paddingBottom: compact ? 0 : 12 }, compact ? bottomInset(true) : null]}>{footer}</View>;
|
|
58
|
+
|
|
59
|
+
if (compact) return <Modal title={page.kind === "step" ? `${SETUP_TITLE} · ${page.index + 1} of ${page.count}` : SETUP_TITLE} open={open} onOpenChange={next => { if (!next) onClose(); }}>
|
|
60
|
+
<Modal.Content scrollable={false} contentContainerStyle={{ padding: 0, gap: 0 }} style={{ flex: 1 }}>
|
|
61
|
+
{rule}
|
|
62
|
+
{/* While a field has focus or the keyboard is up, the footer steps aside (invariant 43). */}
|
|
63
|
+
<DockedPane compact scrollRef={scrollRef as never} contentContainerStyle={{ paddingHorizontal: 20, paddingTop: page.kind === "cover" ? 24 : 16, paddingBottom: 24 }}
|
|
64
|
+
dock={({ yields }) => !yields && foot}>{children}</DockedPane>
|
|
65
|
+
</Modal.Content>
|
|
66
|
+
</Modal>;
|
|
67
|
+
|
|
68
|
+
const headerButton = (state: { hovered?: boolean }) => ({ padding: 8, borderRadius: 8, backgroundColor: state.hovered ? c.surface1 : "transparent" });
|
|
69
|
+
const closeButton = <Pressable ref={close} accessibilityRole="button" accessibilityLabel="Close" accessibilityHint="Setup stays where you left it. Finish setup on Follow-up's Home opens it again."
|
|
70
|
+
onPress={onClose} style={state => headerButton(state as { hovered?: boolean })}>
|
|
71
|
+
{state => <Icon name="X" size={16} color={state.pressed ? c.foreground : c.foregroundMuted} />}
|
|
72
|
+
</Pressable>;
|
|
73
|
+
return <RNModal transparent visible={open} animationType={reduced ? "none" : "fade"} onRequestClose={onClose}>
|
|
74
|
+
<View style={{ flex: 1, alignItems: "center", justifyContent: "center", padding: 24, backgroundColor: "rgba(0,0,0,0.55)" }}>
|
|
75
|
+
<View role="dialog" aria-modal aria-label={SETUP_TITLE}
|
|
76
|
+
style={{ width: Math.min(WIDTH, win.width - 48), height: Math.min(HEIGHT, win.height - 48), overflow: "hidden", backgroundColor: c.surface0, borderRadius: 12, borderWidth: 1, borderColor: c.surface2 }}>
|
|
77
|
+
{page.kind === "step"
|
|
78
|
+
? <View>
|
|
79
|
+
<View style={{ flexDirection: "row", alignItems: "center", gap: 10, paddingLeft: INSET, paddingRight: INSET - 16, paddingVertical: 12 }}>
|
|
80
|
+
<Icon icon={FOLLOW_UP_ICON} size={16} color={c.foregroundMuted} />
|
|
81
|
+
<Text role="heading" numberOfLines={1} style={{ flex: 1, minWidth: 0, color: c.foreground, fontSize: 14, fontWeight: "500" }}>{SETUP_TITLE}</Text>
|
|
82
|
+
<Text style={[t.meta, { fontVariant: ["tabular-nums"] }]}>{`${page.index + 1} of ${page.count}`}</Text>
|
|
83
|
+
{closeButton}
|
|
84
|
+
</View>
|
|
85
|
+
{rule}
|
|
86
|
+
</View>
|
|
87
|
+
: <View style={{ position: "absolute", top: 10, right: 10, zIndex: 1 }}>{closeButton}</View>}
|
|
88
|
+
<DockedPane compact={false} scrollRef={scrollRef as never} style={{ minHeight: 0 }} dock={() => foot}
|
|
89
|
+
contentContainerStyle={{ paddingHorizontal: INSET, paddingTop: page.kind === "cover" ? 32 : 24, paddingBottom: page.kind === "cover" ? 32 : 24, ...(page.kind === "cover" ? { flexGrow: 1, justifyContent: "center" } : null) }}>{children}</DockedPane>
|
|
90
|
+
</View>
|
|
91
|
+
</View>
|
|
92
|
+
</RNModal>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const FEATURES = [
|
|
96
|
+
{ icon: "Inbox", title: "Needs you", line: "One list of what only you can decide: a merge, a question, a permission." },
|
|
97
|
+
{ icon: "Wrench", title: "Repairs", line: "Review comments, failed checks and conflicts go back to the agent that made the PR." },
|
|
98
|
+
{ icon: "MessageCircleQuestion", title: "Questions", line: "Agents ask with options and a recommendation. Your answer goes to their chat." },
|
|
99
|
+
{ icon: "CircleCheckBig", title: "Done means done", line: "A workspace is done once its PRs merge and the follow-up checks are finished." },
|
|
100
|
+
] as const;
|
|
101
|
+
|
|
102
|
+
/** The welcome page: the tile, the name, what it does in one line, the four things it does, and how long setup takes. */
|
|
103
|
+
export function WelcomeBody({ theme, compact, name }: { theme: Theme; compact: boolean; name: string }) {
|
|
104
|
+
const c = theme.colors; const t = text(c, compact);
|
|
105
|
+
return <View style={{ gap: compact ? 24 : 32 }}>
|
|
106
|
+
<View style={{ alignItems: "center", gap: 14 }}>
|
|
107
|
+
<View style={[{ borderRadius: 16 }, isLight(c) ? { shadowColor: "#000", shadowOpacity: 0.18, shadowRadius: 16, shadowOffset: { width: 0, height: 6 } } : { borderWidth: 1, borderColor: withAlpha("#ffffff", 0.08) }]}>
|
|
108
|
+
<FollowUpTile size={compact ? 60 : 64} />
|
|
109
|
+
</View>
|
|
110
|
+
<View style={{ alignItems: "center", gap: 6 }}>
|
|
111
|
+
<Text role="heading" style={{ color: c.foreground, fontSize: compact ? 24 : 26, lineHeight: compact ? 30 : 32, fontWeight: "600", letterSpacing: -0.4 }}>{`Welcome to ${name}`}</Text>
|
|
112
|
+
<Text style={{ color: c.foregroundMuted, fontSize: compact ? 15 : 14, lineHeight: compact ? 22 : 21, textAlign: "center", maxWidth: 440 }}>
|
|
113
|
+
It follows your agents' pull requests until the work is done, and asks you only for the decisions.
|
|
114
|
+
</Text>
|
|
115
|
+
</View>
|
|
116
|
+
</View>
|
|
117
|
+
<View style={{ flexDirection: compact ? "column" : "row", flexWrap: "wrap", rowGap: compact ? 16 : 22, columnGap: 24 }}>
|
|
118
|
+
{FEATURES.map(f => <View key={f.title} style={{ width: compact ? "100%" : "47%", flexGrow: 1, flexDirection: "row", gap: 12 }}>
|
|
119
|
+
<View style={{ width: 32, height: 32, borderRadius: 8, alignItems: "center", justifyContent: "center", ...raised(c), backgroundColor: c.surface1 }}>
|
|
120
|
+
<Icon name={f.icon} size={16} color={c.foreground} />
|
|
121
|
+
</View>
|
|
122
|
+
<View style={{ flex: 1, minWidth: 0, gap: 2 }}>
|
|
123
|
+
<Text style={t.label}>{f.title}</Text>
|
|
124
|
+
<Text style={t.meta}>{f.line}</Text>
|
|
125
|
+
</View>
|
|
126
|
+
</View>)}
|
|
127
|
+
</View>
|
|
128
|
+
{/* What setup costs, in view before the button that starts it. */}
|
|
129
|
+
<Text style={[t.meta, { textAlign: compact ? "left" : "center" }]}>About two minutes. Nothing goes out on its own until you finish.</Text>
|
|
130
|
+
</View>;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export type DoneFact = { icon: string; tone?: "success" | "muted"; line: string };
|
|
134
|
+
|
|
135
|
+
/** The done page: a quiet green check, what is now true, and the facts setup settled, one per line. */
|
|
136
|
+
export function DoneBody({ theme, compact, facts, following = true }: { theme: Theme; compact: boolean; facts: readonly DoneFact[]; following?: boolean }) {
|
|
137
|
+
const c = theme.colors; const t = text(c, compact);
|
|
138
|
+
return <View style={{ gap: compact ? 24 : 28 }}>
|
|
139
|
+
<View style={{ alignItems: "center", gap: 14 }}>
|
|
140
|
+
<View style={{ width: 56, height: 56, borderRadius: 28, alignItems: "center", justifyContent: "center", backgroundColor: tint(c.statusSuccess, c) }}>
|
|
141
|
+
<Icon name="Check" size={28} color={c.statusSuccess} />
|
|
142
|
+
</View>
|
|
143
|
+
<View style={{ alignItems: "center", gap: 6 }}>
|
|
144
|
+
<Text role="heading" style={{ color: c.foreground, fontSize: compact ? 24 : 26, lineHeight: compact ? 30 : 32, fontWeight: "600", letterSpacing: -0.4 }}>You're set up</Text>
|
|
145
|
+
<Text style={{ color: c.foregroundMuted, fontSize: compact ? 15 : 14, lineHeight: compact ? 22 : 21, textAlign: "center", maxWidth: 420 }}>
|
|
146
|
+
{following ? "Follow-up is watching your workspaces now." : "Follow-up starts with your next workspace."} What needs you shows on Home and in a pill above the chat.
|
|
147
|
+
</Text>
|
|
148
|
+
</View>
|
|
149
|
+
</View>
|
|
150
|
+
<View style={{ ...raised(c), borderRadius: 10, backgroundColor: c.surface1, overflow: "hidden", alignSelf: "center", width: "100%", maxWidth: 480 }}>
|
|
151
|
+
{facts.map((f, i) => <View key={f.line} style={{ flexDirection: "row", alignItems: "center", gap: 10, paddingHorizontal: 16, paddingVertical: 12, borderTopWidth: i ? 1 : 0, borderTopColor: c.border }}>
|
|
152
|
+
<Icon name={f.icon} size={16} color={f.tone === "success" ? c.statusSuccess : c.foregroundMuted} />
|
|
153
|
+
<Text style={[t.body, { flex: 1 }]}>{f.line}</Text>
|
|
154
|
+
</View>)}
|
|
155
|
+
</View>
|
|
156
|
+
<Text style={[t.meta, { textAlign: "center" }]}>Change any of this in Follow-up settings. Setup is there too, under General.</Text>
|
|
157
|
+
</View>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** A quiet text link for the footer's left side ("What's new in 2.5.0", "Skip setup"). */
|
|
161
|
+
export function FooterLink({ theme, compact, title, hint, onPress, icon }: { theme: Theme; compact: boolean; title: string; hint?: string; onPress: () => void; icon?: string }) {
|
|
162
|
+
const c = theme.colors;
|
|
163
|
+
return <Pressable accessibilityRole="button" accessibilityHint={hint} onPress={onPress} hitSlop={compact ? 0 : 6}
|
|
164
|
+
style={state => ({ flexDirection: "row", alignItems: "center", gap: 6, minHeight: compact ? 44 : 32, paddingHorizontal: 8, borderRadius: 6, backgroundColor: (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
|
|
165
|
+
{icon && <Icon name={icon} size={14} color={c.foregroundMuted} />}
|
|
166
|
+
<Text style={{ color: c.foregroundMuted, fontSize: compact ? 14 : 12, lineHeight: compact ? 19 : 16, fontWeight: "500" }}>{title}</Text>
|
|
167
|
+
</Pressable>;
|
|
168
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { Icon } from "@getpaseo/plugin/client/ui";
|
|
4
|
+
import { Pressable, Text } from "./text";
|
|
5
|
+
import { Button, text, type Theme } from "./kit";
|
|
6
|
+
import { finishSetupLine, setupOwner, setupPopup } from "../shared/setup-popup";
|
|
7
|
+
import { Setup, TITLES, useOnboarding, type SetupDeps } from "./onboarding";
|
|
8
|
+
import { ReleaseNotesSheet, useReleaseNotes } from "./release-notes";
|
|
9
|
+
import { reopenSetup, resetSetupSession, setupClosed, setupSession, useSetupSession } from "./setup-ui";
|
|
10
|
+
import { useViewVersion } from "./view-store";
|
|
11
|
+
|
|
12
|
+
export { resetSetupSession };
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Setup's popup (setup-is-one-popup) on whichever Follow-up surface mounts first: Home, the workspace panel or the
|
|
16
|
+
* sidebar item, like What's new. It opens by itself while setup is under way (a first install, or Set up again) and
|
|
17
|
+
* Close hasn't put it away on this device; the done page stays up after Finish. The rules are shared/setup-popup.ts;
|
|
18
|
+
* the steps and their moves are client/onboarding.tsx `Setup`, the same set-onboarding calls agents' tools make.
|
|
19
|
+
*/
|
|
20
|
+
export function SetupGate({ surface, theme, compact, deps = {} }: { surface: string; theme: Theme; compact: boolean; deps?: Partial<SetupDeps> }) {
|
|
21
|
+
const onboarding = useOnboarding();
|
|
22
|
+
const session = useSetupSession();
|
|
23
|
+
useViewVersion();
|
|
24
|
+
const closed = setupClosed();
|
|
25
|
+
const view = onboarding.data;
|
|
26
|
+
const decision = setupPopup({ view, closed, done: session.done });
|
|
27
|
+
const notes = useReleaseNotes().data;
|
|
28
|
+
const [notesOpen, setNotesOpen] = useState(false);
|
|
29
|
+
// Setup over (finished, skipped, or by an agent): forget Close, so the next Set up again opens the popup by itself.
|
|
30
|
+
useEffect(() => { if (view && !view.show && !session.done) reopenSetup(); }, [view, session.done]);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (decision === "open" && session.owner == null) setupSession.set({ owner: setupOwner(session.owner, surface) });
|
|
33
|
+
}, [decision, session.owner, surface]);
|
|
34
|
+
useEffect(() => () => { if (setupSession.get().owner === surface) setupSession.set({ owner: null }); }, [surface]);
|
|
35
|
+
if (decision !== "open" || session.owner !== surface || !view) return null;
|
|
36
|
+
const full: SetupDeps = {
|
|
37
|
+
openSettings: deps.openSettings ?? (() => undefined), openHome: deps.openHome, name: notes?.name,
|
|
38
|
+
whatsNew: notes ? { version: notes.version, open: () => setNotesOpen(true) } : null,
|
|
39
|
+
};
|
|
40
|
+
return <>
|
|
41
|
+
<Setup theme={theme} compact={compact} view={view} deps={full} />
|
|
42
|
+
{notesOpen && <ReleaseNotesSheet theme={theme} compact={compact} onClose={() => setNotesOpen(false)} />}
|
|
43
|
+
</>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Home's one line while Close has put setup away: it names the step setup stopped on and opens the popup there. */
|
|
47
|
+
export function FinishSetupLine({ theme, compact }: { theme: Theme; compact: boolean }) {
|
|
48
|
+
const c = theme.colors; const t = text(c, compact);
|
|
49
|
+
const view = useOnboarding().data;
|
|
50
|
+
useViewVersion();
|
|
51
|
+
const line = finishSetupLine(view, setupClosed());
|
|
52
|
+
if (!line) return null;
|
|
53
|
+
// Where setup stopped, by the step's own title, so the line says what is left.
|
|
54
|
+
const meta = line.step === "intro" ? "Setup hasn't started yet." : `Next: ${TITLES[line.step]}`;
|
|
55
|
+
if (compact) return <Pressable accessibilityRole="button" accessibilityLabel={line.label} accessibilityHint={meta} onPress={reopenSetup}
|
|
56
|
+
style={state => ({ flexDirection: "row", alignItems: "center", gap: 10, minHeight: 56, marginHorizontal: 16, paddingHorizontal: 14, paddingVertical: 10, borderRadius: 10, borderWidth: 1, borderColor: c.border, backgroundColor: state.pressed ? c.surface2 : c.surface1 })}>
|
|
57
|
+
<Icon name="ListChecks" size={16} color={c.foregroundMuted} />
|
|
58
|
+
<View style={{ flex: 1, minWidth: 0, gap: 1 }}>
|
|
59
|
+
<Text numberOfLines={1} style={t.label}>{line.label}</Text>
|
|
60
|
+
<Text numberOfLines={1} style={t.meta}>{meta}</Text>
|
|
61
|
+
</View>
|
|
62
|
+
<Icon name="ChevronRight" size={16} color={c.foregroundMuted} />
|
|
63
|
+
</Pressable>;
|
|
64
|
+
return <View style={{ flexDirection: "row", alignItems: "center", gap: 10, marginHorizontal: 16, paddingLeft: 12, paddingRight: 4, paddingVertical: 4, borderRadius: 8, backgroundColor: c.surface1 }}>
|
|
65
|
+
<Icon name="ListChecks" size={14} color={c.foregroundMuted} />
|
|
66
|
+
<Text style={[t.meta, { flex: 1 }]}>{meta}</Text>
|
|
67
|
+
<Button theme={theme} kind="ghost" title={line.label} onPress={reopenSetup} />
|
|
68
|
+
</View>;
|
|
69
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
import { deviceStorage } from "../shared/settings-nav";
|
|
3
|
+
import { SETUP_CLOSED_KEY } from "../shared/setup-popup";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Setup's popup in this app session (setup-is-one-popup, client/setup-gate.tsx): which Follow-up surface draws it
|
|
7
|
+
* (`owner`, the first to want it) and whether the done page is up (`done`: after Finish the server already says setup
|
|
8
|
+
* is over). Close is the device's, not the session's: SETUP_CLOSED_KEY in the device's view state, so a put-away popup
|
|
9
|
+
* stays away after a reload until Home's Finish setup line opens it.
|
|
10
|
+
*/
|
|
11
|
+
type Session = { owner: string | null; done: boolean };
|
|
12
|
+
let state: Session = { owner: null, done: false };
|
|
13
|
+
const listeners = new Set<() => void>();
|
|
14
|
+
export const setupSession = {
|
|
15
|
+
get: () => state,
|
|
16
|
+
set(next: Partial<Session>) { state = { ...state, ...next }; listeners.forEach(l => l()); },
|
|
17
|
+
subscribe(l: () => void) { listeners.add(l); return () => { listeners.delete(l); }; },
|
|
18
|
+
};
|
|
19
|
+
export const useSetupSession = () => useSyncExternalStore(setupSession.subscribe, setupSession.get, setupSession.get);
|
|
20
|
+
/** Tests and a fresh app session: nobody draws the popup, no done page. */
|
|
21
|
+
export const resetSetupSession = () => setupSession.set({ owner: null, done: false });
|
|
22
|
+
|
|
23
|
+
export const setupClosed = () => deviceStorage.get(SETUP_CLOSED_KEY) === "1";
|
|
24
|
+
/** Close (X): put the popup away on this device. The server hears nothing; setup stays on its step. */
|
|
25
|
+
export const closeSetup = () => deviceStorage.set(SETUP_CLOSED_KEY, "1");
|
|
26
|
+
/** Finish setup, Set up again, or setup ending: the next time setup is under way, the popup opens by itself. */
|
|
27
|
+
export const reopenSetup = () => { if (deviceStorage.get(SETUP_CLOSED_KEY) === "1") deviceStorage.set(SETUP_CLOSED_KEY, ""); };
|
package/client/shipping.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
|
+
import { PagedRows } from "./paged-list";
|
|
2
3
|
import { ActivityIndicator, TextInput, useWindowDimensions, View } from "react-native";
|
|
3
4
|
import { Text } from "./text";
|
|
4
5
|
import { useRpc } from "@getpaseo/plugin/client";
|
|
@@ -60,11 +61,11 @@ export function ShippingSettings({ theme, compact }: { theme: Theme; compact: bo
|
|
|
60
61
|
{signInWarning(data) && <Text accessibilityRole="alert" style={[t.meta, { color: c.statusWarning }]}>{signInWarning(data)}</Text>}
|
|
61
62
|
{data.repos.length ? <Disclosure id="shipping.repos" title="Repositories" summary={reposShippingSummary(data.repos)}
|
|
62
63
|
defaultOpen={data.repos.length <= 6} theme={theme} compact={compact}>
|
|
63
|
-
{data.repos
|
|
64
|
+
<PagedRows items={data.repos} theme={theme} compact={compact} noun="repositories" row={(row, i) => <View key={row.repo} style={{ borderTopWidth: i ? 1 : 0, borderTopColor: c.border }}>
|
|
64
65
|
<Disclosure framed={false} id={`shipping.repo.${row.repo}`} title={row.repo} summary={repoShippingSummary(row)} defaultOpen={false} theme={theme} compact={compact}>
|
|
65
66
|
<RepoShipping row={row} view={data} theme={theme} compact={compact} busy={change.isPending} set={(input, label) => change.mutate({ repo: row.repo, ...input, toast: `${row.repo}: ${label}` })} />
|
|
66
67
|
</Disclosure>
|
|
67
|
-
</View>
|
|
68
|
+
</View>} />
|
|
68
69
|
<View style={{ flexDirection: "row", alignItems: "center", gap: 12, borderTopWidth: 1, borderTopColor: c.border, paddingHorizontal: compact ? 16 : 14, paddingVertical: 8 }}>
|
|
69
70
|
<Text style={[t.meta, { flex: 1 }]}>{`${checked ? `Checked ${checked}` : "Not checked yet"} · looks at what's installed and how each repository is set up.`}</Text>
|
|
70
71
|
<Button theme={theme} compact={compact} title={recheck.isPending ? "Checking…" : "Check again"} disabled={recheck.isPending} loading={recheck.isPending} onPress={() => recheck.mutate()} />
|
|
@@ -197,12 +198,12 @@ export function ShippingStep({ theme, compact }: { theme: Theme; compact: boolea
|
|
|
197
198
|
onValueChange={value => change.mutate({ default: value })} />
|
|
198
199
|
</SettingsCard>
|
|
199
200
|
<Disclosure id="setup.shipping.repos" title="Show repositories" summary={`${rows.length} on GitHub`} defaultOpen={false} theme={theme} compact={compact}>
|
|
200
|
-
{rows
|
|
201
|
+
<PagedRows items={rows} theme={theme} compact={compact} noun="repositories" row={(r, i) => <View key={r.repo} style={{ borderTopWidth: i ? 1 : 0, borderTopColor: c.border }}>{row(r)}</View>} />
|
|
201
202
|
</Disclosure>
|
|
202
203
|
{later}
|
|
203
204
|
</View>;
|
|
204
205
|
return <View style={{ gap: 10 }}>
|
|
205
|
-
<SettingsCard
|
|
206
|
+
<SettingsCard><PagedRows items={rows} theme={theme} compact={compact} noun="repositories" row={row} /></SettingsCard>
|
|
206
207
|
{warning && <Text accessibilityRole="alert" style={[t.meta, { color: c.statusWarning }]}>{warning}</Text>}
|
|
207
208
|
{later}
|
|
208
209
|
</View>;
|
package/client/stacks.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { View } from "react-native";
|
|
2
|
+
import { PagedRows } from "./paged-list";
|
|
2
3
|
import { Pressable, Text } from "./text";
|
|
3
4
|
import { openExternalUrl } from "@getpaseo/plugin/client";
|
|
4
5
|
import { Icon } from "@getpaseo/plugin/client/ui";
|
|
@@ -104,7 +105,8 @@ function StackRows({ name, prs, theme, open, toggle, onOpen, compact, showRepo,
|
|
|
104
105
|
<Text numberOfLines={1} style={[t.label, { flex: 1, fontSize: 12, lineHeight: 17 }]}>{name}</Text>
|
|
105
106
|
<Text style={[t.small, { fontVariant: ["tabular-nums"] }]}>{settled ? `${prs.length} PR${prs.length === 1 ? "" : "s"}` : `${merged} of ${prs.length} merged`}</Text>
|
|
106
107
|
</View>
|
|
107
|
-
{
|
|
108
|
+
{/* A stack's rows page (client/paged-list.tsx); the rail's ends are the stack's own, so it runs on across a page break. */}
|
|
109
|
+
<PagedRows items={items} resetKey={hits ? "search" : ""} theme={theme} compact={compact} noun="PRs" row={(item, i) => {
|
|
108
110
|
const first = i === 0, last = i === items.length - 1 && !fold;
|
|
109
111
|
if (item.kind === "pr") return <PrRow key={item.pr.key} pr={item.pr} theme={theme} first={first} last={last} showRepo={showRepo} onOpen={onOpen} compact={compact} wide={wide} hit={hits?.get(item.pr)} />;
|
|
110
112
|
const expanded = open(item.key), n = item.prs.length;
|
|
@@ -124,7 +126,7 @@ function StackRows({ name, prs, theme, open, toggle, onOpen, compact, showRepo,
|
|
|
124
126
|
<Text style={[t.meta, { color: c.foreground, fontVariant: ["tabular-nums"] }]}>{expanded ? `Hide ${n} in review` : `+${n} in review`}<Text style={{ color: c.foregroundMuted }}>{` · #${item.prs[0]!.number}–#${item.prs.at(-1)!.number}`}</Text></Text>
|
|
125
127
|
</View>
|
|
126
128
|
</Pressable>;
|
|
127
|
-
}
|
|
129
|
+
}} />
|
|
128
130
|
{fold && <Pressable accessibilityRole="button" aria-expanded={showDone} accessibilityState={{ expanded: showDone }} accessibilityLabel={`${showDone ? "Hide" : "Show"} ${done.length} merged PR${done.length === 1 ? "" : "s"} in ${name}`} onPress={() => toggle(foldKey)}
|
|
129
131
|
style={state => ({ flexDirection: "row", gap: 10, paddingHorizontal: 12, minHeight: compact ? 44 : 30, backgroundColor: state.pressed ? c.surface2 : (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
|
|
130
132
|
<View style={{ width: NODE, alignItems: "center" }}>
|
|
@@ -139,6 +141,9 @@ function StackRows({ name, prs, theme, open, toggle, onOpen, compact, showRepo,
|
|
|
139
141
|
</View>;
|
|
140
142
|
}
|
|
141
143
|
|
|
144
|
+
/** Stacks on one page of the Pull requests card; each stack pages its own rows. */
|
|
145
|
+
export const STACKS_PER_PAGE = 10;
|
|
146
|
+
|
|
142
147
|
export function StacksCard({ workspace: w, theme, compact, open, toggle, onOpen, wide = false }: { workspace: Workspace; theme: Theme; compact: boolean; open: (key: string) => boolean; toggle: (key: string) => void; onOpen: (key: string) => void; wide?: boolean }) {
|
|
143
148
|
const c = theme.colors; const t = text(c);
|
|
144
149
|
const stacks = orderedStacks(w.prs);
|
|
@@ -155,7 +160,10 @@ export function StacksCard({ workspace: w, theme, compact, open, toggle, onOpen,
|
|
|
155
160
|
// Every PR in the order the card draws them, settled stacks included: the search's "n of N" and its filter.
|
|
156
161
|
const search = useSectionSearch(w.id, "prs", { theme, compact, items: [...active, ...settled].flatMap(s => stackOrder(s.prs).reverse()), fields: prFields });
|
|
157
162
|
const hits = search.hits;
|
|
158
|
-
|
|
163
|
+
// Stacks page too (client/paged-list.tsx): a long-lived workspace keeps hundreds of settled ones. A search pages only
|
|
164
|
+
// the stacks with a hit, so no page is empty.
|
|
165
|
+
const stackRows = (list: typeof stacks, isSettled: boolean) => <PagedRows items={hits ? list.filter(s => s.prs.some(p => hits.has(p))) : list} size={STACKS_PER_PAGE} resetKey={search.query ?? ""} theme={theme} compact={compact} noun="stacks"
|
|
166
|
+
row={s => <StackRows key={s.name} name={s.name} prs={s.prs} theme={theme} open={open} toggle={toggle} onOpen={onOpen} compact={compact} showRepo={showRepo} settled={isSettled} wide={wide} hits={hits} />} />;
|
|
159
167
|
return <Card theme={theme} compact={compact} icon="GitPullRequest" title="Pull requests" count={openCount ? `${openCount} open` : undefined} right={search.button} search={search.header}>
|
|
160
168
|
{hits && !hits.size && <NoMatchRow section="prs" query={search.query!} theme={theme} compact={compact} />}
|
|
161
169
|
{!hits && inFlight.map(a => <View key={a.id} style={{ flexDirection: "row", gap: 8, paddingHorizontal: 12, paddingVertical: 8, borderTopWidth: 1, borderTopColor: c.border }}>
|
package/client/tasks.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import { taskTriggerRpc } from "../shared/contracts";
|
|
|
10
10
|
import { linkedQuestion, type TaskStatus } from "../shared/task-status";
|
|
11
11
|
import { finishedParts, summaryParts, taskSummary, taskViewRows, type TaskViewRow } from "../shared/task-view";
|
|
12
12
|
import { Button, Card, text, type Theme, SubmitScope } from "./kit";
|
|
13
|
+
import { usePagedList } from "./paged-list";
|
|
13
14
|
import { Spinner } from "./motion";
|
|
14
15
|
import { staleColor, type Colors } from "./theme";
|
|
15
16
|
import { RichText } from "./rich-text";
|
|
@@ -199,6 +200,8 @@ export function TasksCard({ workspace: w, theme, compact, open, toggle, onOpenQu
|
|
|
199
200
|
// nothing), so the row, the live line and Home all read the same states.
|
|
200
201
|
const rows = taskViewRows(w, w.taskAgents ?? {}, now);
|
|
201
202
|
const sum = taskSummary(w, now, rows);
|
|
203
|
+
// Opened, the card pages its rows (client/paged-list.tsx): due and stale sort first, so page 1 holds what moves.
|
|
204
|
+
const page = usePagedList({ items: rows, theme, compact, noun: "tasks" });
|
|
202
205
|
if (!rows.length && !sum.finished) return null;
|
|
203
206
|
// Collapsed by default, in every state: the tasks are the agent's, and the line says whether it keeps up.
|
|
204
207
|
const shown = open("tasks");
|
|
@@ -207,11 +210,12 @@ export function TasksCard({ workspace: w, theme, compact, open, toggle, onOpenQu
|
|
|
207
210
|
const label = `${parts.neutral}${parts.stale ? ` · ${parts.stale}` : ""}`;
|
|
208
211
|
return <Card theme={theme} compact={compact} icon="ListTodo" title="Agent's tasks" fold={{ open: shown, onToggle: () => toggle("tasks"), label }}
|
|
209
212
|
right={<Text numberOfLines={1} style={{ flexShrink: 1, color: c.foregroundMuted, fontSize: 12, lineHeight: 17, fontVariant: ["tabular-nums"] }}>{parts.neutral}{parts.stale ? <Text style={{ color: staleColor(c), fontWeight: "600" }}>{` · ${parts.stale}`}</Text> : null}</Text>}>
|
|
210
|
-
{shown &&
|
|
213
|
+
{shown && page.shown.map(r => {
|
|
211
214
|
const q = linkedQuestion(r.o, w);
|
|
212
215
|
return <TaskRow key={r.o.id} row={r} w={w} theme={theme} compact={compact} open={open(`task:${r.o.id}`)} openAgent={openAgent} onSchedule={() => setSchedule(r.o.id)}
|
|
213
216
|
onPress={() => r.kind === "needs-you" && q && onOpenQuestion ? onOpenQuestion(q.id) : toggle(`task:${r.o.id}`)} />;
|
|
214
217
|
})}
|
|
218
|
+
{shown && page.footer}
|
|
215
219
|
{shown && !rows.length && <View style={{ paddingHorizontal: compact ? 14 : 12, paddingVertical: 10, borderTopWidth: 1, borderTopColor: c.border }}>
|
|
216
220
|
<Text style={t.meta}>Nothing open. The agent records work that outlives a merge here, like a migration to run or a production check.</Text>
|
|
217
221
|
</View>}
|