paseo-follow-up 0.3.6 → 0.4.0

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.
Files changed (63) hide show
  1. package/OVERVIEW.md +19 -7
  2. package/README.md +70 -79
  3. package/THIRD_PARTY_NOTICES.md +33 -0
  4. package/assets/LICENSE.lucide +43 -0
  5. package/assets/icon.png +0 -0
  6. package/assets/icon.svg +1 -0
  7. package/client/button-visibility.ts +2 -1
  8. package/client/chat.tsx +163 -0
  9. package/client/display.tsx +12 -17
  10. package/client/header.tsx +92 -0
  11. package/client/keys.ts +3 -0
  12. package/client/kit.tsx +119 -0
  13. package/client/large.tsx +58 -0
  14. package/client/live.tsx +159 -0
  15. package/client/motion.tsx +93 -0
  16. package/client/needs-you.tsx +121 -0
  17. package/client/overview.tsx +111 -16
  18. package/client/panel.tsx +257 -68
  19. package/client/pr-controls.tsx +50 -33
  20. package/client/pr-sheet.tsx +63 -0
  21. package/client/questions.tsx +307 -0
  22. package/client/settings.tsx +55 -20
  23. package/client/spec.tsx +113 -0
  24. package/client/stacks.tsx +128 -0
  25. package/client/tasks.tsx +113 -22
  26. package/client/theme.ts +69 -0
  27. package/docs/screenshots/follow-up-chat.png +0 -0
  28. package/docs/screenshots/follow-up-hero.png +0 -0
  29. package/docs/screenshots/follow-up-large.png +0 -0
  30. package/docs/screenshots/follow-up-mobile.png +0 -0
  31. package/docs/screenshots/follow-up-overview.png +0 -0
  32. package/docs/screenshots/follow-up-pill.png +0 -0
  33. package/docs/screenshots/follow-up-pr.png +0 -0
  34. package/docs/screenshots/follow-up-questions.png +0 -0
  35. package/docs/screenshots/follow-up-states.png +0 -0
  36. package/index.client.tsx +47 -16
  37. package/index.server.ts +53 -0
  38. package/package.json +4 -2
  39. package/paseo-plugin.json +11 -3
  40. package/server/agent-hook.mjs +2 -0
  41. package/server/daemon.ts +37 -6
  42. package/server/discovery.ts +6 -3
  43. package/server/engine.ts +39 -0
  44. package/server/hook-source.ts +1 -1
  45. package/server/mcp-source.ts +1 -1
  46. package/server/mcp.mjs +12 -2
  47. package/server/questions.ts +112 -0
  48. package/server/spec.ts +102 -0
  49. package/shared/activity.ts +56 -0
  50. package/shared/attention.ts +212 -0
  51. package/shared/chat.ts +130 -0
  52. package/shared/contracts.ts +21 -0
  53. package/shared/display.ts +2 -1
  54. package/shared/errors.ts +5 -0
  55. package/shared/model.ts +10 -0
  56. package/shared/pr-actions.ts +8 -1
  57. package/shared/questions.ts +123 -0
  58. package/shared/spec.ts +46 -0
  59. package/skills/follow-through/SKILL.md +4 -0
  60. package/client/components.tsx +0 -58
  61. package/client/navigation.tsx +0 -23
  62. package/docs/screenshots/follow-up-settings.png +0 -0
  63. package/docs/screenshots/follow-up-workspace.png +0 -0
