paseo-follow-up 2.4.2 → 2.6.0-beta.1
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/CHANGELOG.md +19 -0
- package/OVERVIEW.md +1 -1
- package/README.md +0 -1
- package/client/home.tsx +16 -8
- package/client/live.tsx +4 -3
- package/client/new-settings.tsx +1 -1
- package/client/onboarding.tsx +50 -118
- package/client/panel.tsx +2 -1
- package/client/release-notes.tsx +98 -123
- package/client/setup-dialog.tsx +168 -0
- package/client/setup-gate.tsx +69 -0
- package/client/setup-ui.ts +27 -0
- package/client/tasks.tsx +38 -8
- package/client/updates.tsx +6 -6
- package/index.client.tsx +1 -1
- package/index.server.ts +46 -4
- package/package.json +1 -1
- package/server/agent-hook.mjs +6 -4
- package/server/agent-parity.ts +2 -2
- package/server/ai-jobs.ts +26 -5
- package/server/engine.ts +6 -2
- package/server/hook-source.ts +6 -4
- package/server/job-agent.ts +13 -2
- package/server/mcp-source.ts +4 -4
- package/server/mcp.mjs +4 -4
- package/server/obligations.ts +7 -5
- package/server/release-notes.ts +5 -5
- package/server/scheduled-tasks.ts +92 -0
- package/server/session-prompt.ts +30 -3
- package/server/turn-end.ts +130 -0
- package/server/wait-jobs.ts +18 -2
- package/server/wait.ts +17 -12
- package/shared/agent-settings.ts +9 -8
- package/shared/attention.ts +4 -0
- package/shared/changelog.ts +33 -0
- package/shared/compass.ts +5 -4
- package/shared/contracts.ts +4 -4
- package/shared/job-rows.ts +2 -2
- package/shared/message-sender.ts +2 -0
- package/shared/new-name.ts +4 -1
- package/shared/onboarding.ts +17 -13
- package/shared/provider-support.ts +83 -34
- package/shared/queue.ts +1 -1
- package/shared/recommend.ts +1 -1
- package/shared/settings-nav.ts +3 -1
- package/shared/setup-popup.ts +28 -0
- package/shared/task-due.ts +3 -1
- package/shared/task-trigger.ts +125 -1
- package/shared/wait.ts +2 -2
- package/skills/follow-up/SKILL.md +1 -1
package/client/release-notes.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useMemo, useRef, useState, useSyncExternalStore, type ReactNode } from "react";
|
|
2
2
|
import { Image, Platform, Modal as RNModal, View, useWindowDimensions, type ScrollView as NativeScrollView, type StyleProp, type ViewStyle } from "react-native";
|
|
3
3
|
import { Pressable, Text } from "./text";
|
|
4
|
-
import { useRpc } from "@getpaseo/plugin/client";
|
|
4
|
+
import { openExternalUrl, useRpc } from "@getpaseo/plugin/client";
|
|
5
5
|
import { Icon, Modal, ScrollView } from "@getpaseo/plugin/client/ui";
|
|
6
6
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
7
7
|
import { releaseNotesRpc, whatsNewSeenRpc } from "../shared/contracts";
|
|
8
|
-
import { LAST_SEEN_KEY, deviceSeenFrom, inlineRuns,
|
|
8
|
+
import { LAST_SEEN_KEY, deviceSeenFrom, inlineRuns, notesFeed, plainInline, whatsNew, type FeedNote, type InlineRun, type NoteBlock, type ReleaseNote, type ReleaseNotesView } from "../shared/changelog";
|
|
9
9
|
import { deviceStorage, viewStatus } from "../shared/settings-nav";
|
|
10
10
|
import { useViewVersion } from "./view-store";
|
|
11
11
|
import { Button, text, type Theme } from "./kit";
|
|
@@ -15,27 +15,22 @@ import { NOTES_SCROLL_ATTR, notesScrollbarCss } from "../shared/notes-scrollbar"
|
|
|
15
15
|
import { ImageViewer, ImageViewerContext, refocus, useImageViewer, viewerInline, type ViewedImage } from "./image-viewer";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Release notes on the client: What's new
|
|
19
|
-
* come from the installed package's CHANGELOG.md through
|
|
18
|
+
* Release notes on the client: What's new, one scroll of every stable version's notes, shown after an update and from
|
|
19
|
+
* Home's version line and Settings. The notes come from the installed package's CHANGELOG.md through
|
|
20
|
+
* `follow.release-notes`, read once per app session.
|
|
20
21
|
*/
|
|
21
22
|
|
|
22
23
|
export const releaseNotesKey = ["follow-up", "release-notes"];
|
|
24
|
+
/** The updater's view (`client/updates.tsx` reads it); here only for its pending notes. */
|
|
25
|
+
export const updatesKey = ["follow-up", "updates"];
|
|
23
26
|
export function useReleaseNotes() {
|
|
24
27
|
const read = useRpc(releaseNotesRpc);
|
|
25
28
|
return useQuery({ queryKey: releaseNotesKey, queryFn: () => read({}), staleTime: Infinity, retry: 1 });
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
/** A version's date in full, as Paseo's notes write it: "November 26, 2026". */
|
|
32
|
+
const fmtDate = (iso: string | null) => iso ? new Date(`${iso}T12:00:00`).toLocaleDateString(undefined, { day: "numeric", month: "long", year: "numeric" }) : null;
|
|
29
33
|
|
|
30
|
-
/** Hidden from screen readers: a visual separator only. */
|
|
31
|
-
const Dot = ({ style }: { style: object }) => <Text style={style} accessibilityElementsHidden importantForAccessibility="no-hide-descendants" aria-hidden>·</Text>;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* The text measure in the wide dialog: text lines stop here (about 75 characters) while screenshots use the full
|
|
35
|
-
* width. Unset (no cap) in the host's 520px dialog, on phones and in Settings' inline notes.
|
|
36
|
-
*/
|
|
37
|
-
const MeasureContext = createContext<number | undefined>(undefined);
|
|
38
|
-
const useMeasure = () => { const m = useContext(MeasureContext); return m ? { maxWidth: m } : null; };
|
|
39
34
|
|
|
40
35
|
/** A line's text with its bold runs semibold (the weight headings use), or the plain text when nothing is bold. */
|
|
41
36
|
const inline = (line: string, runs?: InlineRun[]): ReactNode =>
|
|
@@ -44,7 +39,7 @@ const inline = (line: string, runs?: InlineRun[]): ReactNode =>
|
|
|
44
39
|
/** One bullet: a small dot and its text. */
|
|
45
40
|
function Bullet({ text: line, runs, theme, compact }: { text: string; runs?: InlineRun[]; theme: Theme; compact: boolean }) {
|
|
46
41
|
const c = theme.colors; const t = text(c, compact);
|
|
47
|
-
return <View style={
|
|
42
|
+
return <View style={{ flexDirection: "row", gap: 8 }}>
|
|
48
43
|
<View style={{ width: 4, height: 4, borderRadius: 2, marginTop: compact ? 8 : 7, backgroundColor: c.foregroundMuted }} />
|
|
49
44
|
<Text style={[t.body, { flex: 1 }]}>{inline(line, runs)}</Text>
|
|
50
45
|
</View>;
|
|
@@ -79,32 +74,32 @@ function NoteImage({ block, theme, compact }: { block: Extract<NoteBlock, { kind
|
|
|
79
74
|
}
|
|
80
75
|
|
|
81
76
|
/**
|
|
82
|
-
* One version's notes. Shared by What's new
|
|
83
|
-
* and images, like 2.0.0) reads in full as written
|
|
84
|
-
*
|
|
77
|
+
* One version's notes. Shared by What's new and Settings' update card. A curated section (an intro, headings,
|
|
78
|
+
* paragraphs and images, like 2.0.0) reads in full as written, its intro as the first paragraph; whatever follows a
|
|
79
|
+
* `---` rule (the credits) reads as a quiet footnote. Every bullet shows: only a caller that previews a version
|
|
80
|
+
* (Settings' "What's in X", `max`) folds a long list behind "Show all N".
|
|
85
81
|
*/
|
|
86
|
-
export function VersionNotes({ note, theme, compact = false, max =
|
|
82
|
+
export function VersionNotes({ note, theme, compact = false, max = Infinity }: { note: ReleaseNote; theme: Theme; compact?: boolean; max?: number }) {
|
|
87
83
|
const c = theme.colors; const t = text(c, compact);
|
|
88
84
|
const [all, setAll] = useState(false);
|
|
89
|
-
const measure = useMeasure();
|
|
90
85
|
if (note.blocks?.length) {
|
|
91
|
-
const lead: object = { fontSize: compact ? 16 : 15, lineHeight: compact ? 24 : 22 };
|
|
92
86
|
const quietFrom = note.blocks.findIndex(b => b.kind === "rule");
|
|
93
87
|
// Headings sit a step above body text and closer to the paragraph they open than to the one before.
|
|
94
|
-
return <View style={{ gap:
|
|
88
|
+
return <View style={{ gap: 8 }}>
|
|
95
89
|
{note.blocks.map((b, i) => {
|
|
96
90
|
const quiet = quietFrom >= 0 && i > quietFrom;
|
|
97
91
|
if (b.kind === "image") return <NoteImage key={i} block={b} theme={theme} compact={compact} />;
|
|
98
92
|
if (b.kind === "rule") return <View key={i} style={{ height: 1, backgroundColor: c.border, marginTop: 16, marginBottom: 4 }} />;
|
|
99
|
-
// Section headings:
|
|
100
|
-
|
|
101
|
-
if (b.kind === "
|
|
93
|
+
// Section headings: body size, semibold (the label role), so in the feed the version number stays the strongest
|
|
94
|
+
// line and a curated section's headings read as its parts, never as versions of their own.
|
|
95
|
+
if (b.kind === "heading") return <Text key={i} accessibilityRole="header" style={[quiet ? [t.meta, { fontWeight: "600" }] : [t.label, { marginTop: i ? 12 : 0 }]]}>{b.text}</Text>;
|
|
96
|
+
if (b.kind === "text") return <Text key={i} style={[quiet ? t.meta : t.body]}>{inline(b.text, b.runs)}</Text>;
|
|
102
97
|
return <Bullet key={i} text={b.text} runs={b.runs} theme={theme} compact={compact} />;
|
|
103
98
|
})}
|
|
104
99
|
</View>;
|
|
105
100
|
}
|
|
106
101
|
const items = all ? note.items : note.items.slice(0, max);
|
|
107
|
-
return <View style={{ gap:
|
|
102
|
+
return <View style={{ gap: 8 }}>
|
|
108
103
|
{items.map((item, i) => { const runs = inlineRuns(item); return <Bullet key={i} text={plainInline(item)} runs={runs.some(r => r.bold) ? runs : undefined} theme={theme} compact={compact} />; })}
|
|
109
104
|
{!all && note.items.length > max && <Pressable accessibilityRole="button" onPress={() => setAll(true)} hitSlop={compact ? { top: 14, bottom: 14, left: 8, right: 8 } : 6}
|
|
110
105
|
style={{ minHeight: compact ? 44 : undefined, justifyContent: "center", alignSelf: "flex-start" }}>
|
|
@@ -113,53 +108,32 @@ export function VersionNotes({ note, theme, compact = false, max = 8 }: { note:
|
|
|
113
108
|
</View>;
|
|
114
109
|
}
|
|
115
110
|
|
|
116
|
-
/**
|
|
117
|
-
|
|
111
|
+
/**
|
|
112
|
+
* A version's header row, as Paseo's own What's new draws it: the number on the left, an Installed pill on the one
|
|
113
|
+
* this host runs, the date on the right, and a rule under it. A heading for screen readers ("2.4.1, installed,
|
|
114
|
+
* November 25, 2026"), so they can jump version to version.
|
|
115
|
+
*/
|
|
116
|
+
function VersionHeader({ note, theme, compact }: { note: FeedNote; theme: Theme; compact: boolean }) {
|
|
118
117
|
const c = theme.colors; const t = text(c, compact);
|
|
119
118
|
const date = fmtDate(note.date);
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
<Text style={
|
|
123
|
-
{
|
|
119
|
+
return <View accessibilityRole="header" accessibilityLabel={[note.version, note.installed ? "installed" : null, date].filter(Boolean).join(", ")}
|
|
120
|
+
style={{ flexDirection: "row", alignItems: "center", gap: 10, paddingBottom: compact ? 10 : 12, borderBottomWidth: 1, borderBottomColor: c.border }}>
|
|
121
|
+
<Text style={{ color: c.foreground, fontSize: compact ? 19 : 18, lineHeight: compact ? 25 : 24, fontWeight: "500", fontVariant: ["tabular-nums"] }}>{note.version}</Text>
|
|
122
|
+
{note.installed && <View style={{ paddingHorizontal: 8, paddingVertical: 1, borderRadius: 999, borderWidth: 1, borderColor: c.border, backgroundColor: c.surface2 }}>
|
|
123
|
+
<Text style={[t.meta, { color: c.foregroundMuted }]}>Installed</Text>
|
|
124
|
+
</View>}
|
|
125
|
+
<View style={{ flex: 1 }} />
|
|
126
|
+
{date && <Text numberOfLines={1} style={[t.meta, { flexShrink: 1 }]}>{date}</Text>}
|
|
124
127
|
</View>;
|
|
125
128
|
}
|
|
126
129
|
|
|
127
|
-
/**
|
|
128
|
-
function
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
style={state => ({ flexDirection: "row", alignItems: "center", gap: 8, minHeight: compact ? 48 : 36, paddingVertical: 6, marginHorizontal: -8, paddingHorizontal: 8, borderRadius: 6, backgroundColor: state.pressed ? c.surface2 : !compact && (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
|
|
135
|
-
<Icon name={open ? "ChevronDown" : "ChevronRight"} size={14} color={c.foregroundMuted} />
|
|
136
|
-
<Text accessibilityRole="header" style={[t.label, { fontVariant: ["tabular-nums"], flexShrink: 0 }]}>{note.version}</Text>
|
|
137
|
-
{note.date && <Text style={[t.meta, { flexShrink: 0 }]}>{fmtDate(note.date)}</Text>}
|
|
138
|
-
{!open && <Text numberOfLines={1} style={[t.meta, { flex: 1, minWidth: 0 }]}>{note.items[0] !== undefined ? plainInline(note.items[0]) : note.blocks?.find(b => b.kind === "text" || b.kind === "bullet")?.text ?? ""}</Text>}
|
|
139
|
-
</Pressable>
|
|
140
|
-
{open && <View style={{ paddingLeft: 22, paddingBottom: 12 }}><VersionNotes note={note} theme={theme} compact={compact} /></View>}
|
|
141
|
-
</View>;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Newest open, the next ones folded, then "and N older versions" past `cap` (a button only when `onMore` shows them).
|
|
146
|
-
* `titled`: the sheet's title already names the newest version, so its header shows just the date.
|
|
147
|
-
*/
|
|
148
|
-
export function NotesList({ notes, theme, compact, cap = 10, onMore, titled = false }: { notes: readonly ReleaseNote[]; theme: Theme; compact: boolean; cap?: number; onMore?: () => void; titled?: boolean }) {
|
|
149
|
-
const c = theme.colors; const t = text(c, compact);
|
|
150
|
-
const [first, ...rest] = notes;
|
|
151
|
-
if (!first) return null;
|
|
152
|
-
const shown = rest.slice(0, cap - 1);
|
|
153
|
-
const hidden = rest.length - shown.length;
|
|
154
|
-
const more = `and ${hidden} older version${hidden === 1 ? "" : "s"}`;
|
|
155
|
-
return <View style={{ gap: 0 }}>
|
|
156
|
-
<View style={{ gap: 8, paddingBottom: 14 }}><VersionHeader note={first} theme={theme} compact={compact} dateOnly={titled} /><VersionNotes note={first} theme={theme} compact={compact} /></View>
|
|
157
|
-
{shown.map(n => <FoldedVersion key={n.version} note={n} theme={theme} compact={compact} />)}
|
|
158
|
-
{hidden > 0 && (onMore
|
|
159
|
-
? <Pressable accessibilityRole="button" onPress={onMore} style={{ borderTopWidth: 1, borderTopColor: c.border, minHeight: compact ? 48 : 36, justifyContent: "center" }}>
|
|
160
|
-
<Text style={[t.meta, { color: c.foreground, fontWeight: "600" }]}>{more}</Text>
|
|
161
|
-
</Pressable>
|
|
162
|
-
: <View style={{ borderTopWidth: 1, borderTopColor: c.border, minHeight: compact ? 48 : 36, justifyContent: "center" }}><Text style={t.meta}>{more}</Text></View>)}
|
|
130
|
+
/** Every version in one scroll, newest first: each one's header and its notes, nothing folded. */
|
|
131
|
+
export function NotesFeed({ feed, theme, compact }: { feed: readonly FeedNote[]; theme: Theme; compact: boolean }) {
|
|
132
|
+
return <View style={{ gap: compact ? 32 : 36 }}>
|
|
133
|
+
{feed.map(n => <View key={n.version} style={{ gap: compact ? 14 : 16 }}>
|
|
134
|
+
<VersionHeader note={n} theme={theme} compact={compact} />
|
|
135
|
+
<VersionNotes note={n} theme={theme} compact={compact} />
|
|
136
|
+
</View>)}
|
|
163
137
|
</View>;
|
|
164
138
|
}
|
|
165
139
|
|
|
@@ -185,39 +159,49 @@ function NotesScroll({ theme, style, contentContainerStyle, children }: { theme:
|
|
|
185
159
|
}
|
|
186
160
|
|
|
187
161
|
/**
|
|
188
|
-
*
|
|
189
|
-
* "Follow-up
|
|
162
|
+
* What's new and the release notes are one view, so one title, naming the plugin from its manifest (the view's
|
|
163
|
+
* `name`): "What's new in Follow-up". Exported for the tests.
|
|
190
164
|
*/
|
|
191
|
-
export const notesTitle = (name: string
|
|
165
|
+
export const notesTitle = (name: string) => `What's new in ${name}`;
|
|
166
|
+
/** The release pages, from the header's open-in-browser icon: the one URL the notes open (a screenshot never does). */
|
|
167
|
+
const openReleases = (url: string) => { void openExternalUrl(url).catch(() => undefined); };
|
|
192
168
|
|
|
193
169
|
/** The host sheet's own inset on the phone, so our body lines up with its title. */
|
|
194
170
|
const SHEET_INSET = 24;
|
|
195
171
|
/**
|
|
196
|
-
*
|
|
197
|
-
*
|
|
172
|
+
* Desktop draws the notes in a dialog of our own, so its header can carry the open-in-browser icon beside the X (the
|
|
173
|
+
* host's Modal has a title and nothing else). The dialog is as wide as the reading column plus its inset, and nothing
|
|
174
|
+
* inside caps itself: text, version rules, dates, screenshots, the credits' rule and the header's icons all share one
|
|
175
|
+
* right edge (2026-11-26: an 840px dialog capped only its text at 600px, leaving a dead band right of every line, the
|
|
176
|
+
* rules and icons past it). A screenshot shows larger in the image viewer.
|
|
198
177
|
*/
|
|
199
|
-
const
|
|
178
|
+
const NOTES_COLUMN = 600; const DIALOG_INSET = 24;
|
|
200
179
|
|
|
201
180
|
/**
|
|
202
|
-
* The
|
|
203
|
-
* `onDismiss` is the notes' own close: Esc, the dim and the X all go through it.
|
|
181
|
+
* The desktop dialog, drawn like the host's (same dim, card and X) with Paseo's What's new header: a gift, the title,
|
|
182
|
+
* the release pages and Close. `onDismiss` is the notes' own close: Esc, the dim and the X all go through it.
|
|
204
183
|
*/
|
|
205
|
-
function
|
|
184
|
+
function NotesDialog({ title, open, onDismiss, theme, width, releases, openUrl, children, overlay }: { title: string; open: boolean; onDismiss: () => void; theme: Theme; width: number; releases: string | null; openUrl: (url: string) => void; children: ReactNode; overlay?: ReactNode }) {
|
|
206
185
|
const c = theme.colors;
|
|
207
186
|
const reduced = useReducedMotion();
|
|
208
187
|
const close = useRef<View>(null);
|
|
209
188
|
useEffect(() => { if (open) (close.current as unknown as { focus?: () => void } | null)?.focus?.(); }, [open]);
|
|
189
|
+
const headerButton = (state: { hovered?: boolean }) => ({ padding: 8, borderRadius: 8, backgroundColor: state.hovered ? c.surface1 : "transparent" });
|
|
210
190
|
return <RNModal transparent visible={open} animationType={reduced ? "none" : "fade"} onRequestClose={onDismiss}>
|
|
211
191
|
<View style={{ flex: 1, alignItems: "center", justifyContent: "center", padding: 24, backgroundColor: "rgba(0,0,0,0.55)" }}>
|
|
212
192
|
<Pressable accessible={false} focusable={false} importantForAccessibility="no" onPress={onDismiss} style={{ position: "absolute", top: 0, left: 0, right: 0, bottom: 0 }} />
|
|
213
193
|
<View role="dialog" aria-modal aria-label={title} style={{ width, maxHeight: "85%", flexShrink: 1, minHeight: 0, overflow: "hidden", backgroundColor: c.surface0, borderRadius: 12, borderWidth: 1, borderColor: c.surface2 }}>
|
|
214
|
-
<View style={{ flexDirection: "row", alignItems: "center", gap:
|
|
194
|
+
<View style={{ flexDirection: "row", alignItems: "center", gap: 10, paddingLeft: DIALOG_INSET, paddingRight: DIALOG_INSET - 8, paddingVertical: 14, borderBottomWidth: 1, borderBottomColor: c.surface2 }}>
|
|
195
|
+
<Icon name="Gift" size={16} color={c.foregroundMuted} />
|
|
215
196
|
<Text role="heading" numberOfLines={1} style={{ flex: 1, minWidth: 0, color: c.foreground, fontSize: 14, fontWeight: "500" }}>{title}</Text>
|
|
216
|
-
<Pressable
|
|
197
|
+
{releases && <Pressable accessibilityRole="link" accessibilityLabel="Release notes on GitHub" accessibilityHint="Every version's full changelog, in your browser" onPress={() => openUrl(releases)} style={state => headerButton(state as { hovered?: boolean })}>
|
|
198
|
+
{state => <Icon name="ExternalLink" size={16} color={state.pressed ? c.foreground : c.foregroundMuted} />}
|
|
199
|
+
</Pressable>}
|
|
200
|
+
<Pressable ref={close} accessibilityRole="button" accessibilityLabel="Close" onPress={onDismiss} style={state => headerButton(state as { hovered?: boolean })}>
|
|
217
201
|
{state => <Icon name="X" size={16} color={state.pressed ? c.foreground : c.foregroundMuted} />}
|
|
218
202
|
</Pressable>
|
|
219
203
|
</View>
|
|
220
|
-
<NotesScroll theme={theme} style={{ flexShrink: 1, minHeight: 0 }} contentContainerStyle={{ paddingHorizontal:
|
|
204
|
+
<NotesScroll theme={theme} style={{ flexShrink: 1, minHeight: 0 }} contentContainerStyle={{ paddingHorizontal: DIALOG_INSET, paddingTop: 24, paddingBottom: 32 }}>{children}</NotesScroll>
|
|
221
205
|
</View>
|
|
222
206
|
{overlay}
|
|
223
207
|
</View>
|
|
@@ -225,57 +209,46 @@ function WideDialog({ title, open, onDismiss, theme, width, children, overlay }:
|
|
|
225
209
|
}
|
|
226
210
|
|
|
227
211
|
/**
|
|
228
|
-
* "What's new in X":
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
212
|
+
* "What's new in X": every stable version's notes in one scroll, newest first, like Paseo's own (invariant 120,
|
|
213
|
+
* `notes-read-like-one-feed`). It always opens at the top, the newest version; older ones are a scroll away, never a
|
|
214
|
+
* fold or a second view. Desktop: our dialog, with the release pages (each version's full changelog) behind the
|
|
215
|
+
* header's open-in-browser icon. Phone: the host's sheet with our scroll body and a pinned footer, so Close and the
|
|
216
|
+
* release pages stay in thumb reach however long the notes are. A tapped screenshot opens the image viewer over the
|
|
217
|
+
* notes; Esc or a click closes the viewer first, then the notes.
|
|
232
218
|
*/
|
|
233
|
-
export function WhatsNewSheet({ open, name,
|
|
234
|
-
const c = theme.colors;
|
|
235
|
-
const [full, setFull] = useState(startAll);
|
|
219
|
+
export function WhatsNewSheet({ open, name, feed, releases, theme, compact, onClose, openUrl = openReleases }: { open: boolean; name: string; feed: readonly FeedNote[]; releases: string | null; theme: Theme; compact: boolean; onClose: () => void; openUrl?: (url: string) => void }) {
|
|
220
|
+
const c = theme.colors;
|
|
236
221
|
const [viewing, setViewing] = useState<{ image: ViewedImage; from: unknown } | null>(null);
|
|
237
222
|
const win = useWindowDimensions();
|
|
238
|
-
|
|
239
|
-
const newest = list[0];
|
|
240
|
-
if (!newest) return null;
|
|
241
|
-
const wide = !compact && win.width >= WIDE_FROM;
|
|
223
|
+
if (!feed.length) return null;
|
|
242
224
|
const closeViewer = () => { const from = viewing?.from; setViewing(null); refocus(from); };
|
|
243
225
|
const dismiss = () => { if (viewing) closeViewer(); else onClose(); };
|
|
244
|
-
const meta = !full && list.length > 1 ? `${list.length} versions since you last looked` : null;
|
|
245
|
-
const body = <>
|
|
246
|
-
{meta && <Text style={t.meta}>{meta}</Text>}
|
|
247
|
-
<NotesList notes={list} theme={theme} compact={compact} cap={full ? all.length : 10} onMore={full ? undefined : () => setFull(true)} titled={!full} />
|
|
248
|
-
</>;
|
|
249
|
-
const footer = (pinned: boolean) => <View style={{ borderTopWidth: 1, borderTopColor: c.border, flexDirection: compact ? "column" : "row", alignItems: compact ? "stretch" : "center", justifyContent: full ? "flex-end" : "space-between", gap: compact ? 4 : 8,
|
|
250
|
-
...(pinned ? { backgroundColor: c.surface1, paddingHorizontal: SHEET_INSET - 8, paddingTop: 8, paddingBottom: 12 } : { paddingTop: 12, marginTop: 4 }) }}>
|
|
251
|
-
{!full && all.length > list.length && <Button title="See all release notes" kind="ghost" theme={theme} compact={compact} grow={compact} onPress={() => setFull(true)} />}
|
|
252
|
-
<Button title="Close" kind="secondary" theme={theme} compact={compact} grow={compact} onPress={onClose} />
|
|
253
|
-
</View>;
|
|
254
226
|
const viewer = viewing && <ImageViewer image={viewing.image} inline={viewerInline(compact)} onClose={closeViewer} />;
|
|
255
|
-
const
|
|
256
|
-
<
|
|
227
|
+
const body = <ImageViewerContext.Provider value={(image, from) => setViewing({ image, from })}>
|
|
228
|
+
<NotesFeed feed={feed} theme={theme} compact={compact} />
|
|
257
229
|
</ImageViewerContext.Provider>;
|
|
258
|
-
const title = notesTitle(name
|
|
230
|
+
const title = notesTitle(name);
|
|
259
231
|
// The viewer always sits outside the scroll view: react-native-web's ScrollView sets translateZ(0), which would trap
|
|
260
232
|
// the viewer's fixed position inside the dialog.
|
|
261
|
-
if (
|
|
262
|
-
{
|
|
263
|
-
</WideDialog>;
|
|
233
|
+
if (!compact) return <NotesDialog title={title} open={open} onDismiss={dismiss} theme={theme} releases={releases} openUrl={openUrl}
|
|
234
|
+
width={Math.min(NOTES_COLUMN + 2 * DIALOG_INSET, win.width - 48)} overlay={viewer}>{body}</NotesDialog>;
|
|
264
235
|
return <Modal title={title} open={open} onOpenChange={next => { if (!next) dismiss(); }}>
|
|
265
|
-
{
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
{
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
<NotesScroll theme={theme} style={{ flex: 1 }} contentContainerStyle={{ paddingHorizontal: 20, paddingTop: 4, paddingBottom: 16, gap: 12 }}>{provide(<>{body}{footer(false)}</>)}</NotesScroll>
|
|
274
|
-
{viewer}
|
|
275
|
-
</Modal.Content>}
|
|
236
|
+
<Modal.Content scrollable={false} contentContainerStyle={{ padding: 0, gap: 0 }} style={{ flex: 1 }}>
|
|
237
|
+
<NotesScroll theme={theme} style={{ flex: 1 }} contentContainerStyle={{ paddingHorizontal: SHEET_INSET, paddingTop: 16, paddingBottom: 24 }}>{body}</NotesScroll>
|
|
238
|
+
<View style={{ borderTopWidth: 1, borderTopColor: c.border, flexDirection: "row", alignItems: "center", gap: 8, backgroundColor: c.surface1, paddingHorizontal: SHEET_INSET - 8, paddingTop: 8, paddingBottom: 12 }}>
|
|
239
|
+
{releases && <Button title="On GitHub" icon="ExternalLink" kind="ghost" theme={theme} compact accessibilityLabel="Release notes on GitHub" accessibilityHint="Every version's full changelog, in your browser" onPress={() => openUrl(releases)} />}
|
|
240
|
+
<Button title="Close" kind="secondary" theme={theme} compact grow onPress={onClose} />
|
|
241
|
+
</View>
|
|
242
|
+
{viewer}
|
|
243
|
+
</Modal.Content>
|
|
276
244
|
</Modal>;
|
|
277
245
|
}
|
|
278
246
|
|
|
247
|
+
/** Notes for versions out but not installed, from the updater's view when it has been read (never fetched for this). */
|
|
248
|
+
function usePendingNotes(): readonly ReleaseNote[] {
|
|
249
|
+
return useQueryClient().getQueryData<{ pendingNotes?: ReleaseNote[] }>(updatesKey)?.pendingNotes ?? [];
|
|
250
|
+
}
|
|
251
|
+
|
|
279
252
|
/**
|
|
280
253
|
* Where "seen" lives: per device, in the device document on 0.16 (the phone included), else localStorage on web and
|
|
281
254
|
* desktop. A native app without either falls back to the host's record: What's new then shows once per host there,
|
|
@@ -304,6 +277,7 @@ export function WhatsNewGate({ surface, theme, compact }: { surface: string; the
|
|
|
304
277
|
const onboarding = ob.isPending || !!ob.data?.show;
|
|
305
278
|
const owner = useSyncExternalStore(subscribeClaim, claimVersion, claimVersion);
|
|
306
279
|
const seen = useRpc(whatsNewSeenRpc); const cache = useQueryClient();
|
|
280
|
+
const pending = usePendingNotes();
|
|
307
281
|
const [closed, setClosed] = useState(false);
|
|
308
282
|
const view = query.data;
|
|
309
283
|
const viewVersion = useViewVersion();
|
|
@@ -322,12 +296,13 @@ export function WhatsNewGate({ surface, theme, compact }: { surface: string; the
|
|
|
322
296
|
deviceStorage.set(LAST_SEEN_KEY, view.version); setClosed(true);
|
|
323
297
|
void seen({ version: view.version }).then(v => cache.setQueryData(releaseNotesKey, v), () => undefined);
|
|
324
298
|
};
|
|
325
|
-
return <WhatsNewSheet open name={view.name}
|
|
299
|
+
return <WhatsNewSheet open name={view.name} feed={notesFeed(view.notes, view.version, pending)} releases={view.releases} theme={theme} compact={compact} onClose={close} />;
|
|
326
300
|
}
|
|
327
301
|
|
|
328
|
-
/** What's new opened by hand (Home's
|
|
329
|
-
export function ReleaseNotesSheet({ theme, compact,
|
|
302
|
+
/** What's new opened by hand (Home's version line, Settings → General): the same scroll, opened at the newest version. */
|
|
303
|
+
export function ReleaseNotesSheet({ theme, compact, onClose }: { theme: Theme; compact: boolean; onClose: () => void }) {
|
|
330
304
|
const view = useReleaseNotes().data;
|
|
305
|
+
const pending = usePendingNotes();
|
|
331
306
|
if (!view) return null;
|
|
332
|
-
return <WhatsNewSheet open name={view.name}
|
|
307
|
+
return <WhatsNewSheet open name={view.name} feed={notesFeed(view.notes, view.version, pending)} releases={view.releases} theme={theme} compact={compact} onClose={onClose} />;
|
|
333
308
|
}
|
|
@@ -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
|
+
}
|