paseo-follow-up 1.4.0-beta.2 → 1.4.0-beta.21
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 +15 -4
- package/README.md +59 -6
- package/client/about.tsx +22 -12
- package/client/agents.tsx +132 -0
- package/client/brief.tsx +200 -72
- package/client/chat.tsx +12 -4
- package/client/display.tsx +62 -11
- package/client/header.tsx +40 -19
- package/client/home-chrome.tsx +135 -40
- package/client/home-list.tsx +90 -35
- package/client/home-view.ts +66 -8
- package/client/home.tsx +268 -77
- package/client/inbox-store.ts +15 -7
- package/client/keys.ts +3 -0
- package/client/kit.tsx +46 -15
- package/client/large.tsx +9 -10
- package/client/live.tsx +8 -6
- package/client/needs-you.tsx +36 -8
- package/client/onboarding.tsx +455 -0
- package/client/panel.tsx +98 -23
- package/client/pill.tsx +41 -21
- package/client/pr-controls.tsx +38 -14
- package/client/pr-sheet.tsx +8 -6
- package/client/questions.tsx +6 -4
- package/client/reviewers.tsx +63 -21
- package/client/settings-shell.tsx +77 -0
- package/client/settings.tsx +145 -49
- package/client/shipping.tsx +186 -0
- package/client/spec.tsx +1 -1
- package/client/stacks.tsx +4 -3
- package/client/tasks.tsx +1 -1
- package/client/theme.ts +21 -0
- package/client/visibility.ts +7 -0
- package/client/workspace-data.ts +37 -0
- package/docs/screenshots/decision-card-answered-phone-light.png +0 -0
- package/docs/screenshots/decision-card-expanded-chat-light.png +0 -0
- package/docs/screenshots/decision-card-partial-phone-dark.png +0 -0
- package/docs/screenshots/decision-card-unanswered-phone-dark.png +0 -0
- package/index.client.tsx +27 -8
- package/index.server.ts +257 -24
- package/package.json +5 -3
- package/server/about.ts +15 -4
- package/server/agent-actions.ts +75 -6
- package/server/agent-hook.mjs +54 -16
- package/server/agent-parity.ts +149 -0
- package/server/agent-settings.ts +124 -0
- package/server/ai-jobs.ts +88 -23
- package/server/daemon.ts +165 -105
- package/server/directory.ts +165 -0
- package/server/discovery.ts +34 -6
- package/server/engine.ts +31 -9
- package/server/etag.ts +14 -0
- package/server/github.ts +66 -5
- package/server/hook-source.ts +1 -1
- package/server/inbox-directory.ts +14 -19
- package/server/inbox.ts +28 -1
- package/server/mcp-source.ts +1 -1
- package/server/mcp.d.mts +3 -1
- package/server/mcp.mjs +83 -10
- package/server/native-tools.ts +3 -2
- package/server/onboarding.ts +101 -0
- package/server/overseer-prompt-source.ts +1 -1
- package/server/overseer-prompt.md +1 -0
- package/server/overseer.ts +72 -8
- package/server/pr-actions.ts +91 -15
- package/server/pr-workflow.ts +188 -0
- package/server/questions.ts +1 -1
- package/server/ranker.ts +431 -0
- package/server/recovery-config.ts +17 -0
- package/server/scopes.ts +20 -8
- package/server/tasks.ts +9 -3
- package/server/trust-bypass.ts +125 -0
- package/shared/about.ts +8 -3
- package/shared/activity.ts +3 -1
- package/shared/agent-settings.ts +169 -0
- package/shared/attention.ts +8 -4
- package/shared/brief.ts +44 -0
- package/shared/chat.ts +3 -1
- package/shared/contracts.ts +42 -4
- package/shared/display.ts +16 -1
- package/shared/headline.ts +5 -0
- package/shared/home.ts +6 -0
- package/shared/model.ts +12 -1
- package/shared/onboarding.ts +243 -0
- package/shared/overseer.ts +10 -2
- package/shared/pr-actions.ts +26 -4
- package/shared/pr-workflow.ts +133 -0
- package/shared/questions.ts +17 -0
- package/shared/ranker.ts +237 -0
- package/shared/search.ts +25 -5
- package/shared/settings-nav.ts +97 -0
- package/skills/follow-through/SKILL.md +3 -1
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";
|
|
2
|
+
import { Animated, Easing, Keyboard, Platform, Pressable, ScrollView, Text, View, type ViewStyle } from "react-native";
|
|
3
|
+
import { useRpc, useSettings } from "@getpaseo/plugin/client";
|
|
4
|
+
import { Icon, copyText, useToast } from "@getpaseo/plugin/client/ui";
|
|
5
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
|
+
import { agentSettingsRpc, followSettingsRpc, onboardingChecksRpc, onboardingRpc, setFollowSettingsRpc, setOnboardingRpc } from "../shared/contracts";
|
|
7
|
+
import { displayPreferences } from "../shared/display";
|
|
8
|
+
import { ONBOARDING_STEPS, autoSendWrites, checksSummary, type Check, type OnboardingStep, type OnboardingView } from "../shared/onboarding";
|
|
9
|
+
import { Button, IconButton, errorText, text, type Theme } from "./kit";
|
|
10
|
+
import { ReviewerSettings } from "./reviewers";
|
|
11
|
+
import { ShippingStep } from "./shipping";
|
|
12
|
+
import { Spinner, useReducedMotion } from "./motion";
|
|
13
|
+
import { raised, runningColor, tint, withAlpha, type Colors } from "./theme";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Getting started: five steps that take a fresh install to a configured Follow-up. Shown in Home's place while the
|
|
17
|
+
* server says so (fresh install, or "Set up Follow-up again"), never forced on an existing install.
|
|
18
|
+
* Every switch writes through the Settings screen's own RPC or settings document as it changes; the flow itself only
|
|
19
|
+
* saves which step it's on, so a reload resumes there.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
export const onboardingKey = ["follow-through", "onboarding"];
|
|
23
|
+
const checksKey = ["follow-through", "onboarding-checks"];
|
|
24
|
+
const followKey = ["follow-through", "follow-settings"];
|
|
25
|
+
|
|
26
|
+
/** The server's view of setup. Read once per Home mount (no polling) and refreshed after each action. */
|
|
27
|
+
export function useOnboarding() {
|
|
28
|
+
const read = useRpc(onboardingRpc);
|
|
29
|
+
return useQuery({ queryKey: onboardingKey, queryFn: () => read({}), staleTime: Infinity, retry: 1 });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type SetupDeps = {
|
|
33
|
+
/** Opens Follow-up's settings, on a category when given (agents, reviewers, following). */
|
|
34
|
+
openSettings(category?: string): void;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const TITLES: Record<OnboardingStep, string> = {
|
|
38
|
+
intro: "Follow-up keeps your agents' PRs moving",
|
|
39
|
+
checks: "Check your setup",
|
|
40
|
+
defaults: "What Follow-up does without asking",
|
|
41
|
+
shipping: "How do you ship PRs?",
|
|
42
|
+
reviewers: "Who should review your PRs?",
|
|
43
|
+
helpers: "Helpers, and where things are",
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** Bottom clearance on phones. TODO(rebase): kit.tsx's bottomInset from the mobile rework replaces this. */
|
|
47
|
+
function bottomPad(compact: boolean): ViewStyle {
|
|
48
|
+
if (!compact) return { paddingBottom: 16 };
|
|
49
|
+
if (Platform.OS === "web") return { paddingBottom: "max(12px, env(safe-area-inset-bottom))" as unknown as number };
|
|
50
|
+
return { paddingBottom: Platform.OS === "ios" ? 34 : 24 };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function Setup({ theme, compact, view, deps }: { theme: Theme; compact: boolean; view: OnboardingView; deps: SetupDeps }) {
|
|
54
|
+
const c = theme.colors; const t = text(c);
|
|
55
|
+
const act = useRpc(setOnboardingRpc); const cache = useQueryClient(); const toast = useToast();
|
|
56
|
+
const [step, setStep] = useState<OnboardingStep>(view.step);
|
|
57
|
+
const index = ONBOARDING_STEPS.indexOf(step);
|
|
58
|
+
const scroll = useRef<ScrollView>(null);
|
|
59
|
+
const follow = useFollowSettings();
|
|
60
|
+
// Checks start on the first frame so step 2 usually opens with its answers in. One cached call, never polled.
|
|
61
|
+
const checks = useChecks();
|
|
62
|
+
const move = useMutation({
|
|
63
|
+
mutationFn: (input: Parameters<typeof act>[0]) => act(input),
|
|
64
|
+
onSuccess: next => { if (!next.show) cache.setQueryData(onboardingKey, next); },
|
|
65
|
+
onError: error => toast.error(errorText(error)),
|
|
66
|
+
});
|
|
67
|
+
const go = (next: OnboardingStep) => { setStep(next); scroll.current?.scrollTo({ y: 0, animated: false }); move.mutate({ action: "step", step: next }); };
|
|
68
|
+
const finish = () => move.mutate({ action: "finish" }, { onSuccess: () => {
|
|
69
|
+
const n = follow.data?.workspaces.filter(w => w.enable_tracking && !w.optedOut).length ?? 0;
|
|
70
|
+
toast.show(n ? `Set up. Following ${n} workspace${n === 1 ? "" : "s"}.` : "Set up. Follow-up starts with your next workspace.", { variant: "success" });
|
|
71
|
+
} });
|
|
72
|
+
const skip = () => move.mutate({ action: "skip" }, { onSuccess: () => toast.show("Setup skipped. Set it up any time from Follow-up settings, Set up Follow-up again.") });
|
|
73
|
+
const last = index === ONBOARDING_STEPS.length - 1;
|
|
74
|
+
const keyboard = useKeyboardUp(compact);
|
|
75
|
+
const failing = step === "checks" && checks.data ? checksSummary(checks.data.checks).state === "fail" : false;
|
|
76
|
+
|
|
77
|
+
const body = step === "intro" ? <IntroStep theme={theme} compact={compact} follow={follow.data ?? null} />
|
|
78
|
+
: step === "checks" ? <ChecksStep theme={theme} compact={compact} checks={checks} deps={deps} />
|
|
79
|
+
: step === "defaults" ? <DefaultsStep theme={theme} compact={compact} held={view.holdsAutoSends} />
|
|
80
|
+
: step === "shipping" ? <ShippingStep theme={theme} compact={compact} />
|
|
81
|
+
: step === "reviewers" ? <ReviewerSettings theme={theme} compact={compact} />
|
|
82
|
+
: <HelpersStep theme={theme} compact={compact} deps={deps} checks={checks.data?.checks ?? null} />;
|
|
83
|
+
const lead: Record<OnboardingStep, string> = {
|
|
84
|
+
intro: "It follows your agents' pull requests until the work is done, sends fixes back to them, and asks you only for decisions.",
|
|
85
|
+
checks: "Follow-up reads PRs with the GitHub CLI, and its helper agents run on Claude or Codex. Checking is free.",
|
|
86
|
+
defaults: "These are on now. Change anything here; it saves as you go, and Settings has the same switches.",
|
|
87
|
+
shipping: "Follow-up merges and tracks PRs the way each repository already works. It picked these; change one if it's wrong.",
|
|
88
|
+
reviewers: "When you press Add reviewers on a PR, Follow-up asks these people. Set a default for all repositories, or a list for one. Until then, PRs without reviewers show in Needs you.",
|
|
89
|
+
helpers: "Two optional agents. They read, summarise and rank. They never change code or message anyone.",
|
|
90
|
+
};
|
|
91
|
+
const column: ViewStyle = { width: "100%", maxWidth: 560, alignSelf: "center", paddingHorizontal: compact ? 16 : 24 };
|
|
92
|
+
|
|
93
|
+
return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
|
|
94
|
+
<View style={[column, { flexDirection: "row", alignItems: "center", gap: 12, paddingTop: compact ? 8 : 20, paddingBottom: 8 }]}>
|
|
95
|
+
<Progress theme={theme} index={index} onPick={i => i < index && go(ONBOARDING_STEPS[i])} />
|
|
96
|
+
<Button theme={theme} compact={compact} kind="ghost" title="Skip setup" accessibilityHint="Leaves setup. Every setting keeps its current value." onPress={skip} disabled={move.isPending} />
|
|
97
|
+
</View>
|
|
98
|
+
<ScrollView ref={scroll} style={{ flex: 1 }} contentContainerStyle={{ paddingBottom: 24 }} keyboardShouldPersistTaps="handled">
|
|
99
|
+
<StepFade key={step} style={[column, { gap: compact ? 14 : 16, paddingTop: compact ? 8 : 20 }]}>
|
|
100
|
+
<View style={{ gap: 6 }}>
|
|
101
|
+
<Text accessibilityRole="header" style={{ color: c.foreground, fontSize: 20, lineHeight: 26, fontWeight: "600" }}>{TITLES[step]}</Text>
|
|
102
|
+
<Text style={[t.body, { color: c.foregroundMuted, maxWidth: 520 }]}>{lead[step]}</Text>
|
|
103
|
+
</View>
|
|
104
|
+
{body}
|
|
105
|
+
</StepFade>
|
|
106
|
+
</ScrollView>
|
|
107
|
+
{/* While typing a reviewer on a phone the bar steps aside, so Continue never sits over the keyboard. */}
|
|
108
|
+
{!keyboard && <View style={[{ borderTopWidth: 1, borderTopColor: c.border, backgroundColor: c.surface0, paddingTop: 12 }, bottomPad(compact)]}>
|
|
109
|
+
<View style={[column, { flexDirection: "row", alignItems: "center", gap: 8 }]}>
|
|
110
|
+
{index > 0 && (compact
|
|
111
|
+
? <IconButton theme={theme} compact icon="ChevronLeft" label="Back" onPress={() => go(ONBOARDING_STEPS[index - 1])} />
|
|
112
|
+
: <Button theme={theme} kind="ghost" icon="ChevronLeft" title="Back" onPress={() => go(ONBOARDING_STEPS[index - 1])} />)}
|
|
113
|
+
{!compact && <View style={{ flex: 1 }} />}
|
|
114
|
+
{step === "reviewers" && <Button theme={theme} compact={compact} kind="ghost" title="Skip, set later" onPress={() => go(ONBOARDING_STEPS[index + 1])} />}
|
|
115
|
+
<Button theme={theme} compact={compact} grow={compact} kind="primary" icon={last ? "Check" : undefined}
|
|
116
|
+
title={last ? "Finish" : failing ? "Continue anyway" : "Continue"} loading={last && move.isPending}
|
|
117
|
+
onPress={() => last ? finish() : go(ONBOARDING_STEPS[index + 1])} />
|
|
118
|
+
</View>
|
|
119
|
+
</View>}
|
|
120
|
+
</View>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Phones: whether the on-screen keyboard is up (native events; on the web, the visual viewport shrinking). */
|
|
124
|
+
function useKeyboardUp(compact: boolean): boolean {
|
|
125
|
+
const [up, setUp] = useState(false);
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
if (!compact) return;
|
|
128
|
+
if (Platform.OS === "web") {
|
|
129
|
+
type Viewport = { height: number; addEventListener(e: "resize", f: () => void): void; removeEventListener(e: "resize", f: () => void): void };
|
|
130
|
+
const vv = (globalThis as { visualViewport?: Viewport }).visualViewport;
|
|
131
|
+
const win = globalThis as unknown as { innerHeight: number };
|
|
132
|
+
if (!vv) return;
|
|
133
|
+
const check = () => setUp(win.innerHeight - vv.height > 150);
|
|
134
|
+
vv.addEventListener("resize", check);
|
|
135
|
+
return () => vv.removeEventListener("resize", check);
|
|
136
|
+
}
|
|
137
|
+
const show = Keyboard.addListener(Platform.OS === "ios" ? "keyboardWillShow" : "keyboardDidShow", () => setUp(true));
|
|
138
|
+
const hide = Keyboard.addListener(Platform.OS === "ios" ? "keyboardWillHide" : "keyboardDidHide", () => setUp(false));
|
|
139
|
+
return () => { show.remove(); hide.remove(); };
|
|
140
|
+
}, [compact]);
|
|
141
|
+
return up;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** "2 of 5" and one short segment per step, drawn like the stack bar but in neutral ink: progress isn't a PR state. */
|
|
145
|
+
function Progress({ theme, index, onPick }: { theme: Theme; index: number; onPick: (i: number) => void }) {
|
|
146
|
+
const c = theme.colors; const t = text(c);
|
|
147
|
+
return <View style={{ flex: 1, flexDirection: "row", alignItems: "center", gap: 10 }} accessibilityRole="progressbar" accessibilityLabel={`Step ${index + 1} of ${ONBOARDING_STEPS.length}`}
|
|
148
|
+
accessibilityValue={{ min: 1, max: ONBOARDING_STEPS.length, now: index + 1 }}>
|
|
149
|
+
<Text style={[t.small, { minWidth: 34 }]}>{`${index + 1} of ${ONBOARDING_STEPS.length}`}</Text>
|
|
150
|
+
<View style={{ flex: 1, maxWidth: 220, flexDirection: "row", gap: 3 }}>
|
|
151
|
+
{ONBOARDING_STEPS.map((s, i) => <Pressable key={s} disabled={i >= index} onPress={() => onPick(i)} accessibilityLabel={i < index ? `Back to step ${i + 1}` : undefined}
|
|
152
|
+
hitSlop={{ top: 12, bottom: 12 }} style={{ flex: 1, height: 14, justifyContent: "center" }}>
|
|
153
|
+
<View style={{ height: 3, borderRadius: 2, backgroundColor: i === index ? c.foreground : i < index ? withAlpha(c.foreground, 0.4) : c.border }} />
|
|
154
|
+
</Pressable>)}
|
|
155
|
+
</View>
|
|
156
|
+
</View>;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** Step change: a short fade and rise; reduced motion gets the content at once. */
|
|
160
|
+
function StepFade({ children, style }: { children: ReactNode; style: ViewStyle | ViewStyle[] }) {
|
|
161
|
+
const reduced = useReducedMotion();
|
|
162
|
+
const v = useRef(new Animated.Value(reduced ? 1 : 0)).current;
|
|
163
|
+
useEffect(() => { if (!reduced) Animated.timing(v, { toValue: 1, duration: 180, easing: Easing.out(Easing.cubic), useNativeDriver: Platform.OS !== "web" }).start(); }, []);
|
|
164
|
+
return <Animated.View style={[style as ViewStyle, { opacity: v, transform: [{ translateY: v.interpolate({ inputRange: [0, 1], outputRange: [6, 0] }) }] }]}>{children}</Animated.View>;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function useFollowSettings() {
|
|
168
|
+
const read = useRpc(followSettingsRpc);
|
|
169
|
+
return useQuery({ queryKey: followKey, queryFn: () => read({}) });
|
|
170
|
+
}
|
|
171
|
+
function useChecks() {
|
|
172
|
+
const read = useRpc(onboardingChecksRpc);
|
|
173
|
+
return useQuery({ queryKey: checksKey, queryFn: () => read({}), staleTime: 60_000, refetchOnWindowFocus: false, retry: false });
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const Panel = ({ c, children }: { c: Colors; children: ReactNode }) =>
|
|
177
|
+
<View style={{ ...raised(c), borderRadius: 10, backgroundColor: c.surface1, overflow: "hidden" }}>{children}</View>;
|
|
178
|
+
|
|
179
|
+
// ---------- 1. what it is ----------
|
|
180
|
+
|
|
181
|
+
const EXAMPLE = [
|
|
182
|
+
{ glyph: "CircleX", tone: "danger", line: "Checks failed on #418", caption: "Follow-up notices" },
|
|
183
|
+
{ glyph: "spinner", tone: "running", line: "Repair sent to the agent · 2m", caption: "and sends the fix to the agent that made the PR" },
|
|
184
|
+
{ glyph: "CircleCheck", tone: "success", dot: "warning", line: "#418 approved", caption: "then asks you only for the decision" },
|
|
185
|
+
] as const;
|
|
186
|
+
|
|
187
|
+
function IntroStep({ theme, compact, follow }: { theme: Theme; compact: boolean; follow: { workspaces: { enable_tracking: boolean; optedOut: boolean }[] } | null }) {
|
|
188
|
+
const c = theme.colors; const t = text(c);
|
|
189
|
+
const reduced = useReducedMotion();
|
|
190
|
+
const [phase, setPhase] = useState(reduced ? 2 : 0);
|
|
191
|
+
useEffect(() => { if (reduced || phase >= 2) return; const id = setTimeout(() => setPhase(p => p + 1), 1600); return () => clearTimeout(id); }, [phase, reduced]);
|
|
192
|
+
const n = follow?.workspaces.filter(w => w.enable_tracking && !w.optedOut).length ?? null;
|
|
193
|
+
const tone = (k: string) => k === "danger" ? c.statusDanger : k === "success" ? c.statusSuccess : runningColor(c);
|
|
194
|
+
const e = EXAMPLE[phase];
|
|
195
|
+
return <View style={{ gap: 14 }}>
|
|
196
|
+
<Panel c={c}>
|
|
197
|
+
<View style={{ padding: compact ? 14 : 16, gap: 10 }}>
|
|
198
|
+
<View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
|
|
199
|
+
<Text numberOfLines={1} style={[t.label, { flex: 1 }]}>TKT-1042 Add CSV export</Text>
|
|
200
|
+
<Text style={[t.small, { paddingHorizontal: 6, paddingVertical: 1, borderRadius: 4, backgroundColor: c.surface2 }]}>Example</Text>
|
|
201
|
+
</View>
|
|
202
|
+
{/* The stack bar: #417 merged, #418 the one this example follows. */}
|
|
203
|
+
<View style={{ flexDirection: "row", gap: 3, height: 4 }}>
|
|
204
|
+
<View style={{ flex: 1, borderRadius: 2, backgroundColor: c.foregroundMuted, opacity: 0.55 }} />
|
|
205
|
+
<View style={{ flex: 1, borderRadius: 2, backgroundColor: c.border, alignItems: "center", justifyContent: "center" }}>
|
|
206
|
+
<View style={{ width: 10, height: 4, borderRadius: 2, backgroundColor: tone(e.tone) }} />
|
|
207
|
+
</View>
|
|
208
|
+
</View>
|
|
209
|
+
<View accessibilityLiveRegion="polite" style={{ flexDirection: "row", alignItems: "center", gap: 8, minHeight: 20 }}>
|
|
210
|
+
{e.glyph === "spinner" ? <Spinner color={runningColor(c)} size={14} /> : <Icon name={e.glyph} size={14} color={tone(e.tone)} />}
|
|
211
|
+
<Text style={[t.body, { flex: 1 }]}>{e.line}</Text>
|
|
212
|
+
{phase === 2 && <View style={{ flexDirection: "row", alignItems: "center", gap: 4, paddingHorizontal: 7, minHeight: 22, borderRadius: 11, backgroundColor: tint(c.statusWarning, c) }}>
|
|
213
|
+
<Icon name="CircleAlert" size={12} color={c.statusWarning} />
|
|
214
|
+
<Text style={{ color: c.statusWarning, fontSize: 12, lineHeight: 16, fontWeight: "600" }}>Needs you: Merge #418</Text>
|
|
215
|
+
</View>}
|
|
216
|
+
</View>
|
|
217
|
+
</View>
|
|
218
|
+
{/* What Follow-up did, step by step: the rail fills as the example plays. */}
|
|
219
|
+
<View style={{ borderTopWidth: 1, borderTopColor: c.border, paddingHorizontal: compact ? 14 : 16, paddingVertical: 10, gap: 6 }}>
|
|
220
|
+
{EXAMPLE.map((x, i) => <View key={x.line} style={{ flexDirection: "row", alignItems: "center", gap: 8, opacity: i <= phase ? 1 : 0.35 }}>
|
|
221
|
+
<View style={{ width: 8, height: 8, borderRadius: 4, backgroundColor: i <= phase ? ("dot" in x ? c.statusWarning : tone(x.tone)) : c.border }} />
|
|
222
|
+
<Text style={t.meta}>{x.caption}</Text>
|
|
223
|
+
</View>)}
|
|
224
|
+
</View>
|
|
225
|
+
</Panel>
|
|
226
|
+
<View style={{ gap: 4 }}>
|
|
227
|
+
{[
|
|
228
|
+
["Inbox", "Needs you", "One list of what only you can decide: a merge, a question, a permission."],
|
|
229
|
+
["Wrench", "Repairs", "Review comments, conflicts and failed checks go to the workspace's agent in one batch."],
|
|
230
|
+
["MessageCircleQuestion", "Questions", "Agents ask you here, with options and a recommendation. Your answer goes to their chat."],
|
|
231
|
+
].map(([icon, title, line]) => <View key={title} style={{ flexDirection: "row", gap: 10, paddingVertical: 6 }}>
|
|
232
|
+
<Icon name={icon} size={16} color={c.foregroundMuted} />
|
|
233
|
+
<View style={{ flex: 1, gap: 1 }}><Text style={t.label}>{title}</Text><Text style={t.meta}>{line}</Text></View>
|
|
234
|
+
</View>)}
|
|
235
|
+
</View>
|
|
236
|
+
{n !== null && <View style={{ flexDirection: "row", alignItems: "center", gap: 8, minHeight: compact ? 44 : 36, paddingHorizontal: 12, borderRadius: 8, backgroundColor: c.surface1 }}>
|
|
237
|
+
<Icon name="Radar" size={14} color={c.foregroundMuted} />
|
|
238
|
+
<Text style={[t.body, { flex: 1 }]}>{n ? `Already following your ${n} workspace${n === 1 ? "" : "s"}. Step 3 lists them.` : "No workspaces yet. Follow-up starts with the next one you create."}</Text>
|
|
239
|
+
</View>}
|
|
240
|
+
</View>;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// ---------- 2. checks ----------
|
|
244
|
+
|
|
245
|
+
function ChecksStep({ theme, compact, checks, deps }: { theme: Theme; compact: boolean; checks: ReturnType<typeof useChecks>; deps: SetupDeps }) {
|
|
246
|
+
const c = theme.colors; const t = text(c);
|
|
247
|
+
const read = useRpc(onboardingChecksRpc); const cache = useQueryClient();
|
|
248
|
+
const again = useMutation({ mutationFn: () => read({ fresh: true }), onSuccess: data => cache.setQueryData(checksKey, data) });
|
|
249
|
+
const busy = checks.isPending || again.isPending;
|
|
250
|
+
const rows = checks.data?.checks ?? null;
|
|
251
|
+
const summary = rows ? checksSummary(rows) : null;
|
|
252
|
+
return <View style={{ gap: 10 }}>
|
|
253
|
+
<View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
|
|
254
|
+
<Text style={[t.meta, { flex: 1 }]}>{busy ? "Checking…" : summary?.line ?? ""}</Text>
|
|
255
|
+
<Button theme={theme} compact={compact} kind="secondary" icon="RefreshCw" title="Check again" loading={again.isPending} disabled={busy} onPress={() => again.mutate()} />
|
|
256
|
+
</View>
|
|
257
|
+
{(checks.error || again.error) && <Text accessibilityRole="alert" style={[t.meta, { color: c.statusDanger }]}>{errorText(checks.error ?? again.error)}</Text>}
|
|
258
|
+
<Panel c={c}>
|
|
259
|
+
{rows ? rows.map((row, i) => <CheckRow key={row.id} theme={theme} compact={compact} row={row} first={i === 0} checking={again.isPending} deps={deps} />)
|
|
260
|
+
: ["GitHub", "Claude", "Codex", "Agent tools"].map((label, i) => <CheckRow key={label} theme={theme} compact={compact} first={i === 0} checking deps={deps} row={{ id: label, label, state: "pending", detail: "Checking…", fix: null }} />)}
|
|
261
|
+
</Panel>
|
|
262
|
+
{summary?.state === "fail" && <Text style={t.meta}>You can continue anyway. Following and Needs you work without what's missing; each row says what it affects.</Text>}
|
|
263
|
+
</View>;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
const GLYPH: Record<Check["state"], string> = { ok: "CircleCheck", warn: "CircleAlert", fail: "CircleX", pending: "CircleDashed", off: "CircleMinus" };
|
|
267
|
+
function CheckRow({ theme, compact, row, first, checking, deps }: { theme: Theme; compact: boolean; row: Check; first: boolean; checking: boolean; deps: SetupDeps }) {
|
|
268
|
+
const c = theme.colors; const t = text(c); const toast = useToast();
|
|
269
|
+
const [open, setOpen] = useState(false);
|
|
270
|
+
const color = row.state === "ok" ? c.statusSuccess : row.state === "warn" ? c.statusWarning : row.state === "fail" ? c.statusDanger : c.foregroundMuted;
|
|
271
|
+
return <View accessibilityLabel={`${row.label}: ${row.detail}`} style={{ flexDirection: "row", gap: 10, paddingHorizontal: compact ? 14 : 16, paddingVertical: 12, borderTopWidth: first ? 0 : 1, borderTopColor: c.border }}>
|
|
272
|
+
<View style={{ paddingTop: 1 }}>{checking ? <Spinner color={c.foregroundMuted} size={16} /> : <Icon name={GLYPH[row.state]} size={16} color={color} />}</View>
|
|
273
|
+
<View style={{ flex: 1, minWidth: 0, gap: 3 }}>
|
|
274
|
+
<Text style={t.label}>{row.label}</Text>
|
|
275
|
+
<Text style={t.meta}>{row.detail}</Text>
|
|
276
|
+
{row.fix && row.state === "warn" && !open && <Pressable accessibilityRole="button" accessibilityState={{ expanded: false }} onPress={() => setOpen(true)} style={{ minHeight: compact ? 44 : 28, justifyContent: "center", alignSelf: "flex-start" }}>
|
|
277
|
+
<Text style={[t.meta, { color: c.foreground, textDecorationLine: "underline" }]}>How to fix</Text>
|
|
278
|
+
</Pressable>}
|
|
279
|
+
{row.fix && (row.state !== "warn" || open) && <View style={{ gap: 6, marginTop: 4 }}>
|
|
280
|
+
<Text style={[t.meta, { color: c.foreground }]}>{row.fix.text}</Text>
|
|
281
|
+
{row.fix.command && <View style={{ flexDirection: "row", alignItems: "center", gap: 6, alignSelf: "flex-start", maxWidth: "100%", paddingLeft: 10, borderRadius: 6, backgroundColor: c.surface2 }}>
|
|
282
|
+
<Text selectable numberOfLines={1} style={{ flexShrink: 1, color: c.foreground, fontSize: 12, lineHeight: 17, fontFamily: Platform.OS === "ios" ? "Menlo" : "ui-monospace, SFMono-Regular, Menlo, monospace" }}>{row.fix.command}</Text>
|
|
283
|
+
<IconButton theme={theme} compact={compact} icon="Copy" label={`Copy ${row.fix.command}`} onPress={() => { void copyText(row.fix!.command!).then(() => toast.show("Copied", { variant: "success" }), () => toast.error("Couldn't copy here")); }} />
|
|
284
|
+
</View>}
|
|
285
|
+
{row.fix.settings && <Button theme={theme} compact={compact} kind="ghost" icon="Settings" title="Open Settings, Agents" onPress={() => deps.openSettings(row.fix!.settings!)} />}
|
|
286
|
+
</View>}
|
|
287
|
+
</View>
|
|
288
|
+
</View>;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// ---------- 3. what it does on its own ----------
|
|
292
|
+
|
|
293
|
+
function SwitchRow({ theme, compact, label, hint, value, onChange, disabled, first, children }: { theme: Theme; compact: boolean; label: string; hint: string; value: boolean | null; onChange: (v: boolean) => void; disabled?: boolean; first?: boolean; children?: ReactNode }) {
|
|
294
|
+
const c = theme.colors; const t = text(c);
|
|
295
|
+
const on = !!value;
|
|
296
|
+
return <View style={{ borderTopWidth: first ? 0 : 1, borderTopColor: c.border }}>
|
|
297
|
+
<Pressable accessibilityRole="switch" accessibilityState={{ checked: on, disabled: disabled || value === null }} aria-checked={on} accessibilityLabel={label} accessibilityHint={hint}
|
|
298
|
+
disabled={disabled || value === null} onPress={() => onChange(!on)}
|
|
299
|
+
style={({ pressed }) => ({ flexDirection: "row", alignItems: "center", gap: 12, paddingHorizontal: compact ? 14 : 16, paddingVertical: 12, minHeight: compact ? 56 : 48, backgroundColor: pressed ? c.surface2 : "transparent" })}>
|
|
300
|
+
<View style={{ flex: 1, minWidth: 0, gap: 2 }}>
|
|
301
|
+
<Text style={t.label}>{label}</Text>
|
|
302
|
+
<Text style={t.meta}>{hint}</Text>
|
|
303
|
+
</View>
|
|
304
|
+
<View style={{ width: 36, height: 22, borderRadius: 11, padding: 2, backgroundColor: on ? c.accent : c.surface2, borderWidth: on ? 0 : 1, borderColor: c.border, justifyContent: "center", opacity: value === null ? 0.4 : 1 }}>
|
|
305
|
+
<View style={{ width: 18, height: 18, borderRadius: 9, backgroundColor: on ? c.accentForeground : c.foregroundMuted, alignSelf: on ? "flex-end" : "flex-start" }} />
|
|
306
|
+
</View>
|
|
307
|
+
</Pressable>
|
|
308
|
+
{children}
|
|
309
|
+
</View>;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function DefaultsStep({ theme, compact, held }: { theme: Theme; compact: boolean; held: boolean }) {
|
|
313
|
+
const c = theme.colors; const t = text(c);
|
|
314
|
+
const follow = useFollowSettings(); const write = useRpc(setFollowSettingsRpc); const cache = useQueryClient(); const toast = useToast();
|
|
315
|
+
const display = useSettings(displayPreferences);
|
|
316
|
+
const [all, setAll] = useState(false);
|
|
317
|
+
const change = useMutation({
|
|
318
|
+
mutationFn: async (inputs: Parameters<typeof write>[0][]) => { let last = null; for (const input of inputs) last = await write(input); return last; },
|
|
319
|
+
onSuccess: value => { if (value) cache.setQueryData(followKey, value); void cache.invalidateQueries({ queryKey: ["follow-through", "project-settings"] }); },
|
|
320
|
+
onError: error => toast.error(errorText(error)),
|
|
321
|
+
});
|
|
322
|
+
const data = follow.data;
|
|
323
|
+
const list = data?.workspaces ?? [];
|
|
324
|
+
const followed = list.filter(w => w.enable_tracking && !w.optedOut).length;
|
|
325
|
+
const shown = all || list.length <= 8 ? list : list.slice(0, 5);
|
|
326
|
+
const trust = display.status === "ready" ? display.values.enable_trust_bypass : null;
|
|
327
|
+
const saveDisplay = (patch: Partial<typeof displayPreferences.schema._output>) => {
|
|
328
|
+
if (display.status !== "ready") return;
|
|
329
|
+
void display.save({ ...display.values, ...patch }, display.revision).catch(e => toast.error(errorText(e)));
|
|
330
|
+
};
|
|
331
|
+
return <View style={{ gap: 10 }}>
|
|
332
|
+
{follow.error && <Text accessibilityRole="alert" style={[t.meta, { color: c.statusDanger }]}>{errorText(follow.error)}</Text>}
|
|
333
|
+
<Panel c={c}>
|
|
334
|
+
<SwitchRow first theme={theme} compact={compact} label="Follow every workspace" hint="New and existing workspaces, except any you turn off below." value={data?.enable_follow_every ?? null} disabled={change.isPending}
|
|
335
|
+
onChange={v => change.mutate([{ enable_follow_every: v }])}>
|
|
336
|
+
{list.length > 0 && <View style={{ paddingLeft: compact ? 14 : 16, paddingBottom: 6 }}>
|
|
337
|
+
{shown.map(w => {
|
|
338
|
+
const on = w.enable_tracking && !w.optedOut;
|
|
339
|
+
return <Pressable key={w.id} accessibilityRole="checkbox" accessibilityState={{ checked: on }} aria-checked={on} accessibilityLabel={`Follow ${w.title}`} disabled={change.isPending}
|
|
340
|
+
onPress={() => change.mutate([{ workspace: { workspaceId: w.id, follow: !on } }])}
|
|
341
|
+
style={({ pressed }) => ({ flexDirection: "row", alignItems: "center", gap: 10, minHeight: compact ? 44 : 32, paddingRight: compact ? 14 : 16, borderTopWidth: 1, borderTopColor: c.border, backgroundColor: pressed ? c.surface2 : "transparent" })}>
|
|
342
|
+
<Text style={[t.body, { flex: 1, color: on ? c.foreground : c.foregroundMuted }]}>{w.title}</Text>
|
|
343
|
+
{(!on || w.dormant) && <Text style={t.small}>{on ? "Resting" : "Not followed"}</Text>}
|
|
344
|
+
<View style={{ width: 18, height: 18, borderRadius: 5, borderWidth: 1, borderColor: on ? c.accent : c.border, backgroundColor: on ? c.accent : "transparent", alignItems: "center", justifyContent: "center" }}>
|
|
345
|
+
{on && <Icon name="Check" size={12} color={c.accentForeground} />}
|
|
346
|
+
</View>
|
|
347
|
+
</Pressable>;
|
|
348
|
+
})}
|
|
349
|
+
{shown.length < list.length && <Pressable accessibilityRole="button" onPress={() => setAll(true)} style={{ minHeight: compact ? 44 : 32, justifyContent: "center", borderTopWidth: 1, borderTopColor: c.border }}>
|
|
350
|
+
<Text style={[t.meta, { color: c.foreground }]}>{`Show all ${list.length}`}</Text>
|
|
351
|
+
</Pressable>}
|
|
352
|
+
</View>}
|
|
353
|
+
</SwitchRow>
|
|
354
|
+
<SwitchRow theme={theme} compact={compact} label="Send repairs automatically" value={data?.enable_auto_sends_default ?? null} disabled={change.isPending}
|
|
355
|
+
hint={`Review threads and failed checks go to the workspace's agent on their own, once it's idle. Off: each batch waits for your click.${followed ? ` Here it also applies to the ${followed} already followed.` : ""}${held ? " Nothing goes out on its own until you finish setup." : ""}`}
|
|
356
|
+
onChange={v => change.mutate(autoSendWrites(v, list))} />
|
|
357
|
+
<SwitchRow theme={theme} compact={compact} label="Trust bypass agents" value={trust}
|
|
358
|
+
hint="An agent you started in bypass or full access sometimes still stops on a tool prompt. Follow-up approves those so it keeps going, and logs each one. Off brings the prompts back."
|
|
359
|
+
onChange={v => saveDisplay({ enable_trust_bypass: v })} />
|
|
360
|
+
</Panel>
|
|
361
|
+
<Text style={t.meta}>Follow-up never merges, requests reviewers, archives or messages people on its own.</Text>
|
|
362
|
+
</View>;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// ---------- 5. helpers and where to find things ----------
|
|
366
|
+
|
|
367
|
+
function HelpersStep({ theme, compact, deps, checks }: { theme: Theme; compact: boolean; deps: SetupDeps; checks: Check[] | null }) {
|
|
368
|
+
const c = theme.colors; const t = text(c);
|
|
369
|
+
const display = useSettings(displayPreferences); const toast = useToast();
|
|
370
|
+
const readAgents = useRpc(agentSettingsRpc);
|
|
371
|
+
const agents = useQuery({ queryKey: ["follow-through", "agent-settings", "summary"], queryFn: () => readAgents({}), staleTime: 60_000 });
|
|
372
|
+
const role = (r: string) => agents.data?.roles.find(x => x.role === r)?.summary ?? null;
|
|
373
|
+
const values = display.status === "ready" ? display.values : null;
|
|
374
|
+
const save = (patch: Partial<typeof displayPreferences.schema._output>) => { if (display.status === "ready") void display.save({ ...display.values, ...patch }, display.revision).catch(e => toast.error(errorText(e))); };
|
|
375
|
+
const claudeDown = checks?.find(x => x.id === "provider-claude")?.state === "fail";
|
|
376
|
+
const on = (summary: string | null) => summary ? ` Runs on ${summary}.` : "";
|
|
377
|
+
return <View style={{ gap: 14 }}>
|
|
378
|
+
<Panel c={c}>
|
|
379
|
+
<SwitchRow first theme={theme} compact={compact} label="Overseer" value={values?.enable_overseer ?? null} onChange={v => save({ enable_overseer: v })}
|
|
380
|
+
hint={`One agent you ask about all your workspaces, from Home's search box. It starts only when you click Start on Home.${on(role("overseer"))}`} />
|
|
381
|
+
<SwitchRow theme={theme} compact={compact} label="AI priority" value={values?.enable_ranker ?? null} onChange={v => save({ enable_ranker: v })}
|
|
382
|
+
hint={`Sorts Home by what matters most, from your Linear issues, Slack mentions and review requests. About once an hour on workdays.${on(role("ranker"))}`} />
|
|
383
|
+
<View style={{ flexDirection: compact ? "column" : "row", alignItems: compact ? "flex-start" : "center", gap: 8, paddingHorizontal: compact ? 14 : 16, paddingVertical: 10, borderTopWidth: 1, borderTopColor: c.border }}>
|
|
384
|
+
<Text style={[t.meta, { flex: compact ? undefined : 1 }]}>{`What's this about? summaries use ${role("about") ?? "a small model"}.${claudeDown ? " Claude isn't available here; switch the helpers to Codex in Settings." : ""}`}</Text>
|
|
385
|
+
{compact
|
|
386
|
+
? <Pressable accessibilityRole="link" accessibilityLabel="Change models in Follow-up settings, Agents" onPress={() => deps.openSettings("agents")} style={{ minHeight: 44, justifyContent: "center" }}>
|
|
387
|
+
<Text style={[t.label, { textDecorationLine: "underline" }]}>Change models</Text>
|
|
388
|
+
</Pressable>
|
|
389
|
+
: <Button theme={theme} kind="ghost" icon="Bot" title="Change models" accessibilityLabel="Change models in Follow-up settings, Agents" onPress={() => deps.openSettings("agents")} />}
|
|
390
|
+
</View>
|
|
391
|
+
</Panel>
|
|
392
|
+
<View style={{ gap: 2 }}>
|
|
393
|
+
<Text accessibilityRole="header" style={{ color: c.foregroundMuted, fontSize: 11, lineHeight: 15, fontWeight: "600", letterSpacing: 0.5, textTransform: "uppercase", marginTop: 10, marginBottom: 4 }}>Where to find things</Text>
|
|
394
|
+
<TourRow theme={theme} thumb={<ThumbHome c={c} />} title="Home" line="Follow-up in the sidebar. Every workspace, with what needs you at the top." />
|
|
395
|
+
<TourRow theme={theme} thumb={<ThumbPanel c={c} />} title="Workspace panel"
|
|
396
|
+
line={compact ? "Tap Follow-up at the top of any workspace: its PRs, tasks and what the agent is doing." : "The Follow-up button in a workspace's header docks its PRs, tasks and what the agent is doing beside the chat."} />
|
|
397
|
+
<TourRow theme={theme} thumb={<ThumbNeeds c={c} />} title="Needs you" line="The decisions only you can make, one button each. A pill above the chat shows the same." />
|
|
398
|
+
<TourRow theme={theme} thumb={<ThumbAbout c={c} />} title="What's this about?" line="At the top of a workspace: a short summary of what it's for and where it stands, with its links." />
|
|
399
|
+
</View>
|
|
400
|
+
</View>;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
function TourRow({ theme, thumb, title, line }: { theme: Theme; thumb: ReactNode; title: string; line: string }) {
|
|
404
|
+
const c = theme.colors; const t = text(c);
|
|
405
|
+
return <View style={{ flexDirection: "row", alignItems: "center", gap: 12, paddingVertical: 8 }}>
|
|
406
|
+
<View style={{ width: 56, height: 44, borderRadius: 8, borderWidth: 1, borderColor: c.border, backgroundColor: c.surface1, overflow: "hidden", padding: 6, gap: 4 }}>{thumb}</View>
|
|
407
|
+
<View style={{ flex: 1, minWidth: 0, gap: 1 }}><Text style={t.label}>{title}</Text><Text style={t.meta}>{line}</Text></View>
|
|
408
|
+
</View>;
|
|
409
|
+
}
|
|
410
|
+
// Token-drawn thumbnails: the shape of each surface, not a screenshot.
|
|
411
|
+
const bar = (c: Colors, w: `${number}%`, color = c.border, h = 3) => <View style={{ width: w, height: h, borderRadius: 2, backgroundColor: color }} />;
|
|
412
|
+
const ThumbHome = ({ c }: { c: Colors }) => <>{bar(c, "60%", c.statusWarning)}{bar(c, "90%")}{bar(c, "75%")}{bar(c, "85%")}</>;
|
|
413
|
+
const ThumbPanel = ({ c }: { c: Colors }) => <>{bar(c, "55%", c.foregroundMuted)}<View style={{ flexDirection: "row", gap: 2 }}>{bar(c, "30%", c.foregroundMuted, 4)}{bar(c, "30%", c.border, 4)}{bar(c, "30%", c.border, 4)}</View>{bar(c, "80%")}</>;
|
|
414
|
+
const ThumbNeeds = ({ c }: { c: Colors }) => <View style={{ flex: 1, borderRadius: 4, borderWidth: 1, borderColor: c.statusWarning, padding: 4, gap: 3 }}>{bar(c, "70%")}<View style={{ width: 16, height: 5, borderRadius: 2, backgroundColor: c.accent }} /></View>;
|
|
415
|
+
const ThumbAbout = ({ c }: { c: Colors }) => <><View style={{ flexDirection: "row", alignItems: "center", gap: 3 }}><Icon name="ChevronDown" size={8} color={c.foregroundMuted} />{bar(c, "60%", c.foregroundMuted)}</View>{bar(c, "90%")}{bar(c, "80%")}</>;
|
|
416
|
+
|
|
417
|
+
// ---------- existing installs ----------
|
|
418
|
+
|
|
419
|
+
/** The one quiet line an existing install sees on Home, for a day at most. */
|
|
420
|
+
export function SetupOffer({ theme, compact, view }: { theme: Theme; compact: boolean; view: OnboardingView | undefined }) {
|
|
421
|
+
const c = theme.colors; const t = text(c);
|
|
422
|
+
const act = useRpc(setOnboardingRpc); const cache = useQueryClient(); const toast = useToast();
|
|
423
|
+
const run = useMutation({ mutationFn: (action: "restart" | "dismiss-offer") => act({ action }), onSuccess: next => cache.setQueryData(onboardingKey, next), onError: e => toast.error(errorText(e)) });
|
|
424
|
+
if (!view?.offer) return null;
|
|
425
|
+
// Phones: one row in the list's gutter. A title and one meta line that never wrap; the row opens setup, the ✕ beside
|
|
426
|
+
// it dismisses. No second row of buttons under the text.
|
|
427
|
+
if (compact) return <View style={{ flexDirection: "row", alignItems: "center", marginHorizontal: 16, borderRadius: 10, borderWidth: 1, borderColor: c.border, backgroundColor: c.surface1 }}>
|
|
428
|
+
<Pressable accessibilityRole="button" accessibilityLabel="Open setup" accessibilityHint="A two-minute setup that checks GitHub and shows what Follow-up does on its own" disabled={run.isPending}
|
|
429
|
+
onPress={() => run.mutate("restart")}
|
|
430
|
+
style={state => ({ flex: 1, minWidth: 0, flexDirection: "row", alignItems: "center", gap: 10, minHeight: 56, paddingLeft: 14, paddingRight: 4, paddingVertical: 10, borderTopLeftRadius: 10, borderBottomLeftRadius: 10, backgroundColor: state.pressed ? c.surface2 : "transparent" })}>
|
|
431
|
+
{run.isPending && run.variables === "restart" ? <Spinner color={c.foregroundMuted} size={14} label="Opening setup" /> : <Icon name="ListChecks" size={16} color={c.foregroundMuted} />}
|
|
432
|
+
<View style={{ flex: 1, minWidth: 0, gap: 1 }}>
|
|
433
|
+
<Text numberOfLines={1} style={text(c, true).label}>Two-minute setup</Text>
|
|
434
|
+
<Text numberOfLines={1} style={text(c, true).meta}>Checks GitHub, shows what runs on its own</Text>
|
|
435
|
+
</View>
|
|
436
|
+
</Pressable>
|
|
437
|
+
<IconButton theme={theme} compact icon="X" label="Dismiss the setup offer" onPress={() => run.mutate("dismiss-offer")} />
|
|
438
|
+
</View>;
|
|
439
|
+
return <View style={{ flexDirection: compact ? "column" : "row", alignItems: compact ? "stretch" : "center", gap: compact ? 6 : 10, marginHorizontal: compact ? 12 : 16, paddingLeft: 12, paddingRight: 4, paddingVertical: 4, borderRadius: 8, backgroundColor: c.surface1 }}>
|
|
440
|
+
<View style={{ flex: compact ? undefined : 1, flexDirection: "row", alignItems: "center", gap: 8, paddingTop: compact ? 8 : 0 }}>
|
|
441
|
+
<Icon name="ListChecks" size={14} color={c.foregroundMuted} />
|
|
442
|
+
<Text style={[t.meta, { flex: 1 }]}>Follow-up has a two-minute setup that checks GitHub and shows what it does on its own.</Text>
|
|
443
|
+
</View>
|
|
444
|
+
<View style={{ flexDirection: "row", alignItems: "center", gap: 2, justifyContent: compact ? "flex-end" : undefined }}>
|
|
445
|
+
<Button theme={theme} compact={compact} kind="ghost" title="Open setup" loading={run.isPending && run.variables === "restart"} onPress={() => run.mutate("restart")} />
|
|
446
|
+
<IconButton theme={theme} compact={compact} icon="X" label="Dismiss the setup offer" onPress={() => run.mutate("dismiss-offer")} />
|
|
447
|
+
</View>
|
|
448
|
+
</View>;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/** Settings and ⌘K: "Set up Follow-up again" starts the flow from the top and shows it on Home. */
|
|
452
|
+
export function useRestartSetup() {
|
|
453
|
+
const act = useRpc(setOnboardingRpc); const cache = useQueryClient();
|
|
454
|
+
return useMemo(() => async () => { const next = await act({ action: "restart" }); cache.setQueryData(onboardingKey, next); return next; }, [act, cache]);
|
|
455
|
+
}
|