@@ -0,0 +1,123 @@
1
+ // Questions agents ask the developer. The question modes, their rules and the
2
+ // "big question" test are adapted from Progress (@stevecastaneda/paseo-progress,
3
+ // MIT, © 2026 Steve Castaneda); see THIRD_PARTY_NOTICES.md.
4
+ import { z } from "zod";
5
+ import { defineSettings } from "@getpaseo/plugin";
6
+
7
+ export const QUESTION_MODES = ["stop", "work-around", "keep-building"] as const;
8
+ export type QuestionMode = (typeof QUESTION_MODES)[number];
9
+ /** Also what an unreadable setting means, so an agent never builds ahead by accident. */
10
+ export const DEFAULT_QUESTION_MODE: QuestionMode = "work-around";
11
+
12
+ export const questionPreferences = defineSettings({
13
+ id: "questions",
14
+ scope: "host",
15
+ version: 1,
16
+ schema: z.object({ mode: z.enum(QUESTION_MODES).default(DEFAULT_QUESTION_MODE) }),
17
+ });
18
+
19
+ const HOLD = "Build no option before the answer, not even your recommendation. Keep working on everything the question doesn't affect. If nothing else is left, end your turn and say in chat which question you're waiting on.";
20
+
21
+ export const QUESTION_MODE_RULES: Record<QuestionMode, { label: string; hint: string; rule(q: { recommend: string | null; big: string | null }): string }> = {
22
+ stop: {
23
+ label: "Stop",
24
+ hint: "Agents stop all work when they ask, until you answer.",
25
+ rule: () => "Ask any other questions you already have, then stop all work until the answer arrives. End your turn now and say in chat which questions you're waiting on.",
26
+ },
27
+ "work-around": {
28
+ label: "Work around",
29
+ hint: "Agents hold what your answer affects and keep working on the rest.",
30
+ rule: () => HOLD,
31
+ },
32
+ "keep-building": {
33
+ label: "Keep building",
34
+ hint: "Agents build their recommendation while you decide and change course if you pick another. Big questions still wait.",
35
+ rule: ({ recommend, big }) => big || !recommend
36
+ ? `This question waits like Work around. ${HOLD}`
37
+ : `Build option ${recommend} now and keep working. If the developer picks another option, undo the work built on ${recommend} and build their choice first. If everything else is done while it's still open, leave it open and say so in chat; don't withdraw it.`,
38
+ },
39
+ };
40
+
41
+ export type QuestionState = "stopped" | "waiting" | "building";
42
+ export function questionState(q: Pick<Question, "mode" | "big" | "recommend">): QuestionState {
43
+ if (q.mode === "stop") return "stopped";
44
+ return q.mode === "keep-building" && !q.big && q.recommend ? "building" : "waiting";
45
+ }
46
+
47
+ const text = z.string().trim().min(1);
48
+ const httpUrl = z.string().url().refine(v => /^https?:\/\//i.test(v), "Use an HTTP or HTTPS link");
49
+ export const questionOptionSchema = z.object({ letter: z.string().regex(/^[A-Z]$/), label: text.max(200), consequence: z.string().trim().max(600).optional() });
50
+ export const questionLinkSchema = z.object({ url: httpUrl.optional(), path: z.string().trim().min(1).max(1000).optional(), label: z.string().trim().max(200).optional() })
51
+ .refine(link => !!link.url !== !!link.path, "Give a link or a file path");
52
+ export const answerSchema = z.object({
53
+ choice: z.string().trim().max(200),
54
+ words: z.string().trim().max(2000).optional(),
55
+ at: z.string(),
56
+ by: z.enum(["developer", "agent"]),
57
+ delivery: z.object({
58
+ state: z.enum(["sending", "sent", "queued", "unconfirmed", "copied", "recorded"]),
59
+ to: z.string().nullable(),
60
+ messageId: z.string().nullable(),
61
+ at: z.string(),
62
+ reason: z.string().nullable().default(null),
63
+ }),
64
+ });
65
+ export const questionSchema = z.object({
66
+ id: z.string().regex(/^Q\d+$/),
67
+ title: text.max(120),
68
+ question: text.max(2000),
69
+ options: z.array(questionOptionSchema).max(26).default([]),
70
+ recommend: z.string().trim().max(200).nullable().default(null),
71
+ big: z.string().trim().max(300).nullable().default(null),
72
+ background: z.string().trim().max(4000).nullable().default(null),
73
+ links: z.array(questionLinkSchema).max(10).default([]),
74
+ prKey: z.string().nullable().default(null),
75
+ taskId: z.string().nullable().default(null),
76
+ // The task revision a blocked-task question was raised for, so a re-blocked task asks again.
77
+ taskRevision: z.number().int().nullable().default(null),
78
+ askedBy: z.string().nullable(),
79
+ askedAt: z.string(),
80
+ mode: z.enum(QUESTION_MODES),
81
+ answer: answerSchema.nullable().default(null),
82
+ closed: z.object({ at: z.string(), reason: z.string(), by: z.string().nullable() }).nullable().default(null),
83
+ });
84
+ export type Question = z.infer<typeof questionSchema>;
85
+ export type QuestionOption = z.infer<typeof questionOptionSchema>;
86
+ export type Answer = z.infer<typeof answerSchema>;
87
+
88
+ export const isOpen = (q: Question) => !q.answer && !q.closed;
89
+
90
+ /** Q1, Q2…: unique for the life of the workspace, never reused after a question closes. */
91
+ export function nextQuestionId(questions: Pick<Question, "id">[]): string {
92
+ const highest = questions.reduce((n, q) => Math.max(n, Number(q.id.slice(1)) || 0), 0);
93
+ return `Q${highest + 1}`;
94
+ }
95
+
96
+ /** What Copy puts on the clipboard, ready to paste into the agent's chat. */
97
+ export function replyText(q: Pick<Question, "id" | "title" | "options">, choice: string, words?: string): string {
98
+ const option = q.options.find(o => o.letter === choice);
99
+ return `${q.id} (${q.title}): ${choice}${option ? ` — ${option.label}` : ""}${words?.trim() ? `\n${words.trim()}` : ""}`;
100
+ }
101
+
102
+ export const ANSWER_PREFIX = "Follow-up answer";
103
+ /** The message sent to the asking agent. It starts with ANSWER_PREFIX so chat rows and history scans recognise it. */
104
+ export function answerMessage(q: Question, choice: string, words?: string): string {
105
+ const option = q.options.find(o => o.letter === choice);
106
+ const lines = [`${ANSWER_PREFIX} ${q.id} (${q.title}): ${choice}${option ? ` — ${option.label}` : ""}`];
107
+ if (words?.trim()) lines.push(`The developer added: ${words.trim()}`);
108
+ if (q.mode === "keep-building" && !q.big && q.recommend && choice !== q.recommend) lines.push(`You were building ${q.recommend}. Undo the work built on it and build ${choice} first.`);
109
+ else if (q.taskId) lines.push("Continue the blocked task with this decision and update the task when it moves.");
110
+ else lines.push("Continue with this choice. The answer is already recorded, so you don't need to record it.");
111
+ return lines.join("\n");
112
+ }
113
+
114
+ /** Parses an answer message back into its parts, for the chat card. */
115
+ export function parseAnswerMessage(text: string): { id: string; title: string; choice: string; label: string | null; words: string | null } | null {
116
+ const match = /^Follow-up answer (Q\d+) \((.+?)\): ([^\n—]+?)(?: — ([^\n]+))?\n(?:The developer added: ([^\n]+))?/.exec(text.trim() + "\n");
117
+ return match ? { id: match[1], title: match[2], choice: match[3].trim(), label: match[4]?.trim() ?? null, words: match[5]?.trim() ?? null } : null;
118
+ }
119
+
120
+ /** The answer is a known option letter, or free words when the question has no options. */
121
+ export function validChoice(q: Pick<Question, "options">, choice: string): boolean {
122
+ return q.options.length ? q.options.some(o => o.letter === choice) : choice.trim().length > 0;
123
+ }
package/shared/spec.ts ADDED
@@ -0,0 +1,46 @@
1
+ import { z } from "zod";
2
+
3
+ /**
4
+ * The workspace's spec link: usually a Claude artifact the main agent keeps up to date.
5
+ * Precedence: the developer's choice, then the main agent's set_spec, then detection from
6
+ * completed Artifact publishes in the workspace's root sessions.
7
+ */
8
+ export const SPEC_SOURCES = ["developer", "agent", "detected"] as const;
9
+ export type SpecSource = (typeof SPEC_SOURCES)[number];
10
+
11
+ const httpsUrl = z.string().trim().max(2000).url().refine(v => /^https:\/\//i.test(v), "Use an https:// link");
12
+ export const specSchema = z.object({
13
+ // null with source "developer" means the developer removed the link; detection stays off until they reset it.
14
+ url: httpsUrl.nullable(),
15
+ title: z.string().trim().max(120).nullable().default(null),
16
+ source: z.enum(SPEC_SOURCES),
17
+ by: z.string().nullable().default(null),
18
+ at: z.string(),
19
+ });
20
+ export const artifactSchema = z.object({
21
+ url: httpsUrl,
22
+ title: z.string().trim().max(120).nullable().default(null),
23
+ by: z.string().nullable().default(null),
24
+ firstAt: z.string().nullable().default(null),
25
+ lastAt: z.string().nullable().default(null),
26
+ publishes: z.number().int().positive().default(1),
27
+ });
28
+ export type Spec = z.infer<typeof specSchema>;
29
+ export type Artifact = z.infer<typeof artifactSchema>;
30
+ export const MAX_ARTIFACTS = 8;
31
+
32
+ export const CLAUDE_ARTIFACT = /^https:\/\/claude\.ai\/(?:code\/)?artifact\/[\w-]+$/;
33
+ export const isClaudeArtifact = (url: string) => CLAUDE_ARTIFACT.test(url);
34
+
35
+ /** What to call the link: its title, else "Claude artifact" or the site's host. */
36
+ export function specLabel(spec: Pick<Spec, "url" | "title">): string {
37
+ if (spec.title) return spec.title;
38
+ if (!spec.url) return "Spec";
39
+ if (isClaudeArtifact(spec.url)) return "Claude artifact";
40
+ try { return new URL(spec.url).host.replace(/^www\./, ""); } catch { return "Spec"; }
41
+ }
42
+
43
+ export function validSpecUrl(value: string): string | null {
44
+ const url = value.trim();
45
+ return httpsUrl.safeParse(url).success ? url : null;
46
+ }
@@ -13,6 +13,10 @@ Maintain this sidebar during normal work without a developer reminder. Before en
13
13
 
14
14
  Record remaining implementation, decisions, deployment verification, migrations, and other post-merge work using `update_obligation`. Dependencies use `owner/repo#number` keys. Tasks are substantive follow-through, never approve/merge/deploy checklist entries: PRs already track their lifecycle. Use concise action titles, for example "Verify vendor resolution in production", and put dependencies in afterPrs rather than restating the merge steps. Tasks are manual unless explicitly scheduled with trigger={event:"now"|"merge"|"deploy",delayDays:0}. Only set a trigger from the developer’s requested timing; never infer timing from a title or enable_follow_up alone. Merge/deploy triggers require owned afterPrs; delayDays=14 waits fourteen days after the last dependency event. Now requires no PR dependencies or delay. Deployment timing starts at the first verified fully serving observation and remains conservative when history is unknown. Preserve existing trigger fields on updates; trigger=null makes a task manual. Auto controls delivery, not timing or production permissions. Delivery still respects workspace Auto consent and production permissions. A deploy tag or merged PR alone never establishes deployment. Record result evidence for done or waived obligations. Preserve fields while updating; leave an obligation blocked when the developer must act.
15
15
 
16
+ Ask the developer decisions you can't make yourself with `ask_question`: a short title, the question, lettered options A, B, C… each with what it means for them, and `recommend` set to the option you'd pick. Set `big` (a few plain words on why) only when building ahead would send something off this computer, set something people or programs outside the repo rely on, or most of the remaining work would build on the answer. Link the PR or task it is about. The reply states the developer's question mode: Stop (end your turn and wait), Work around (the default: build nothing the answer affects, keep working on the rest) or Keep building (build your recommendation and change course if they pick another; big questions still wait). Follow it exactly. The developer answers in Follow-up and the answer arrives in your chat as `Follow-up answer Q<n> …`, already recorded. If they answer in chat instead, call `record_answer`. Withdraw a question that no longer matters with `withdraw_question`. A task you mark blocked also becomes a question; update the task once the decision arrives.
17
+
18
+ If you keep a spec for the workspace, usually a Claude artifact summarizing the goal, decisions and status, register its link with `set_spec` after the first publish and keep republishing to the same URL. Follow-up also picks up artifacts published from the workspace's root sessions on its own, but an explicit `set_spec` wins over detection, and a link the developer sets in Follow-up wins over both.
19
+
16
20
  Repair, obligation and completion batches contain only a `Follow-through batch <batchId>` header and ordered tasks. Read `workspace_status` and refresh live conditions before acting; skip resolved tasks. Process dependent PRs bottom to top, one PR fully before the next. Use the repository's `/fix-pr` workflow, validate feedback, verify changes, submit through Graphite with `--publish`, and reply/resolve addressed threads. Follow the repository's safe reparent procedure for merged parents and preserve uncommitted work. Do not merge or archive. For post-deploy tasks, verify the currently serving revision contains every dependency and record behavioral results separately from deployment evidence. Call `acknowledge_batch` with the header's batchId and a concise result before ending the turn; use blocked for work requiring a decision. Acknowledge completion batches before declaring Done. Production actions still follow the workspace's existing authorization.
17
21
 
18
22
  When the whole goal is fulfilled, call `declare_done` with the outcome. Resolve returned blockers first. A merged stack alone is insufficient. Done labels the workspace; the developer archives it. New scope, PRs, or obligations reopen it.
@@ -1,58 +0,0 @@
1
- import { useState, type ReactNode } from "react";
2
- import { Pressable, Text, View } from "react-native";
3
- import { Icon } from "@getpaseo/plugin/client/react-native";
4
- import type { PluginHostProps } from "@getpaseo/plugin/client";
5
- import { graphitePrUrl, compactPrStatus, settledForDisplay } from "../shared/presentation";
6
- import { summary, type Workspace, type Pr, type Status } from "../shared/model";
7
- import { PrControls } from "./pr-controls";
8
- export type Theme = PluginHostProps["theme"];
9
- export const colorFor = (theme: Theme, state: Status) => state === "done" ? theme.colors.statusSuccess : state === "needs-you" ? theme.colors.statusDanger : state === "waiting" ? theme.colors.statusWarning : theme.colors.accent;
10
- export function mergedColor(theme: Theme): string {
11
- const provided = (theme.colors as Theme["colors"] & { statusMerged?: string }).statusMerged;
12
- if (provided) return provided;
13
- // The plugin SDK omits Paseo's merged token; use the host's light/dark tones.
14
- const raw = theme.colors.surface0.replace(/^#/, "");
15
- const hex = raw.length === 3 ? raw.split("").map(c => c + c).join("") : raw;
16
- const brightness = [0, 2, 4].reduce((sum, offset) => sum + parseInt(hex.slice(offset, offset + 2), 16), 0) / 3;
17
- return brightness < 128 ? "#a890d5" : "#7347af";
18
- }
19
- export function Button({ title, onPress, theme, primary = false, disabled = false, icon, compact = false, accessibilityLabel }: { title: string; onPress: () => void; theme: Theme; primary?: boolean; disabled?: boolean; icon?: string; compact?: boolean; accessibilityLabel?: string }) {
20
- return <Pressable accessibilityRole="button" accessibilityLabel={accessibilityLabel ?? title} disabled={disabled} onPress={onPress} style={({ pressed }) => ({ minHeight: compact ? 44 : 36, paddingHorizontal: 10, paddingVertical: 8, borderRadius: 6, flexDirection: "row", alignItems: "center", justifyContent: "center", gap: 6, backgroundColor: primary ? theme.colors.accent : pressed ? theme.colors.surface2 : theme.colors.surface1, borderWidth: primary ? 0 : 1, borderColor: theme.colors.border, opacity: disabled ? 0.5 : pressed ? 0.8 : 1 })}>
21
- {icon && <Icon name={icon} size={14} color={primary ? theme.colors.accentForeground : theme.colors.foreground} />}
22
- <Text style={{ fontSize: 12, fontWeight: "600", color: primary ? theme.colors.accentForeground : theme.colors.foreground }}>{title}</Text>
23
- </Pressable>;
24
- }
25
- export function Section({ title, count, theme, children, compact = false, initiallyExpanded = true }: { title: string; count?: number; theme: Theme; children: ReactNode; compact?: boolean; initiallyExpanded?: boolean }) {
26
- const [expanded, setExpanded] = useState(initiallyExpanded);
27
- return <View style={{ gap: expanded ? 8 : 0, marginTop: 16 }}><Pressable accessibilityRole="button" accessibilityLabel={`${expanded ? "Collapse" : "Expand"} ${title}`} accessibilityState={{ expanded }} aria-expanded={expanded} onPress={() => setExpanded(!expanded)} style={{ minHeight: compact ? 44 : 36, flexDirection: "row", gap: 6, alignItems: "center" }}><Icon name={expanded ? "ChevronDown" : "ChevronRight"} size={14} color={theme.colors.foregroundMuted} /><Text style={{ fontSize: 13, fontWeight: "600", color: theme.colors.foreground, flex: 1 }}>{title}</Text>{count !== undefined && <Text style={{ fontSize: 12, color: theme.colors.foregroundMuted }}>{count}</Text>}</Pressable><View accessibilityElementsHidden={!expanded} importantForAccessibility={expanded ? "auto" : "no-hide-descendants"} style={{ display: expanded ? "flex" : "none", gap: 8 }}>{children}</View></View>;
28
- }
29
- export function StatusLabel({ workspace, theme }: { workspace: Workspace; theme: Theme }) {
30
- const state = summary(workspace);
31
- return <View style={{ flexDirection: "row", alignItems: "center", gap: 5 }}><Icon name={state.status === "done" ? "CircleCheck" : state.status === "needs-you" ? "CircleAlert" : state.status === "waiting" ? "Clock" : "Activity"} size={14} color={colorFor(theme, state.status)} /><Text style={{ color: colorFor(theme, state.status), fontSize: 12, fontWeight: "600" }}>{state.label}</Text></View>;
32
- }
33
- export function PrRow({ pr, theme, onOpen, compact, workspace, browserReady }: { browserReady: boolean; pr: Pr; theme: Theme; onOpen: (url: string) => void; compact: boolean; workspace: Workspace }) {
34
- const s = pr.snapshot;
35
- const [details, setDetails] = useState(false);
36
- const { label: status, tone } = compactPrStatus(pr);
37
- const color = tone === "merged" ? mergedColor(theme) : tone === "approved" ? theme.colors.statusSuccess : tone === "warning" ? theme.colors.statusWarning : theme.colors.foregroundMuted;
38
- return <View style={{ paddingVertical: compact ? 6 : 5, gap: 3, borderTopWidth: 1, borderColor: theme.colors.border }}><View style={{ flexDirection: "row", alignItems: "center" }}><Pressable accessibilityRole="link" accessibilityLabel={`Open ${pr.repo} pull request ${pr.number} in Graphite: ${s?.title ?? pr.stack}, ${status}`} onPress={() => onOpen(graphitePrUrl(pr))} style={({ pressed }) => ({ flex: 1, backgroundColor: pressed ? theme.colors.surface1 : "transparent", minHeight: compact ? 44 : 36, justifyContent: "center" })}>
39
- <View style={{ flexDirection: "row", alignItems: "flex-start", gap: 8 }}><View style={{ width: 88, gap: 2 }}><View style={{ flexDirection: "row", alignItems: "center", gap: 5 }}><Icon name={s?.state === "MERGED" ? "GitMerge" : "GitPullRequest"} size={14} color={color} /><Text style={{ color: theme.colors.foregroundMuted, fontSize: 12, lineHeight: 16 }}>#{pr.number}</Text></View><Text style={{ fontSize: 11, lineHeight: 16, color }}>{status}</Text></View><Text numberOfLines={details ? undefined : 2} style={{ color: theme.colors.foreground, fontSize: 13, lineHeight: 18, flex: 1 }}>{s?.title ?? `${pr.repo} pull request`}</Text></View>
40
- </Pressable><Pressable accessibilityRole="button" accessibilityLabel={`${details ? "Hide" : "Show"} details for PR ${pr.number}`} aria-expanded={details} accessibilityState={{ expanded: details }} onPress={() => setDetails(!details)} style={{ minHeight: compact ? 44 : 36, width: compact ? 44 : 36, justifyContent: "center", alignItems: "center" }}><Icon name={details ? "ChevronUp" : "ChevronDown"} size={12} color={theme.colors.foregroundMuted} /></Pressable></View>
41
- {details && <View style={{ gap: 4 }}><Text style={{ fontSize: 12, color: theme.colors.foregroundMuted }}>{pr.repo} · {s?.state === "MERGED" ? "Merged" : status}</Text>{pr.error && <Text style={{ fontSize: 12, color: theme.colors.statusWarning }}>{pr.error}</Text>}{!!s?.failedChecks.length && <Text style={{ fontSize: 12, lineHeight: 18, color: theme.colors.statusWarning }}>Required checks failed: {s.failedChecks.join(", ")}</Text>}{!!s?.otherFailedChecks?.length && <Text style={{ fontSize: 12, lineHeight: 18, color: theme.colors.statusWarning }}>Optional checks failed (not required for merge): {s.otherFailedChecks.join(", ")}</Text>}{s?.reviewers?.complete && [...s.reviewers.requested, ...s.reviewers.teams, ...s.reviewers.reviewed].length > 0 && <Text style={{ fontSize: 12, lineHeight: 18, color: theme.colors.foregroundMuted }}>Reviewers: {[...new Set([...s.reviewers.requested, ...s.reviewers.teams.map(team => `team/${team}`), ...s.reviewers.reviewed])].join(", ")}</Text>}{s?.deployment && <Text style={{ fontSize: 12, lineHeight: 18, color: theme.colors.foregroundMuted }}>{s.deployment.evidence}</Text>}</View>}
42
- {s?.state === "OPEN" && <PrControls browserReady={browserReady} pr={pr} workspace={workspace} theme={theme} compact={compact} />}
43
- </View>;
44
- }
45
- export function StackGroup({ name, prs, theme, onOpen, compact, workspace, browserReady }: { browserReady: boolean; name: string; prs: Pr[]; theme: Theme; onOpen: (url: string) => void; compact: boolean; workspace: Workspace }) {
46
- const [expanded, setExpanded] = useState(true);
47
- const [history, setHistory] = useState(false);
48
- const open = prs.filter(p => !settledForDisplay(p));
49
- const past = prs.filter(settledForDisplay);
50
- const fullySettled = open.length === 0;
51
- const sort = (rows: Pr[]) => {
52
- const depth = (p: Pr, seen = new Set<string>()): number => { if (seen.has(p.key)) return 0; seen.add(p.key); const parent = prs.find(x => x.key === p.parent); return parent ? depth(parent, seen) + 1 : 0; };
53
- return [...rows].sort((a, b) => depth(a) - depth(b) || a.number - b.number);
54
- };
55
- return <View style={{ marginTop: 3 }}><Pressable accessibilityRole="button" accessibilityLabel={`${expanded ? "Collapse" : "Expand"} ${name} stack`} accessibilityState={{ expanded }} aria-expanded={expanded} onPress={() => setExpanded(!expanded)} style={{ minHeight: compact ? 44 : 36, flexDirection: "row", alignItems: "center", gap: 6 }}><Icon name={expanded ? "ChevronDown" : "ChevronRight"} size={14} color={theme.colors.foregroundMuted} /><Text style={{ color: theme.colors.foreground, fontSize: 13, fontWeight: "600", flex: 1 }}>{name}</Text><Text style={{ fontSize: 12, color: theme.colors.foregroundMuted }}>{fullySettled ? past.length : open.length}</Text></Pressable>
56
- {expanded && <View>{sort(open).map(pr => <PrRow browserReady={browserReady} key={pr.key} pr={pr} workspace={workspace} theme={theme} onOpen={onOpen} compact={compact} />)}{past.length > 0 && !fullySettled && <Pressable accessibilityRole="button" accessibilityState={{ expanded: history }} aria-expanded={history} accessibilityLabel={`${history ? "Hide" : "Show"} settled PRs in ${name}`} onPress={() => setHistory(!history)} style={{ paddingVertical: 10, minHeight: compact ? 44 : 36, flexDirection: "row", alignItems: "center", gap: 6 }}><Icon name={history ? "ChevronDown" : "ChevronRight"} size={12} color={theme.colors.foregroundMuted} /><Text style={{ fontSize: 12, color: theme.colors.foregroundMuted }}>{history ? "Hide" : "Show"} {past.length} settled PR{past.length === 1 ? "" : "s"}</Text></Pressable>}{(fullySettled || history) && sort(past).map(pr => <PrRow browserReady={browserReady} key={pr.key} pr={pr} workspace={workspace} theme={theme} onOpen={onOpen} compact={compact} />)}</View>}
57
- </View>;
58
- }
@@ -1,23 +0,0 @@
1
- import type { ComponentType } from "react";
2
- import type { PluginClientContext, PluginSurfaceProps } from "@getpaseo/plugin/client";
3
- import { Icon } from "@getpaseo/plugin/client/ui";
4
- import { Pressable, View } from "react-native";
5
-
6
- /** Keep settings outside the scrolling workspace content and its primary controls. */
7
- export function withSettingsFooter<P extends PluginSurfaceProps>(Component: ComponentType<P>, client: PluginClientContext) {
8
- return function PluginView(props: P) {
9
- const size = props.layout.compact ? 44 : 36;
10
- return <View style={{ flex: 1, minHeight: 0, backgroundColor: props.theme.colors.surface0 }}>
11
- <View style={{ flex: 1, minHeight: 0 }}><Component {...props} /></View>
12
- <View style={{ flexShrink: 0, alignItems: "flex-end", paddingHorizontal: 8, paddingVertical: 4, borderTopWidth: 1, borderColor: props.theme.colors.border }}>
13
- <Pressable
14
- accessibilityRole="button"
15
- accessibilityLabel="Follow-up settings"
16
- accessibilityHint="Open Follow-up project settings"
17
- onPress={() => client.openSettings("projects")}
18
- style={({ pressed }) => ({ width: size, height: size, alignItems: "center", justifyContent: "center", borderRadius: 6, backgroundColor: pressed ? props.theme.colors.surface2 : "transparent" })}
19
- ><Icon name="Settings" size={16} color={props.theme.colors.foregroundMuted} /></Pressable>
20
- </View>
21
- </View>;
22
- };
23
- }