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
package/client/panel.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useState, type ReactNode } from "react";
|
|
2
2
|
import { ScrollView, Text, View } from "react-native";
|
|
3
3
|
import { Icon, useToast } from "@getpaseo/plugin/client/ui";
|
|
4
|
-
import { useRpc, useTabState, openExternalUrl, type PluginHostProps, type PluginWorkspacePanelProps } from "@getpaseo/plugin/client";
|
|
4
|
+
import { useAgent, useRpc, useTabState, openExternalUrl, type PluginHostProps, type PluginWorkspacePanelProps } from "@getpaseo/plugin/client";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import type { InboxStore } from "./inbox-store";
|
|
7
7
|
import { useInbox } from "./inbox";
|
|
8
8
|
import { BriefCard, type BriefDeps } from "./brief";
|
|
9
9
|
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
10
|
-
import {
|
|
10
|
+
import { controlRpc, refreshRpc, browserStatusRpc, recoverRpc, sendRpc, inboxBriefRpc } from "../shared/contracts";
|
|
11
11
|
import { summary, type Workspace } from "../shared/model";
|
|
12
12
|
import { followUpObligations, recoveryBatch } from "../shared/follow-up";
|
|
13
13
|
import { settledForDisplay } from "../shared/presentation";
|
|
@@ -16,18 +16,21 @@ import { Button, Card, CardRow, FoldRow, IconButton, errorText, text, useNow, ty
|
|
|
16
16
|
import { Reveal, Skeleton } from "./motion";
|
|
17
17
|
import { WorkspaceHeader } from "./header";
|
|
18
18
|
import { NeedsYouCard, overviewKey, workspaceKey } from "./needs-you";
|
|
19
|
+
import { browserKey, BROWSER_POLL_MS } from "./keys";
|
|
20
|
+
import { useWorkspace } from "./workspace-data";
|
|
21
|
+
import type { LiveStore } from "./live";
|
|
19
22
|
import { StacksCard } from "./stacks";
|
|
20
23
|
import { TasksCard } from "./tasks";
|
|
21
24
|
import { PrSheet } from "./pr-sheet";
|
|
22
25
|
import { ActivityCard, QuestionSheet } from "./questions";
|
|
23
26
|
import { SpecRow, SpecSheet } from "./spec";
|
|
24
|
-
import { tint } from "./theme";
|
|
27
|
+
import { mergedColor, tint } from "./theme";
|
|
25
28
|
import { AboutSection } from "./about";
|
|
26
29
|
|
|
27
30
|
export { overviewKey, workspaceKey };
|
|
28
31
|
|
|
29
32
|
export type PanelLinks = { openSettings: () => void; openOverview: () => void; openLarge?: (workspaceId: string) => void };
|
|
30
|
-
type PanelProps = PluginWorkspacePanelProps & PanelLinks & { inbox?: InboxStore; briefDeps?: BriefDeps };
|
|
33
|
+
type PanelProps = PluginWorkspacePanelProps & PanelLinks & { inbox?: InboxStore; live?: LiveStore; briefDeps?: BriefDeps };
|
|
31
34
|
|
|
32
35
|
/**
|
|
33
36
|
* The workspace panel (explorer column, or a tab on the phone): this workspace only. A Home button on top, then
|
|
@@ -35,21 +38,21 @@ type PanelProps = PluginWorkspacePanelProps & PanelLinks & { inbox?: InboxStore;
|
|
|
35
38
|
* tasks, questions, spec, activity and Details. What needs you elsewhere lives on Home.
|
|
36
39
|
*/
|
|
37
40
|
export function FollowPanel(props: PanelProps) {
|
|
38
|
-
|
|
39
|
-
const query =
|
|
41
|
+
// Paints from the client's live store; one small read of this workspace on open, no poll (1.4.0).
|
|
42
|
+
const query = useWorkspace(props.live, props.workspaceId);
|
|
40
43
|
const c = props.theme.colors;
|
|
41
44
|
const base = { flex: 1, backgroundColor: c.surface0 };
|
|
42
|
-
if (query.
|
|
43
|
-
if (query.error && !query.
|
|
45
|
+
if (query.pending) return <PanelSkeleton theme={props.theme} compact={props.layout.compact} />;
|
|
46
|
+
if (query.error && !query.workspace) return <View style={[base, { padding: props.layout.compact ? 16 : 12 }]}>
|
|
44
47
|
<Card theme={props.theme} compact={props.layout.compact} icon="CloudOff" title="Can't reach Follow-up" style={{ marginHorizontal: 0, marginTop: 0 }}>
|
|
45
|
-
<CardRow theme={props.theme}>
|
|
48
|
+
<CardRow theme={props.theme} compact={props.layout.compact}>
|
|
46
49
|
<Text accessibilityRole="alert" style={[text(c).meta, { marginBottom: 10 }]}>The plugin didn't answer: {errorText(query.error)}. It may still be starting; your work is saved on the host.</Text>
|
|
47
|
-
<Button title="Try again" icon="RefreshCw" theme={props.theme} compact={props.layout.compact} loading={query.
|
|
50
|
+
<Button title="Try again" icon="RefreshCw" theme={props.theme} compact={props.layout.compact} loading={query.refetching} onPress={() => void query.refetch()} />
|
|
48
51
|
</CardRow>
|
|
49
52
|
</Card>
|
|
50
53
|
</View>;
|
|
51
|
-
if (!query.
|
|
52
|
-
return <PanelWorkspace {...props} workspace={query.
|
|
54
|
+
if (!query.workspace) return <NothingYet {...props} loadError={query.loadError} />;
|
|
55
|
+
return <PanelWorkspace {...props} workspace={query.workspace} loadError={query.error ? "Refresh failed. Showing the last saved state." : query.loadError} />;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
function PanelSkeleton({ theme, compact }: { theme: Theme; compact: boolean }) {
|
|
@@ -73,13 +76,43 @@ function PanelSkeleton({ theme, compact }: { theme: Theme; compact: boolean }) {
|
|
|
73
76
|
function NothingYet({ theme, layout, loadError, openOverview, openSettings }: PanelProps & { loadError?: string | null }) {
|
|
74
77
|
const c = theme.colors; const t = text(c);
|
|
75
78
|
const compact = layout.compact;
|
|
76
|
-
return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
|
|
79
|
+
if (!compact) return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
|
|
77
80
|
<PanelTop theme={theme} compact={compact} openOverview={openOverview} openSettings={openSettings} />
|
|
78
|
-
<View style={{ padding:
|
|
81
|
+
<View style={{ padding: 12, gap: 8 }}>
|
|
79
82
|
<Text style={t.meta}>Nothing to follow here yet. Once an agent opens a PR or records a task in this workspace, its stack and tasks show up here.</Text>
|
|
80
83
|
{loadError && <Text accessibilityRole="alert" style={[t.meta, { color: c.statusDanger }]}>{loadError}</Text>}
|
|
81
84
|
</View>
|
|
82
85
|
</View>;
|
|
86
|
+
// Phones: teach with the panel's own rail instead of one line of small print at the top of an empty screen.
|
|
87
|
+
const tp = text(c, true);
|
|
88
|
+
const steps: [string, string, string, string][] = [
|
|
89
|
+
["GitPullRequest", mergedColor(c), "Pull requests, as a stack", "Each PR the agent opens, in merge order, with checks and reviews."],
|
|
90
|
+
["CircleAlert", c.statusWarning, "What needs you", "Questions, reviews and merges, one action each."],
|
|
91
|
+
["CircleCheck", c.statusSuccess, "When it's done", "The agent declares Done once every PR and task settles."],
|
|
92
|
+
];
|
|
93
|
+
return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
|
|
94
|
+
<PanelTop theme={theme} compact={compact} openOverview={openOverview} openSettings={openSettings} />
|
|
95
|
+
<ScrollView contentContainerStyle={{ padding: 16, paddingTop: 24, gap: 16 }}>
|
|
96
|
+
<View style={{ gap: 6 }}>
|
|
97
|
+
<Text accessibilityRole="header" style={tp.title}>Nothing to follow here yet</Text>
|
|
98
|
+
<Text style={[tp.body, { color: c.foregroundMuted }]}>Once an agent opens a PR or records a task in this workspace, Follow-up tracks it here.</Text>
|
|
99
|
+
</View>
|
|
100
|
+
<View>
|
|
101
|
+
{steps.map(([icon, color, title, line], i) => <View key={title} style={{ flexDirection: "row", gap: 12 }}>
|
|
102
|
+
<View style={{ alignItems: "center", width: 24 }}>
|
|
103
|
+
<View style={{ width: 24, height: 24, borderRadius: 12, alignItems: "center", justifyContent: "center", backgroundColor: tint(color, c) }}><Icon name={icon} size={13} color={color} /></View>
|
|
104
|
+
{i < steps.length - 1 && <View style={{ flex: 1, width: 2, backgroundColor: c.border, marginVertical: 2 }} />}
|
|
105
|
+
</View>
|
|
106
|
+
<View style={{ flex: 1, paddingBottom: i < steps.length - 1 ? 18 : 0, gap: 2, paddingTop: 2 }}>
|
|
107
|
+
<Text style={tp.label}>{title}</Text>
|
|
108
|
+
<Text style={tp.meta}>{line}</Text>
|
|
109
|
+
</View>
|
|
110
|
+
</View>)}
|
|
111
|
+
</View>
|
|
112
|
+
{loadError && <Text accessibilityRole="alert" style={[tp.meta, { color: c.statusDanger }]}>{loadError}</Text>}
|
|
113
|
+
<View style={{ flexDirection: "row" }}><Button theme={theme} compact kind="secondary" icon="Settings" title="Project settings" accessibilityHint="Choose which projects Follow-up tracks" onPress={openSettings} /></View>
|
|
114
|
+
</ScrollView>
|
|
115
|
+
</View>;
|
|
83
116
|
}
|
|
84
117
|
|
|
85
118
|
/** The panel's top bar: back to Home, and settings. No other workspace's counts. */
|
|
@@ -130,7 +163,7 @@ function AgentCard({ workspace: w, theme, compact, now, openAgent }: { workspace
|
|
|
130
163
|
const blocker = queued && !sent ? sendBlocker(w, queued) : null;
|
|
131
164
|
return <Card theme={theme} compact={compact} icon="Bot" title={recipient === w.mainAgentId ? "Main agent is on it" : "Recovery agent is on it"}
|
|
132
165
|
right={openAgent && <Button theme={theme} compact={compact} kind="ghost" icon="ArrowUpRight" title="Open" accessibilityLabel="Open the agent's chat" onPress={() => openAgent(recipient)} />}>
|
|
133
|
-
<CardRow theme={theme}>
|
|
166
|
+
<CardRow theme={theme} compact={compact}>
|
|
134
167
|
<Text style={[t.meta, { marginBottom: 6 }]}>{sent ? `Sent ${batch.tasks.length} repair${batch.tasks.length === 1 ? "" : "s"} ${ago(batch.sentAt, now)}. Follow-up waits for the agent to report back.` : `${batch.tasks.length} repair${batch.tasks.length === 1 ? "" : "s"} queued · ${blocker ?? "sends when the agent is idle"}`}</Text>
|
|
135
168
|
{batch.tasks.map((task, i) => <View key={task.key} style={{ flexDirection: "row", gap: 6 }}>
|
|
136
169
|
<Text style={[t.meta, { width: 16, fontVariant: ["tabular-nums"] }]}>{i + 1}.</Text>
|
|
@@ -176,19 +209,21 @@ function WorkspaceCard({ workspace: w, theme, compact, open, toggle, openAgent,
|
|
|
176
209
|
const shown = open("workspace");
|
|
177
210
|
const openUrl = (url: string) => { void openExternalUrl(url).catch(() => undefined); };
|
|
178
211
|
return <View style={{ marginHorizontal: compact ? 16 : 12, marginTop: 12, borderRadius: 8, borderWidth: 1, borderColor: c.border, overflow: "hidden" }}>
|
|
179
|
-
<View style={{ marginTop: -1 }}><FoldRow theme={theme} open={shown} onPress={() => toggle("workspace")} icon="SlidersHorizontal" iconColor={c.foregroundMuted} label="Spec, agent and recovery" /></View>
|
|
212
|
+
<View style={{ marginTop: -1 }}><FoldRow theme={theme} compact={compact} open={shown} onPress={() => toggle("workspace")} icon="SlidersHorizontal" iconColor={c.foregroundMuted} label="Spec, agent and recovery" /></View>
|
|
180
213
|
{shown && <>
|
|
181
214
|
<SpecRow workspace={w} theme={theme} compact={compact} onEdit={editSpec} />
|
|
182
|
-
<CardRow theme={theme}>
|
|
215
|
+
<CardRow theme={theme} compact={compact}>
|
|
183
216
|
<View style={{ flexDirection: "row", alignItems: "center", gap: 10, flexWrap: "wrap" }}>
|
|
184
217
|
<View style={{ flex: 1, minWidth: 160, gap: 2 }}>
|
|
185
218
|
<Text style={t.label}>Main agent</Text>
|
|
219
|
+
<MainAgentName agentId={w.mainAgentId} theme={theme} />
|
|
186
220
|
<Text style={t.meta}>Owns the PRs, tasks and the Done call. Repairs go here.</Text>
|
|
187
221
|
</View>
|
|
188
222
|
{openAgent && <Button theme={theme} compact={compact} icon="MessageSquare" title="Open" accessibilityLabel="Open main agent" onPress={() => openAgent(w.mainAgentId)} />}
|
|
189
223
|
</View>
|
|
224
|
+
{(w.contributorAgentIds ?? []).map(id => <OtherRootAgent key={id} agentId={id} workspace={w} theme={theme} compact={compact} openAgent={openAgent} mainAgentId={w.mainAgentId} />)}
|
|
190
225
|
</CardRow>
|
|
191
|
-
<CardRow theme={theme}>
|
|
226
|
+
<CardRow theme={theme} compact={compact}>
|
|
192
227
|
<View style={{ gap: 8 }}>
|
|
193
228
|
<View style={{ gap: 2 }}>
|
|
194
229
|
<Text style={t.label}>Recovery</Text>
|
|
@@ -205,7 +240,8 @@ function WorkspaceCard({ workspace: w, theme, compact, open, toggle, openAgent,
|
|
|
205
240
|
</View>
|
|
206
241
|
</View>
|
|
207
242
|
</CardRow>
|
|
208
|
-
{
|
|
243
|
+
{/* Graphite's merge-when-ready needs the browser companion; GitHub repositories use auto-merge and never see this. */}
|
|
244
|
+
{active && browserReady === false && w.prs.some(p => !settledForDisplay(p) && p.snapshot && p.snapshot.prWorkflow !== "github") && <CardRow theme={theme} compact={compact}>
|
|
209
245
|
<View style={{ gap: 8 }}>
|
|
210
246
|
<View style={{ gap: 2 }}>
|
|
211
247
|
<Text style={t.label}>Merge when ready</Text>
|
|
@@ -218,6 +254,44 @@ function WorkspaceCard({ workspace: w, theme, compact, open, toggle, openAgent,
|
|
|
218
254
|
</View>;
|
|
219
255
|
}
|
|
220
256
|
|
|
257
|
+
/** An agent's title from Paseo's client state (no fetch), or a short id while it loads or once it's gone. */
|
|
258
|
+
function useAgentTitle(agentId: string): string {
|
|
259
|
+
return useAgent(agentId, a => a.title) || `Agent ${agentId.slice(0, 8)}`;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function MainAgentName({ agentId, theme }: { agentId: string; theme: Theme }) {
|
|
263
|
+
const t = text(theme.colors);
|
|
264
|
+
return <Text numberOfLines={1} style={[t.meta, { color: theme.colors.foreground }]}>{useAgentTitle(agentId)}</Text>;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Another root agent in this workspace: it can contribute PRs but not ask Tom or call Done. "Make main agent" is
|
|
269
|
+
* the developer's choice (a plugin RPC, never an agent tool). It swaps roles, so the former main appears here with
|
|
270
|
+
* its own Make main agent: that is the undo, and the toast says so instead of a confirmation step.
|
|
271
|
+
*/
|
|
272
|
+
function OtherRootAgent({ agentId, mainAgentId, workspace: w, theme, compact, openAgent }: { agentId: string; mainAgentId: string; workspace: Workspace; theme: Theme; compact: boolean; openAgent?: (id: string) => void }) {
|
|
273
|
+
const c = theme.colors; const t = text(c, compact);
|
|
274
|
+
const title = useAgentTitle(agentId); const formerTitle = useAgentTitle(mainAgentId);
|
|
275
|
+
const control = useRpc(controlRpc); const cache = useQueryClient(); const toast = useToast();
|
|
276
|
+
const promote = useMutation({
|
|
277
|
+
mutationFn: () => control({ workspaceId: w.id, mainAgentId: agentId }),
|
|
278
|
+
onSuccess: () => { void cache.invalidateQueries({ queryKey: workspaceKey(w.id) }); void cache.invalidateQueries({ queryKey: overviewKey }); toast.show(`${title} is now the main agent. To undo, make ${formerTitle} main again.`, { variant: "success" }); },
|
|
279
|
+
onError: (e: Error) => toast.error(errorText(e)),
|
|
280
|
+
});
|
|
281
|
+
const canPromote = w.enable_tracking && !w.archived;
|
|
282
|
+
return <View style={{ gap: 8, marginTop: 10, paddingTop: 10, borderTopWidth: 1, borderTopColor: c.border }}>
|
|
283
|
+
<View style={{ gap: 2 }}>
|
|
284
|
+
<Text numberOfLines={1} style={compact ? t.label : [t.meta, { color: c.foreground }]}>{title}</Text>
|
|
285
|
+
<Text style={t.meta}>Can add PRs here. Can't ask you questions or call Done.</Text>
|
|
286
|
+
</View>
|
|
287
|
+
{/* Phones: the two actions split one row (no wrap into a second row). */}
|
|
288
|
+
{(openAgent || canPromote) && <View style={{ flexDirection: "row", flexWrap: compact ? "nowrap" : "wrap", gap: 8 }}>
|
|
289
|
+
{canPromote && <Button theme={theme} compact={compact} grow={compact} title="Make main agent" accessibilityLabel={`Make ${title} the main agent`} accessibilityHint={`Repairs, questions and Done move from ${formerTitle} to ${title}.`} loading={promote.isPending} disabled={promote.isPending} onPress={() => promote.mutate()} />}
|
|
290
|
+
{openAgent && <Button theme={theme} compact={compact} kind={compact ? "secondary" : "ghost"} icon="MessageSquare" title="Open" accessibilityLabel={`Open ${title}`} onPress={() => openAgent(agentId)} />}
|
|
291
|
+
</View>}
|
|
292
|
+
</View>;
|
|
293
|
+
}
|
|
294
|
+
|
|
221
295
|
function historyLabel(w: Workspace): string {
|
|
222
296
|
const stacks = new Set(w.prs.map(p => p.stack)).size;
|
|
223
297
|
const tasks = followUpObligations(w).filter(o => ["done", "waived"].includes(o.status)).length;
|
|
@@ -249,7 +323,7 @@ export function WorkspaceView({ theme, layout, workspace: w, navigation, loadErr
|
|
|
249
323
|
const [sheet, setSheet] = useState<{ key: string; intent: "merge" | "reviewers" | null } | null>(null);
|
|
250
324
|
const [question, setQuestion] = useState<string | null>(null);
|
|
251
325
|
const [specOpen, setSpecOpen] = useState(false);
|
|
252
|
-
const browser = useQuery({ queryKey:
|
|
326
|
+
const browser = useQuery({ queryKey: browserKey, queryFn: () => browserRead({}), refetchInterval: BROWSER_POLL_MS });
|
|
253
327
|
const invalidated = () => { void cache.invalidateQueries({ queryKey: workspaceKey(w.id) }); void cache.invalidateQueries({ queryKey: overviewKey }); };
|
|
254
328
|
const auto = useMutation({ mutationFn: (next: boolean) => control({ workspaceId: w.id, enable_auto_sends: next }), onSuccess: (_, next) => { toast.show(next ? "Auto-send on for this workspace" : "Auto-send off · repairs wait for your click"); invalidated(); }, onError: e => toast.error(errorText(e)) });
|
|
255
329
|
const update = useMutation({ mutationFn: () => refresh({ workspaceId: w.id }), onSuccess: () => setTimeout(invalidated, 1200), onError: e => toast.error(errorText(e)) });
|
|
@@ -258,13 +332,13 @@ export function WorkspaceView({ theme, layout, workspace: w, navigation, loadErr
|
|
|
258
332
|
const openPr = (key: string) => setSheet({ key, intent: null });
|
|
259
333
|
// The expand button only appears while the panel is narrow; a wide panel or the larger view keeps its collapse button.
|
|
260
334
|
const resizeShown = compact ? null : resize?.icon === "Maximize2" && wide ? null : resize;
|
|
261
|
-
const header = <WorkspaceHeader workspace={w} theme={theme} compact={compact} now={now} onSettings={openSettings} onRefresh={() => update.mutate()} refreshing={update.isPending} onAuto={next => auto.mutate(next)} autoPending={auto.isPending} notice={loadError ?? null} onOpenPr={openPr} resize={resizeShown} hideTitle={large} />;
|
|
335
|
+
const header = <WorkspaceHeader workspace={w} theme={theme} compact={compact} now={now} onSettings={openSettings} onRefresh={() => update.mutate()} refreshing={update.isPending} onAuto={next => auto.mutate(next)} autoPending={auto.isPending} notice={loadError ?? null} onOpenPr={openPr} resize={resizeShown} hideTitle={large} onHome={compact ? openOverview : undefined} />;
|
|
262
336
|
const shipped = <ShippedCard workspace={w} theme={theme} compact={compact} now={now} />;
|
|
263
337
|
const needs = <NeedsYouCard workspace={w} theme={theme} compact={compact} now={now} actions={{ openAgent, openPr: (key, intent) => setSheet({ key, intent }), openQuestion: setQuestion }} />;
|
|
264
338
|
const agent = <AgentCard workspace={w} theme={theme} compact={compact} now={now} openAgent={openAgent} />;
|
|
265
339
|
// Once shipped, the stack and tasks are history: one quiet fold instead of two near-empty cards.
|
|
266
340
|
const history = done && <View style={{ marginHorizontal: compact ? 16 : 12, marginTop: 12, borderRadius: 8, borderWidth: 1, borderColor: theme.colors.border, overflow: "hidden" }}>
|
|
267
|
-
<View style={{ marginTop: -1 }}><FoldRow theme={theme} open={isOpen("history")} onPress={() => toggle("history")} icon="History" iconColor={theme.colors.foregroundMuted} label={historyLabel(w)} /></View>
|
|
341
|
+
<View style={{ marginTop: -1 }}><FoldRow theme={theme} compact={compact} open={isOpen("history")} onPress={() => toggle("history")} icon="History" iconColor={theme.colors.foregroundMuted} label={historyLabel(w)} /></View>
|
|
268
342
|
</View>;
|
|
269
343
|
const showWork = !done || isOpen("history");
|
|
270
344
|
const stacks = showWork && <StacksCard workspace={w} theme={theme} compact={compact} open={isOpen} toggle={toggle} onOpen={openPr} wide={wide} />;
|
|
@@ -272,7 +346,8 @@ export function WorkspaceView({ theme, layout, workspace: w, navigation, loadErr
|
|
|
272
346
|
const log = <ActivityCard workspace={w} theme={theme} compact={compact} now={now} open={isOpen} toggle={toggle} onOpenQuestion={setQuestion} />;
|
|
273
347
|
const extras = <WorkspaceCard workspace={w} theme={theme} compact={compact} open={isOpen} toggle={toggle} openAgent={openAgent} browserReady={browser.data ? browser.data.ready : null} openOverview={openOverview} editSpec={() => setSpecOpen(true)} />;
|
|
274
348
|
return <View onLayout={event => setWidth(event.nativeEvent.layout.width)} style={{ flex: 1, backgroundColor: theme.colors.surface0 }}>
|
|
275
|
-
{top}
|
|
349
|
+
{/* Phones fold the top bar into the header's own row. */}
|
|
350
|
+
{!compact && top}
|
|
276
351
|
<ScrollView style={{ flex: 1 }} contentContainerStyle={{ paddingBottom: 20, ...(large ? { maxWidth: 1240, width: "100%", alignSelf: "center", paddingHorizontal: 12 } : null) }}>
|
|
277
352
|
{header}
|
|
278
353
|
{about}
|
package/client/pill.tsx
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { useState, useSyncExternalStore } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { browserKey, BROWSER_POLL_MS } from "./keys";
|
|
3
|
+
import { useWorkspace } from "./workspace-data";
|
|
4
|
+
import { Pressable, ScrollView, Text, View } from "react-native";
|
|
3
5
|
import { useQuery } from "@tanstack/react-query";
|
|
4
6
|
import { useRpc, type PluginButtonContentProps, type PluginButtonIconProps, type PluginButtonRegistration, type PluginClientContext } from "@getpaseo/plugin/client";
|
|
5
7
|
import { Icon } from "@getpaseo/plugin/client/ui";
|
|
6
|
-
import { browserStatusRpc
|
|
8
|
+
import { browserStatusRpc } from "../shared/contracts";
|
|
7
9
|
import { needsYou, type NeedItem } from "../shared/attention";
|
|
8
10
|
import { briefQuestionIds, HEADLINE_ICON, HEADLINE_TONE, pillState, todoLabel, withoutBriefQuestions, type PillState } from "../shared/headline";
|
|
9
11
|
import { snoozeUntil, type InboxRow } from "../shared/inbox";
|
|
@@ -14,7 +16,7 @@ import { headlineColor, withAlpha } from "./theme";
|
|
|
14
16
|
import { useInbox } from "./inbox";
|
|
15
17
|
import type { InboxStore } from "./inbox-store";
|
|
16
18
|
import type { LiveStore } from "./live";
|
|
17
|
-
import { NeedsYouList
|
|
19
|
+
import { NeedsYouList } from "./needs-you";
|
|
18
20
|
import { PrSheet } from "./pr-sheet";
|
|
19
21
|
import { QuestionSheet, QuestionStepper } from "./questions";
|
|
20
22
|
import { useReviewerSettings } from "./reviewers";
|
|
@@ -89,8 +91,9 @@ export function contributeFollowUpPill(client: PluginClientContext, deps: Deps)
|
|
|
89
91
|
for (const [agentId, { target, state }] of wanted) try {
|
|
90
92
|
const undo = state.mode === "undo";
|
|
91
93
|
const label = undo ? state.label : state.headline.label;
|
|
92
|
-
// The tooltip (and accessible name) says whose pill it is
|
|
93
|
-
|
|
94
|
+
// The tooltip (and accessible name) says whose pill it is and what kind of ask. On phones the host shows it as the
|
|
95
|
+
// sheet's title right above the popover, which carries the ask itself in full, so the title doesn't repeat it.
|
|
96
|
+
const title = undo ? "Follow-up: signed off. Click to undo." : `Follow-up · ${state.headline.label}${state.todo && state.mode === "flag" ? ` · ${todoLabel(withoutBriefQuestions(target.items, target.row))} in this workspace` : ""}`;
|
|
94
97
|
const key = `${state.mode}|${label}|${title}`;
|
|
95
98
|
const button = { title, label, behavior: undo ? { kind: "action" as const, onPress() { void inbox.undo([agentId]); } } : { kind: "popover" as const, Content } };
|
|
96
99
|
const entry = pills.get(agentId);
|
|
@@ -110,7 +113,7 @@ export function contributeFollowUpPill(client: PluginClientContext, deps: Deps)
|
|
|
110
113
|
function Chip({ title, onPress, theme, compact }: { title: string; onPress: () => void; theme: Theme; compact: boolean }) {
|
|
111
114
|
const c = theme.colors;
|
|
112
115
|
return <Pressable accessibilityRole="button" accessibilityLabel={`Later: ${title}`} onPress={onPress} hitSlop={compact ? 0 : 3}
|
|
113
|
-
style={(s: { pressed: boolean; hovered?: boolean }) => ({ minHeight: compact ?
|
|
116
|
+
style={(s: { pressed: boolean; hovered?: boolean }) => ({ minHeight: compact ? 44 : 26, paddingHorizontal: compact ? 14 : 9, borderRadius: 999, borderWidth: 1, borderColor: c.border, alignItems: "center", justifyContent: "center", backgroundColor: s.pressed || s.hovered ? c.surface2 : "transparent" })}>
|
|
114
117
|
<Text numberOfLines={1} style={{ color: c.foreground, fontSize: compact ? 13 : 12, lineHeight: compact ? 18 : 16 }}>{title}</Text>
|
|
115
118
|
</Pressable>;
|
|
116
119
|
}
|
|
@@ -134,16 +137,18 @@ const LATER = [["hour", "In 1 hour"], ["tonight", "Tonight 18:00"], ["tomorrow",
|
|
|
134
137
|
export function PillPopover(props: PluginButtonContentProps & { deps: Deps }) {
|
|
135
138
|
const { deps } = props;
|
|
136
139
|
const agentId = props.context === "agent" ? props.agentId : "";
|
|
137
|
-
const c = props.theme.colors; const t = text(c);
|
|
138
140
|
const touch = props.layout.compact;
|
|
141
|
+
const c = props.theme.colors; const t = text(c, touch);
|
|
139
142
|
const { target, state, now } = useTarget(deps, agentId, props.workspaceId);
|
|
140
|
-
const
|
|
143
|
+
const browserRead = useRpc(browserStatusRpc);
|
|
141
144
|
const main = !!target.workspace && target.workspace.mainAgentId === agentId;
|
|
142
|
-
|
|
143
|
-
|
|
145
|
+
// The live store already holds this workspace; the popover reads it once on open (Paseo can leave a stray mounted
|
|
146
|
+
// copy, so nothing here polls it: 1.4.0).
|
|
147
|
+
const query = useWorkspace(deps.live, props.workspaceId, { enabled: main });
|
|
148
|
+
const browser = useQuery({ queryKey: browserKey, queryFn: () => browserRead({}), refetchInterval: BROWSER_POLL_MS, enabled: main });
|
|
144
149
|
const [sheet, setSheet] = useState<{ key: string; intent: "merge" | "reviewers" } | null>(null);
|
|
145
150
|
const [question, setQuestion] = useState<string | null>(null);
|
|
146
|
-
const w = main ? query.
|
|
151
|
+
const w = main ? query.workspace ?? target.workspace : null;
|
|
147
152
|
const row = target.row;
|
|
148
153
|
const flagged = state?.mode === "flag";
|
|
149
154
|
const running = !!row && ["running", "initializing"].includes(row.status);
|
|
@@ -153,6 +158,8 @@ export function PillPopover(props: PluginButtonContentProps & { deps: Deps }) {
|
|
|
153
158
|
const items = w ? withoutBriefQuestions(needsYou(w, now), row) : [];
|
|
154
159
|
const done = (work: () => void) => { props.close(); work(); };
|
|
155
160
|
const headline = state && state.mode !== "undo" ? state.headline : null;
|
|
161
|
+
// Phones: one primary per sheet. While the workspace has something to act on, that's the primary and Sign off steps back.
|
|
162
|
+
const itemFirst = touch && !!w && (asking || items.length > 0);
|
|
156
163
|
const tone = headline ? headlineColor(HEADLINE_TONE[headline.key], c) : c.foregroundMuted;
|
|
157
164
|
|
|
158
165
|
return <View style={{ width: 380, maxWidth: "100%", gap: 12, marginTop: touch ? -12 : 0 }}>
|
|
@@ -160,32 +167,45 @@ export function PillPopover(props: PluginButtonContentProps & { deps: Deps }) {
|
|
|
160
167
|
{headline ? <View style={{ gap: 3 }}>
|
|
161
168
|
<View style={{ flexDirection: "row", alignItems: "center", gap: 7 }}>
|
|
162
169
|
<Icon name={HEADLINE_ICON[headline.key]} size={14} color={tone} />
|
|
163
|
-
|
|
164
|
-
{
|
|
170
|
+
{/* Phones: the host's sheet title already says "Follow-up · <label>", so the meta line doesn't repeat it. */}
|
|
171
|
+
{touch
|
|
172
|
+
? <Text style={t.small}>{main ? "Main agent" : "This agent"}{flagged && state.todo > 0 ? ` · ${todoLabel(items.length ? items : withoutBriefQuestions(target.items, row))} in this workspace` : ""}</Text>
|
|
173
|
+
: <>
|
|
174
|
+
<Text style={{ color: tone, fontSize: 12, lineHeight: 16, fontWeight: "600" }}>{headline.label}</Text>
|
|
175
|
+
{flagged && state.todo > 0 && <Text style={t.small}>· {todoLabel(items.length ? items : withoutBriefQuestions(target.items, row))} in this workspace</Text>}
|
|
176
|
+
</>}
|
|
165
177
|
</View>
|
|
166
|
-
<Text numberOfLines={2} style={{ color: c.foreground, fontSize: 14, lineHeight: 20, fontWeight: "600" }}>{headline.line}</Text>
|
|
178
|
+
<Text numberOfLines={touch ? 3 : 2} style={touch ? t.ask : { color: c.foreground, fontSize: 14, lineHeight: 20, fontWeight: "600" }}>{headline.line}</Text>
|
|
167
179
|
</View> : <Text style={t.meta}>Nothing needs you here right now.</Text>}
|
|
168
180
|
|
|
169
181
|
{/* 2. Sign off, with "& next" beside it, then Later. Only for a flagged agent. */}
|
|
170
182
|
{flagged && <View style={{ gap: 10 }}>
|
|
171
183
|
<View style={{ flexDirection: "row", gap: 8 }}>
|
|
172
|
-
<Button theme={props.theme} compact={touch} grow={touch} kind="primary" icon="Check" title="Sign off" accessibilityHint="Clears this agent from Needs you"
|
|
184
|
+
<Button theme={props.theme} compact={touch} grow={touch} kind={itemFirst ? "secondary" : "primary"} icon="Check" title="Sign off" accessibilityHint="Clears this agent from Needs you"
|
|
173
185
|
onPress={() => done(() => void deps.inbox.signOff([agentId]))} />
|
|
174
186
|
<Button theme={props.theme} compact={touch} grow={touch} icon="ArrowRight" title="Sign off & next"
|
|
175
187
|
onPress={() => done(() => { void deps.inbox.signOff([agentId]); deps.openNext(agentId); })} />
|
|
176
188
|
</View>
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
189
|
+
{touch
|
|
190
|
+
// Phones: one row that scrolls sideways, never a second line of chips.
|
|
191
|
+
? <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
|
|
192
|
+
<Text style={t.meta}>Later</Text>
|
|
193
|
+
<ScrollView horizontal showsHorizontalScrollIndicator={false} style={{ flex: 1 }} contentContainerStyle={{ gap: 6, paddingRight: 8 }}>
|
|
194
|
+
{LATER.map(([id, title]) => <Chip key={id} title={title.replace(/^In 1 hour$/, "1 hour")} theme={props.theme} compact onPress={() => done(() => void deps.inbox.snooze([agentId], snoozeUntil(id, new Date())))} />)}
|
|
195
|
+
</ScrollView>
|
|
196
|
+
</View>
|
|
197
|
+
: <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 6 }}>
|
|
198
|
+
<Text style={[t.meta, { marginRight: 2 }]}>Later</Text>
|
|
199
|
+
{LATER.map(([id, title]) => <Chip key={id} title={title} theme={props.theme} compact={touch} onPress={() => done(() => void deps.inbox.snooze([agentId], snoozeUntil(id, new Date())))} />)}
|
|
200
|
+
</View>}
|
|
181
201
|
</View>}
|
|
182
202
|
|
|
183
203
|
{/* 3. The workspace's own items, only when there are some. */}
|
|
184
204
|
{w && (asking || items.length > 0) && <View style={{ gap: 8, paddingTop: flagged ? 12 : 0, borderTopWidth: flagged ? 1 : 0, borderTopColor: c.border }}>
|
|
185
|
-
{flagged && <Text style={[t.small, { fontWeight: "600" }]}>In this workspace · {todoLabel(items)}</Text>}
|
|
205
|
+
{flagged && <Text style={touch ? t.section : [t.small, { fontWeight: "600" }]}>In this workspace · {todoLabel(items)}</Text>}
|
|
186
206
|
{asking
|
|
187
207
|
? <QuestionStepper workspace={w} theme={props.theme} compact={touch} bodyMaxHeight={touch ? undefined : 200} onDetails={setQuestion} onAnswered={() => deps.live.refresh()} />
|
|
188
|
-
: <NeedsYouList workspace={w} theme={props.theme} compact={touch} flush
|
|
208
|
+
: <NeedsYouList workspace={w} theme={props.theme} compact={touch} flush feature={touch}
|
|
189
209
|
actions={{ after: () => deps.live.refresh(), openPr: (key, intent) => setSheet({ key, intent }), openQuestion: setQuestion }} />}
|
|
190
210
|
{asking && items.some(i => i.kind !== "question") && <Text numberOfLines={2} style={t.small}>Also: {items.filter(i => i.kind !== "question").map(i => i.title).join(" · ")}</Text>}
|
|
191
211
|
<PrSheet workspace={w} prKey={sheet?.key ?? null} intent={sheet?.intent ?? null} theme={props.theme} compact={touch} browserReady={browser.data?.ready ?? false} onClose={() => { setSheet(null); deps.live.refresh(); }} />
|
package/client/pr-controls.tsx
CHANGED
|
@@ -4,25 +4,33 @@ import { useRpc } from "@getpaseo/plugin/client";
|
|
|
4
4
|
import { Icon, useToast } from "@getpaseo/plugin/client/ui";
|
|
5
5
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
6
|
import { confirmPrActionRpc, preparePrActionRpc, prControlStatusRpc, requestReviewersRpc } from "../shared/contracts";
|
|
7
|
-
import { mergeBlockers, prActionBlocks, type ActionPlan, type PrActionKind } from "../shared/pr-actions";
|
|
7
|
+
import { isGithubFlow, mergeBlockers, prActionBlocks, type ActionPlan, type PrActionKind } from "../shared/pr-actions";
|
|
8
|
+
import type { MergeMethod } from "../shared/pr-workflow";
|
|
8
9
|
import { mergeQueued, mergeReady } from "../shared/attention";
|
|
9
10
|
import type { Pr, Workspace } from "../shared/model";
|
|
10
11
|
import { Button, Switch, errorText, text, type Theme } from "./kit";
|
|
11
12
|
import { noReviewers, resolveReviewers, withoutAuthor, type ReviewerEntry } from "../shared/reviewers";
|
|
12
13
|
import { ReviewerPicker, reviewerSettingsKey, useReviewerSettings, willAsk } from "./reviewers";
|
|
13
14
|
|
|
15
|
+
const METHOD_SENTENCE: Record<MergeMethod, string> = { squash: "squash and merge it", merge: "merge it with a merge commit", rebase: "rebase and merge it" };
|
|
16
|
+
/** Blockers read as nouns after "clears:"; proper names (GitHub, Graphite) keep their capital. */
|
|
17
|
+
const lowerFirst = (b: string) => /^(GitHub|Graphite)\b/.test(b) ? b : b[0].toLowerCase() + b.slice(1);
|
|
18
|
+
|
|
14
19
|
/**
|
|
15
20
|
* Merge, merge-when-ready and reviewer requests for one PR. Every write needs a click; Merge always
|
|
16
|
-
* prepares a fresh plan and asks again before anything reaches Graphite.
|
|
21
|
+
* prepares a fresh plan and asks again before anything reaches Graphite or GitHub. In GitHub mode When ready is
|
|
22
|
+
* GitHub's auto-merge, read with the PR, so it needs no browser companion; it's hidden when the repository disallows it.
|
|
17
23
|
*/
|
|
18
|
-
export function PrControls({ pr, workspace, theme, compact, browserReady, intent }: { browserReady: boolean; pr: Pr; workspace: Workspace; theme: Theme; compact: boolean; intent?: "merge" | "reviewers" | null }) {
|
|
24
|
+
export function PrControls({ pr, workspace, theme, compact, browserReady: companionReady, intent }: { browserReady: boolean; pr: Pr; workspace: Workspace; theme: Theme; compact: boolean; intent?: "merge" | "reviewers" | null }) {
|
|
19
25
|
const read = useRpc(prControlStatusRpc); const prepare = useRpc(preparePrActionRpc); const confirm = useRpc(confirmPrActionRpc); const cache = useQueryClient();
|
|
20
26
|
const requestReviewers = useRpc(requestReviewersRpc);
|
|
21
27
|
const toast = useToast();
|
|
22
28
|
const c = theme.colors; const t = text(c);
|
|
29
|
+
const github = isGithubFlow(pr.snapshot);
|
|
30
|
+
const browserReady = github ? !!pr.snapshot?.repoMerge?.autoMerge : companionReady;
|
|
23
31
|
const [plan, setPlan] = useState<ActionPlan | null>(null); const [notice, setNotice] = useState<string | null>(null);
|
|
24
32
|
const statusKey = ["follow-through", "pr-controls", workspace.id, pr.key, pr.snapshot?.head];
|
|
25
|
-
const status = useQuery({ queryKey: statusKey, queryFn: () => read({ workspaceId: workspace.id, prKey: pr.key }), refetchInterval:
|
|
33
|
+
const status = useQuery({ queryKey: statusKey, queryFn: () => read({ workspaceId: workspace.id, prKey: pr.key }), refetchInterval: 10_000, enabled: browserReady });
|
|
26
34
|
const invalidate = () => { void cache.invalidateQueries({ queryKey: ["follow-through", "workspace", workspace.id] }); void cache.invalidateQueries({ queryKey: ["follow-through", "pr-controls", workspace.id] }); void cache.invalidateQueries({ queryKey: ["follow-through", "overview"] }); };
|
|
27
35
|
const [picking, setPicking] = useState(false);
|
|
28
36
|
const reviewerSettings = useReviewerSettings();
|
|
@@ -57,9 +65,23 @@ export function PrControls({ pr, workspace, theme, compact, browserReady, intent
|
|
|
57
65
|
const loaded = !!reviewerSettings.data;
|
|
58
66
|
useEffect(() => { if (intent === "reviewers" && loaded && missingReviewers && !pr.snapshot?.draft && !reviewers.length) setPicking(true); }, [intent, loaded]);
|
|
59
67
|
if (pr.snapshot?.state !== "OPEN") return null;
|
|
60
|
-
const waitingFor = mergeBlockers(pr).filter(b => !b.startsWith("Graphite "));
|
|
68
|
+
const waitingFor = mergeBlockers(pr).filter(b => !b.startsWith("Graphite ")).map(lowerFirst);
|
|
69
|
+
// GitHub refuses auto-merge on a PR it can already merge, so the switch shows only while Merge is waiting, or to turn it off.
|
|
70
|
+
const showSwitch = browserReady && (!github || !canMerge || !!enabled);
|
|
71
|
+
const autoMergeOff = github && !!pr.snapshot?.repoMerge && !pr.snapshot.repoMerge.autoMerge && !canMerge && !queued;
|
|
61
72
|
return <View style={{ gap: 10 }}>
|
|
62
|
-
{
|
|
73
|
+
{/* Phones: the reviewer sentence gets its own line, the two actions share the row under it (no floating ghost). */}
|
|
74
|
+
{missingReviewers && compact && <View style={{ gap: 8 }}>
|
|
75
|
+
<View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
|
|
76
|
+
<Icon name="UserX" size={14} color={c.statusWarning} />
|
|
77
|
+
<Text style={[t.meta, { flex: 1, minWidth: 120, color: c.statusWarning }]}>{!pr.snapshot?.draft && !picking && reviewers.length ? <>No reviewers yet<Text style={{ color: c.foregroundMuted }}>{` · will ask ${willAsk(reviewers)}`}</Text></> : "No reviewers yet"}</Text>
|
|
78
|
+
</View>
|
|
79
|
+
{!pr.snapshot?.draft && !picking && reviewerSettings.data && <View style={{ flexDirection: "row", gap: 8 }}>
|
|
80
|
+
{reviewers.length > 0 && <Button grow title={reviewRequest.isPending ? "Requesting…" : "Add reviewers"} accessibilityLabel={`Add reviewers: ${willAsk(reviewers)} for ${pr.repo} pull request ${pr.number}`} icon="UserPlus" theme={theme} compact disabled={disabled} loading={reviewRequest.isPending} onPress={() => { setNotice(null); reviewRequest.mutate(undefined); }} />}
|
|
81
|
+
<Button grow title={reviewers.length ? "Choose others…" : "Add reviewers…"} icon={reviewers.length ? "Users" : "UserPlus"} accessibilityLabel={reviewers.length ? "Pick different reviewers for this PR" : `Pick reviewers for ${pr.repo} pull request ${pr.number}`} theme={theme} compact disabled={disabled} onPress={() => { setNotice(null); setPicking(true); }} />
|
|
82
|
+
</View>}
|
|
83
|
+
</View>}
|
|
84
|
+
{missingReviewers && !compact && <View style={{ flexDirection: "row", alignItems: "center", flexWrap: "wrap", gap: 8 }}>
|
|
63
85
|
<Icon name="UserX" size={14} color={c.statusWarning} />
|
|
64
86
|
<Text style={[t.meta, { flex: 1, minWidth: 120, color: c.statusWarning }]}>{!pr.snapshot?.draft && !picking && reviewers.length ? <>No reviewers yet<Text style={{ color: c.foregroundMuted }}>{` · will ask ${willAsk(reviewers)}`}</Text></> : "No reviewers yet"}</Text>
|
|
65
87
|
{!pr.snapshot?.draft && !picking && reviewerSettings.data && <>
|
|
@@ -71,15 +93,16 @@ export function PrControls({ pr, workspace, theme, compact, browserReady, intent
|
|
|
71
93
|
onCancel={() => setPicking(false)} onRequest={(picked, remember) => reviewRequest.mutate({ picked, remember })} />}
|
|
72
94
|
{!plan && <View style={{ flexDirection: "row", alignItems: "center", flexWrap: "wrap", gap: 12 }}>
|
|
73
95
|
{(canMerge || queued || recentlySubmitted || busy) ? <Button title={busy ? checking.isPending ? "Checking…" : "Submitting…" : queued ? "Queued to merge" : recentlySubmitted ? "Submitted" : `Merge #${pr.number}`} icon={queued ? "Clock" : "GitMerge"} theme={theme} compact={compact} kind={canMerge ? "primary" : "secondary"} loading={busy} disabled={disabled || !canMerge} onPress={() => begin("merge")} />
|
|
74
|
-
: <Text style={[t.meta, { flex: 1 }]}>{waitingFor.length ? `Merge opens when it clears: ${waitingFor.join(", ")
|
|
75
|
-
{
|
|
96
|
+
: <Text style={[t.meta, { flex: 1 }]}>{waitingFor.length ? `Merge opens when it clears: ${waitingFor.join(", ")}.` : github ? "Waiting for GitHub to confirm it can merge." : "Waiting for Graphite to report it ready to merge."}</Text>}
|
|
97
|
+
{showSwitch && <Switch theme={theme} compact={compact} label={`${github ? "Auto-merge" : "When ready"}${known ? "" : " · unknown"}`} accessibilityLabel={`${github ? "Auto-merge" : "Merge when ready"} for ${pr.repo} pull request ${pr.number}`} value={known ? !!enabled : null} disabled={disabled} onChange={() => begin(enabled ? "disable_mwr" : "enable_mwr")} />}
|
|
76
98
|
</View>}
|
|
99
|
+
{!plan && autoMergeOff && <Text style={t.meta}>Auto-merge is off for this repository. Turn on Allow auto-merge in its GitHub settings.</Text>}
|
|
77
100
|
{error && <Text accessibilityRole="alert" style={[t.meta, { color: c.statusDanger }]}>{error}</Text>}
|
|
78
101
|
{notice && <Text accessibilityLiveRegion="polite" style={t.meta}>{notice}</Text>}
|
|
79
102
|
{plan && (plan.kind === "merge" || browserReady) && <View accessibilityRole="summary" style={{ gap: 8 }}>
|
|
80
103
|
<Text accessibilityRole="header" style={[t.label, { fontSize: 14, lineHeight: 20 }]}>{plan.kind === "merge" ? plan.prs.length > 1 ? "Merge the PRs underneath too?" : "Merge this PR?" : `${plan.kind === "enable_mwr" ? "Enable" : "Disable"} for downstack too?`}</Text>
|
|
81
|
-
<Text style={t.meta}>{plan.kind === "merge" ? plan.prs.length > 1 ? `#${pr.number} depends on ${plan.prs.length - 1} unmerged PR${plan.prs.length === 2 ? "" : "s"}. Merge these ${plan.prs.length} PRs in order:` : "Graphite will merge using this repository’s settings and required protections." : `Change merge when ready for #${pr.number} only, or for all ${plan.prs.length} listed PRs.`}</Text>
|
|
82
|
-
{plan.prs.map((p, i) => <View key={p.key} style={{ flexDirection: "row", gap: 8 }}>
|
|
104
|
+
<Text style={t.meta}>{plan.kind === "merge" ? plan.prs.length > 1 ? `#${pr.number} depends on ${plan.prs.length - 1} unmerged PR${plan.prs.length === 2 ? "" : "s"}. ${plan.mergeQueue ? `This repository merges through a merge queue, so #${plan.prs[0].number} goes in first; merge the next one after it lands:` : `Merge these ${plan.prs.length} PRs in order:`}` : plan.via === "github" ? plan.mergeQueue ? "GitHub adds it to this repository’s merge queue, which merges it once its checks pass." : `GitHub will ${METHOD_SENTENCE[plan.method ?? "squash"]} once this repository’s required protections pass.` : "Graphite will merge using this repository’s settings and required protections." : `Change ${plan.via === "github" ? "auto-merge" : "merge when ready"} for #${pr.number} only, or for all ${plan.prs.length} listed PRs.`}</Text>
|
|
105
|
+
{(plan.via !== "github" || plan.prs.length > 1 || plan.prs.some(p => p.blockers.length > 0)) && plan.prs.map((p, i) => <View key={p.key} style={{ flexDirection: "row", gap: 8 }}>
|
|
83
106
|
<Text style={[t.meta, { width: 16, textAlign: "right", fontVariant: ["tabular-nums"] }]}>{i + 1}.</Text>
|
|
84
107
|
<View style={{ flex: 1, gap: 2 }}>
|
|
85
108
|
<Text style={[t.body, { fontSize: 12, lineHeight: 17 }]}>#{p.number} · {p.title}</Text>
|
|
@@ -87,10 +110,11 @@ export function PrControls({ pr, workspace, theme, compact, browserReady, intent
|
|
|
87
110
|
</View>
|
|
88
111
|
</View>)}
|
|
89
112
|
{plan.blockers.map(blocker => <Text key={blocker} style={[t.meta, { color: c.statusWarning }]}>{blocker}</Text>)}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{plan.kind
|
|
93
|
-
<Button title="
|
|
113
|
+
{/* Phones: the confirm is full width with Cancel under it; desktop keeps one row. */}
|
|
114
|
+
<View style={compact ? { gap: 8, marginTop: 4 } : { flexDirection: "row", flexWrap: "wrap", gap: 8, marginTop: 2 }}>
|
|
115
|
+
<Button grow={compact} title={plan.kind === "merge" ? plan.mergeQueue ? `Add #${plan.prs[0].number} to merge queue` : plan.prs.length > 1 ? `Merge all ${plan.prs.length} PRs` : `Merge #${pr.number}` : `${plan.kind === "enable_mwr" ? "Enable" : "Disable"} for all ${plan.prs.length} PRs`} kind="primary" theme={theme} compact={compact} loading={submit.isPending} disabled={submit.isPending || scopeBlocked("downstack")} onPress={() => act("downstack")} />
|
|
116
|
+
{plan.kind !== "merge" && plan.prs.length > 1 && <Button grow={compact} title="Just this PR" theme={theme} compact={compact} disabled={submit.isPending || scopeBlocked("target")} onPress={() => act("target")} />}
|
|
117
|
+
<Button grow={compact} title="Cancel" kind="ghost" theme={theme} compact={compact} disabled={submit.isPending} onPress={() => { setPlan(null); checking.reset(); submit.reset(); }} />
|
|
94
118
|
</View>
|
|
95
119
|
</View>}
|
|
96
120
|
</View>;
|
package/client/pr-sheet.tsx
CHANGED
|
@@ -18,7 +18,7 @@ function Fact({ icon, color, children, theme }: { icon: string; color?: string;
|
|
|
18
18
|
|
|
19
19
|
/** Everything about one PR, with its merge and reviewer controls. A sheet on phones, a dialog on desktop. */
|
|
20
20
|
export function PrSheet({ workspace: w, prKey, intent, theme, compact, browserReady, onClose }: { workspace: Workspace; prKey: string | null; intent: "merge" | "reviewers" | null; theme: Theme; compact: boolean; browserReady: boolean; onClose: () => void }) {
|
|
21
|
-
const c = theme.colors; const t = text(c);
|
|
21
|
+
const c = theme.colors; const t = text(c, compact);
|
|
22
22
|
const pr = w.prs.find(p => p.key === prKey) ?? null;
|
|
23
23
|
const s = pr?.snapshot;
|
|
24
24
|
const open = (url: string) => { void openExternalUrl(url).catch(() => undefined); };
|
|
@@ -28,10 +28,10 @@ export function PrSheet({ workspace: w, prKey, intent, theme, compact, browserRe
|
|
|
28
28
|
const parent = pr?.parent ? w.prs.find(p => p.key === pr.parent) : null;
|
|
29
29
|
const reviewers = s?.reviewers?.complete ? [...new Set([...s.reviewers.requested, ...s.reviewers.teams.map(team => `team/${team}`), ...s.reviewers.reviewed])] : [];
|
|
30
30
|
return <Modal title={pr ? `Pull request #${pr.number}` : "Pull request"} icon={<Icon name={tone === "merged" ? "GitMerge" : "GitPullRequest"} size={18} color={toneColor(c, tone)} />} open={!!pr} onOpenChange={next => { if (!next) onClose(); }}>
|
|
31
|
-
<Modal.Content contentContainerStyle={{ padding: compact ? 16 : 20, gap: 14 }}>
|
|
31
|
+
<Modal.Content contentContainerStyle={{ padding: compact ? 16 : 20, gap: compact ? 16 : 14, ...(compact ? { paddingBottom: 24 } : null) }}>
|
|
32
32
|
{pr && <>
|
|
33
33
|
<View style={{ gap: 6 }}>
|
|
34
|
-
<Text selectable style={[t.title, { fontSize: 16, lineHeight: 22 }]}>{s?.title ?? `${pr.repo} pull request`}</Text>
|
|
34
|
+
<Text selectable style={compact ? t.title : [t.title, { fontSize: 16, lineHeight: 22 }]}>{s?.title ?? `${pr.repo} pull request`}</Text>
|
|
35
35
|
<View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8 }}>
|
|
36
36
|
{status && <Chip theme={theme} label={status.label} color={toneColor(c, tone === "pending" || tone === "draft" ? "unknown" : tone)} />}
|
|
37
37
|
<Text style={t.meta}>{pr.repo} · {pr.stack}{stack.length > 1 ? ` · ${stack.indexOf(pr) + 1} of ${stack.length}` : ""}</Text>
|
|
@@ -53,9 +53,11 @@ export function PrSheet({ workspace: w, prKey, intent, theme, compact, browserRe
|
|
|
53
53
|
{s?.state === "OPEN" && <View style={{ paddingTop: 12, borderTopWidth: 1, borderTopColor: c.border }}>
|
|
54
54
|
<PrControls key={`${pr.key}:${intent ?? ""}`} pr={pr} workspace={w} theme={theme} compact={compact} browserReady={browserReady} intent={intent} />
|
|
55
55
|
</View>}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{s?.
|
|
56
|
+
{/* Phones: the links split the row evenly. GitHub-mode repositories have no Graphite link; GitHub is the link. */}
|
|
57
|
+
<View style={{ flexDirection: "row", flexWrap: compact ? "nowrap" : "wrap", gap: 8, paddingTop: 12, borderTopWidth: 1, borderTopColor: c.border }}>
|
|
58
|
+
{s?.prWorkflow !== "github" && <View style={compact ? { flex: 1 } : undefined}><Button theme={theme} compact={compact} grow={compact} icon="ExternalLink" title="Open in Graphite" accessibilityLabel={`Open ${pr.repo} pull request ${pr.number} in Graphite`} onPress={() => open(graphitePrUrl(pr))} /></View>}
|
|
59
|
+
{s?.url && s.prWorkflow === "github" && <View style={compact ? { flex: 1 } : undefined}><Button theme={theme} compact={compact} grow={compact} icon="ExternalLink" title="Open on GitHub" accessibilityLabel={`Open ${pr.repo} pull request ${pr.number} on GitHub`} onPress={() => open(s.url)} /></View>}
|
|
60
|
+
{s?.url && s.prWorkflow !== "github" && <View style={compact ? { flex: 1 } : undefined}><Button theme={theme} compact={compact} grow={compact} kind={compact ? "secondary" : "ghost"} icon="Github" title="GitHub" accessibilityLabel={`Open ${pr.repo} pull request ${pr.number} on GitHub`} onPress={() => open(s.url)} /></View>}
|
|
59
61
|
</View>
|
|
60
62
|
</>}
|
|
61
63
|
</Modal.Content>
|
package/client/questions.tsx
CHANGED
|
@@ -135,6 +135,8 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
|
|
|
135
135
|
const body = <View style={{ gap: dense ? 10 : 14 }}>
|
|
136
136
|
<View style={{ gap: 6 }}>
|
|
137
137
|
<Text selectable style={[t.body, { fontSize: dense ? 13 : 15, lineHeight: dense ? 19 : 22 }]}>{q.question}</Text>
|
|
138
|
+
{/* Phones: who asked and when is meta under the question, not a footnote after the buttons. */}
|
|
139
|
+
{compact && !dense && <Text style={t.small}>Asked {ago(q.askedAt, now)} by {who(w, q.askedBy)}{q.taskId && !q.options.length ? " (blocked task)" : ""}</Text>}
|
|
138
140
|
{open && <View style={{ flexDirection: "row", gap: 6 }}>
|
|
139
141
|
<View style={{ paddingTop: 2 }}><Icon name={state.icon} size={12} color={state.color(c)} /></View>
|
|
140
142
|
<Text style={[t.meta, { flex: 1, color: state.color(c) }]}>{state.text}</Text>
|
|
@@ -164,7 +166,7 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
|
|
|
164
166
|
</View>;
|
|
165
167
|
const actions = (open || q.answer && ["queued", "unconfirmed", "copied"].includes(q.answer.delivery.state)) && <View style={{ gap: 6 }}>
|
|
166
168
|
<View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8 }}>
|
|
167
|
-
{open && <Button theme={theme} compact={compact} kind="primary" icon="Send" title="Send to agent" accessibilityLabel={`Send your ${q.id} answer to the agent`} disabled={!answer || run.isPending} loading={run.isPending && run.variables === "send"} onPress={() => run.mutate("send")} />}
|
|
169
|
+
{open && <Button theme={theme} compact={compact} grow={compact} kind="primary" icon="Send" title="Send to agent" accessibilityLabel={`Send your ${q.id} answer to the agent`} accessibilityHint={compact ? `Puts your answer straight into the asking agent's chat, even mid-turn. Follow-up keeps it under ${q.id}.` : undefined} disabled={!answer || run.isPending} loading={run.isPending && run.variables === "send"} onPress={() => run.mutate("send")} />}
|
|
168
170
|
{open && <Button theme={theme} compact={compact} icon="Copy" title="Copy" accessibilityLabel={`Copy your ${q.id} answer instead of sending it`} disabled={!answer || run.isPending} loading={run.isPending && run.variables === "copy"} onPress={() => run.mutate("copy")} />}
|
|
169
171
|
{q.answer?.delivery.state === "copied" && <Button theme={theme} compact={compact} kind="primary" icon="Send" title="Send to agent" accessibilityLabel={`Send your ${q.id} answer to the agent`} loading={run.isPending} onPress={() => run.mutate("send")} />}
|
|
170
172
|
{q.answer && ["queued", "unconfirmed"].includes(q.answer.delivery.state) && <Button theme={theme} compact={compact} icon="RotateCcw" title={q.answer.delivery.state === "queued" ? "Try now" : "Resend"} accessibilityLabel={`Send the ${q.id} answer again`} loading={run.isPending} onPress={() => run.mutate("resend")} />}
|
|
@@ -173,7 +175,7 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
|
|
|
173
175
|
{pinned && open && !free && !noteOpen && <Button theme={theme} compact={compact} kind="ghost" icon="Pencil" title="Note" accessibilityLabel={`Add a note for the agent about ${q.id}`} onPress={() => setNoteOpen(true)} />}
|
|
174
176
|
{dense && onDetails && <IconButton theme={theme} compact={compact} icon="Maximize2" label={`Open ${q.id} with its links and full context`} onPress={onDetails} />}
|
|
175
177
|
</View>
|
|
176
|
-
{open && !dense && <Text style={t.small}>Send puts your answer straight into the asking agent's chat, even mid-turn. Follow-up keeps it under {q.id}.</Text>}
|
|
178
|
+
{open && !dense && !compact && <Text style={t.small}>Send puts your answer straight into the asking agent's chat, even mid-turn. Follow-up keeps it under {q.id}.</Text>}
|
|
177
179
|
</View>;
|
|
178
180
|
// In the pill popover the question scrolls and the answer field and actions stay put, so Send is never cut off.
|
|
179
181
|
if (pinned) {
|
|
@@ -196,7 +198,7 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
|
|
|
196
198
|
return <View style={{ gap: dense ? 10 : 14 }}>
|
|
197
199
|
{body}
|
|
198
200
|
{actions}
|
|
199
|
-
{!dense && <Text style={t.small}>Asked {ago(q.askedAt, now)} by {who(w, q.askedBy)}{q.taskId && !q.options.length ? " (blocked task)" : ""}</Text>}
|
|
201
|
+
{!dense && !compact && <Text style={t.small}>Asked {ago(q.askedAt, now)} by {who(w, q.askedBy)}{q.taskId && !q.options.length ? " (blocked task)" : ""}</Text>}
|
|
200
202
|
</View>;
|
|
201
203
|
}
|
|
202
204
|
|
|
@@ -302,6 +304,6 @@ export function ActivityCard({ workspace: w, theme, compact, now, open, toggle,
|
|
|
302
304
|
</View>
|
|
303
305
|
</CardRow>;
|
|
304
306
|
})}
|
|
305
|
-
{list.length > LIMIT && <FoldRow theme={theme} open={all} onPress={() => toggle("activity")} icon="History" iconColor={c.foregroundMuted} label={all ? "Show less" : `Show all ${list.length}`} />}
|
|
307
|
+
{list.length > LIMIT && <FoldRow theme={theme} compact={compact} open={all} onPress={() => toggle("activity")} icon="History" iconColor={c.foregroundMuted} label={all ? "Show less" : `Show all ${list.length}`} />}
|
|
306
308
|
</Card>;
|
|
307
309
|
}
|