@andrioid/paseo-attention-span 0.1.2 β 0.2.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.
- package/OVERVIEW.md +116 -42
- package/README.md +12 -12
- package/client/attention-screen.tsx +232 -175
- package/client/card.tsx +141 -0
- package/client/coverage-settings.tsx +73 -20
- package/client/data.ts +2 -1
- package/client/icons.ts +3 -0
- package/client/next-up.tsx +266 -62
- package/client/session-menu.ts +45 -0
- package/client/sessions.ts +10 -8
- package/client/sheet.tsx +75 -3
- package/client/ui.tsx +91 -9
- package/docs/screenshots/desktop-dark-doing.png +0 -0
- package/docs/screenshots/desktop-dark-next-up.png +0 -0
- package/docs/screenshots/phone-dark-doing.png +0 -0
- package/index.server.ts +21 -19
- package/package.json +1 -1
- package/paseo-plugin.json +4 -2
- package/server/actions.ts +15 -1
- package/server/classify.ts +21 -13
- package/server/fixture.ts +34 -14
- package/server/github-types.ts +5 -1
- package/server/queries.ts +44 -13
- package/server/service.ts +90 -16
- package/server/setup.ts +12 -5
- package/server/store.ts +18 -2
- package/server/view.ts +72 -1
- package/shared/attention.ts +34 -2
- package/shared/config.ts +20 -3
- package/shared/format.ts +16 -0
- package/shared/rpc.ts +19 -11
- package/shared/setup.ts +2 -0
|
@@ -4,19 +4,21 @@ import { Markdown, Modal, TextInput, useToast } from "@getpaseo/plugin/client/ui
|
|
|
4
4
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
5
5
|
import { type ReactNode, useState } from "react";
|
|
6
6
|
import { Pressable, ScrollView, Text, View } from "react-native";
|
|
7
|
-
import { type ActionId, type AgentSummary, type Chip, type FailingChecks, type Item, type NextUpIssue, type Section, type SectionId, type SubRow, TAB_FEED, type TabId, type Target } from "../shared/attention";
|
|
8
|
-
import type
|
|
9
|
-
import { ago, linkList } from "../shared/format";
|
|
7
|
+
import { type ActionId, type AgentSummary, type AttentionView, type Chip, type FailingChecks, type Item, itemSessions, type NextUpIssue, type Section, type SectionId, type SubRow, TAB_FEED, type TabId, type Target } from "../shared/attention";
|
|
8
|
+
import { type AttentionConfig, nextUpSources, type SessionKind } from "../shared/config";
|
|
9
|
+
import { ago, linkList, repoLabel } from "../shared/format";
|
|
10
10
|
import { ACTION_SESSION, renderPrompt } from "../shared/prompts";
|
|
11
11
|
import * as rpc from "../shared/rpc";
|
|
12
12
|
import { blocks } from "../shared/setup";
|
|
13
13
|
import { useAttention } from "./data";
|
|
14
|
+
import { CardList, CardRow, type CardProps } from "./card";
|
|
14
15
|
import type { IconName } from "./icons";
|
|
15
16
|
import { NextUpList } from "./next-up";
|
|
16
|
-
import {
|
|
17
|
+
import { agentSignal, openSessionEntry, sessionsGroup } from "./session-menu";
|
|
18
|
+
import { ActionSheet, DetailLines, type MenuGroup, MenuSheet, type SheetEntry } from "./sheet";
|
|
17
19
|
import { branchWorkspaces, findCheckout, githubProjects, itemAgents, listProfiles, noProjectMessage, resolveAgentConfig, startSession } from "./sessions";
|
|
18
20
|
import { SetupChecklist } from "./setup";
|
|
19
|
-
import { Avatar, Button, KeepStyles, Meta, SectionHeader, StylesProvider, TablerIcon, Toggle, useCopy, useHover, useStyles } from "./ui";
|
|
21
|
+
import { type Anchor, Avatar, Button, KeepStyles, Loading, Meta, SectionHeader, SpinningIcon, StylesProvider, TablerIcon, Toggle, useCopy, useHover, useStyles } from "./ui";
|
|
20
22
|
|
|
21
23
|
// The agent icon marks every action that starts an agent session; the rest act on GitHub right away [ATT-13].
|
|
22
24
|
const ACTION_ICONS: Record<ActionId, IconName> = {
|
|
@@ -66,7 +68,7 @@ function actionDetail(action: Exclude<ActionId, "rerun">, item: Item): string {
|
|
|
66
68
|
return {
|
|
67
69
|
reply: item.person ? `Opens ${item.person.login}'s comment on GitHub` : "Opens it on GitHub",
|
|
68
70
|
acknowledge:
|
|
69
|
-
comments.length === 1 ? `Reacts
|
|
71
|
+
comments.length === 1 ? `Reacts to ${comments[0].author}'s comment, which clears it` : `Pick which of the ${comments.length} waiting comments to react to`,
|
|
70
72
|
review: "An agent reviews the PR in a checkout and reports back. Nothing is posted",
|
|
71
73
|
fix: "An agent reads the failing logs and commits a fix, without pushing",
|
|
72
74
|
address: "An agent works through the unresolved comments and applies the trivial ones, without pushing",
|
|
@@ -94,16 +96,6 @@ function rerunEntry(failing: FailingChecks[] | undefined, loading: boolean): { d
|
|
|
94
96
|
return { detail: `${names} Β· ${reruns ? `rerun ${reruns === 1 ? "once" : `${reruns} times`} already` : "not rerun yet"}`, runIds: runs.map((run) => run.id) };
|
|
95
97
|
}
|
|
96
98
|
|
|
97
|
-
// "Continue review" keeps what the session is for [SES-03].
|
|
98
|
-
const CONTINUE_LABELS: Record<SessionKind, string> = {
|
|
99
|
-
review: "Continue review",
|
|
100
|
-
fix: "Continue fix",
|
|
101
|
-
address: "Continue comments",
|
|
102
|
-
rebase: "Continue rebase",
|
|
103
|
-
refresh: "Continue refresh",
|
|
104
|
-
start: "Continue",
|
|
105
|
-
};
|
|
106
|
-
|
|
107
99
|
const SECTION_ICONS: Record<SectionId, IconName> = {
|
|
108
100
|
reply: "reply",
|
|
109
101
|
review: "review",
|
|
@@ -142,6 +134,16 @@ interface Placing {
|
|
|
142
134
|
before?: () => Promise<unknown>;
|
|
143
135
|
}
|
|
144
136
|
|
|
137
|
+
// Session options, before it starts [SES-02].
|
|
138
|
+
export interface OptionsSpec {
|
|
139
|
+
itemKey: string;
|
|
140
|
+
title: string;
|
|
141
|
+
kind: SessionKind;
|
|
142
|
+
target: Target;
|
|
143
|
+
// Claims an issue first [NXT-05].
|
|
144
|
+
before?: () => Promise<unknown>;
|
|
145
|
+
}
|
|
146
|
+
|
|
145
147
|
// Something I just did, offered for undo until the tab changes [ATT-08, ATT-14].
|
|
146
148
|
interface Undoable {
|
|
147
149
|
id: number;
|
|
@@ -150,14 +152,6 @@ interface Undoable {
|
|
|
150
152
|
undo: () => Promise<unknown>;
|
|
151
153
|
}
|
|
152
154
|
|
|
153
|
-
// A session started from the item, as a signal [ATT-07].
|
|
154
|
-
function agentSignal(agent: AgentSummary): Chip {
|
|
155
|
-
if (agent.requiresAttention) return { text: "agent needs you", tone: "warn" };
|
|
156
|
-
if (agent.status === "running" || agent.status === "initializing") return { text: "agent working", tone: "good" };
|
|
157
|
-
if (agent.status === "error") return { text: "agent failed", tone: "bad" };
|
|
158
|
-
return { text: "agent idle", tone: "neutral" };
|
|
159
|
-
}
|
|
160
|
-
|
|
161
155
|
// `openSettings` opens the orgs and repos settings [SRC-02].
|
|
162
156
|
export function AttentionScreen({ theme, layout, navigation, openSettings }: PluginScreenProps & { openSettings?: () => void }) {
|
|
163
157
|
return (
|
|
@@ -179,6 +173,9 @@ function AttentionList({ navigation, openSettings }: Pick<PluginScreenProps, "na
|
|
|
179
173
|
const undismiss = useRpc(rpc.undismissItem);
|
|
180
174
|
const restore = useRpc(rpc.restoreDismissed);
|
|
181
175
|
const saveScopes = useRpc(rpc.setScopes);
|
|
176
|
+
const saveSources = useRpc(rpc.setSources);
|
|
177
|
+
const closeIssue = useRpc(rpc.closeIssue);
|
|
178
|
+
const reopenIssue = useRpc(rpc.reopenIssue);
|
|
182
179
|
const update = useRpc(rpc.updateBranch);
|
|
183
180
|
const merge = useRpc(rpc.mergePullRequest);
|
|
184
181
|
const close = useRpc(rpc.closePullRequest);
|
|
@@ -193,9 +190,11 @@ function AttentionList({ navigation, openSettings }: Pick<PluginScreenProps, "na
|
|
|
193
190
|
const fetchDefaultBranch = useRpc(rpc.defaultBranch);
|
|
194
191
|
const defaultBranch: DefaultBranch = async (repo) => (await fetchDefaultBranch({ repo })).name;
|
|
195
192
|
const [tab, setTab] = useState<TabId>("doing");
|
|
196
|
-
|
|
193
|
+
// Every card with a change still running: each runs on its own.
|
|
194
|
+
const [busy, setBusy] = useState<ReadonlySet<string>>(new Set());
|
|
197
195
|
const [undoable, setUndoable] = useState<Undoable[]>([]);
|
|
198
196
|
const [placing, setPlacing] = useState<Placing | null>(null);
|
|
197
|
+
const [options, setOptions] = useState<OptionsSpec | null>(null);
|
|
199
198
|
const view = attention.data;
|
|
200
199
|
// Only when something fails: is it setup, and what's missing [SET-01]?
|
|
201
200
|
const fetchSetup = useRpc(rpc.setupStatus);
|
|
@@ -204,27 +203,24 @@ function AttentionList({ navigation, openSettings }: Pick<PluginScreenProps, "na
|
|
|
204
203
|
const [checking, setChecking] = useState(false);
|
|
205
204
|
|
|
206
205
|
async function run(key: string, label: string, work: () => Promise<unknown>) {
|
|
207
|
-
setBusy(key);
|
|
206
|
+
setBusy((keys) => new Set(keys).add(key));
|
|
208
207
|
try {
|
|
209
208
|
await work();
|
|
210
209
|
} catch (error) {
|
|
211
210
|
toast.error(`${label} failed: ${(error as Error).message}`);
|
|
212
211
|
} finally {
|
|
213
|
-
setBusy(
|
|
212
|
+
setBusy((keys) => new Set([...keys].filter((other) => other !== key)));
|
|
214
213
|
}
|
|
215
214
|
}
|
|
216
215
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
// A change on GitHub from one tap, without confirming: Undo instead, where GitHub can take it back [SAFE-01, ATT-14].
|
|
222
|
-
function onGitHub(key: string, label: string, work: () => Promise<unknown>, done: string, undo?: () => Promise<unknown>) {
|
|
216
|
+
// A change from one tap, without confirming: Undo instead, where it can be taken back [SAFE-01, ATT-08, ATT-14].
|
|
217
|
+
// The server answers each with the list after it, so nothing needs a refresh.
|
|
218
|
+
function change(key: string, label: string, work: () => Promise<AttentionView>, done: string, undo?: () => Promise<AttentionView>, dismissal?: boolean) {
|
|
223
219
|
void run(key, label, async () => {
|
|
224
|
-
await work();
|
|
225
|
-
if (undo)
|
|
226
|
-
|
|
227
|
-
|
|
220
|
+
attention.setView(await work());
|
|
221
|
+
if (!undo) return toast.show(done, { variant: "success" });
|
|
222
|
+
const id = Date.now() + Math.random();
|
|
223
|
+
setUndoable((rows) => [...rows, { id, text: done, undo: async () => attention.setView(await undo()), dismissal }]);
|
|
228
224
|
});
|
|
229
225
|
}
|
|
230
226
|
|
|
@@ -238,10 +234,8 @@ function AttentionList({ navigation, openSettings }: Pick<PluginScreenProps, "na
|
|
|
238
234
|
openAgent(agentId);
|
|
239
235
|
}
|
|
240
236
|
|
|
241
|
-
// One tap:
|
|
237
|
+
// One tap: start a session with defaults [SES-01]. An open one is offered first, by the card [SES-03].
|
|
242
238
|
async function startWithDefaults(itemKey: string, kind: SessionKind, target: Target, before?: () => Promise<unknown>) {
|
|
243
|
-
const existing = (view?.fixtureAgents ?? agents.data)?.[itemKey];
|
|
244
|
-
if (existing) return openAgent(existing.id);
|
|
245
239
|
if (!view) return;
|
|
246
240
|
await run(itemKey, "Starting the session", () => startNow(itemKey, kind, target, view.config, before));
|
|
247
241
|
}
|
|
@@ -284,13 +278,14 @@ function AttentionList({ navigation, openSettings }: Pick<PluginScreenProps, "na
|
|
|
284
278
|
if (!view) {
|
|
285
279
|
return (
|
|
286
280
|
<View style={[styles.screen, styles.content]}>
|
|
287
|
-
|
|
281
|
+
{attention.error ? <Text style={styles.danger}>Couldn't load Attention Span: {(attention.error as Error).message}</Text> : <Loading text="Loadingβ¦" />}
|
|
288
282
|
</View>
|
|
289
283
|
);
|
|
290
284
|
}
|
|
291
285
|
|
|
292
286
|
// Each tab shows how fresh its own feed is.
|
|
293
287
|
const feed = view.feeds[TAB_FEED[tab]];
|
|
288
|
+
const refreshing = feed.refreshing || attention.isFetching;
|
|
294
289
|
const tooLong = view.doing.find((section) => section.id === "too_long")?.items.length ?? 0;
|
|
295
290
|
const counts: Record<TabId, number> = {
|
|
296
291
|
history: view.history.filter((item) => item.section === "done").length,
|
|
@@ -298,14 +293,13 @@ function AttentionList({ navigation, openSettings }: Pick<PluginScreenProps, "na
|
|
|
298
293
|
waiting: view.waiting.reduce((sum, section) => sum + section.items.length, 0),
|
|
299
294
|
next: view.assigned.length + view.unclaimed.length,
|
|
300
295
|
};
|
|
301
|
-
// The repo is worth showing only when the list spans several.
|
|
302
|
-
const repos = new Set([...view.doing, ...view.waiting].flatMap((section) => section.items.map((item) => item.repo)));
|
|
303
296
|
|
|
304
297
|
const actions: Actions = {
|
|
305
|
-
agents: view.fixtureAgents ?? agents.data ??
|
|
298
|
+
agents: view.fixtureAgents ?? agents.data ?? [],
|
|
299
|
+
startWithOptions: setOptions,
|
|
306
300
|
busy,
|
|
307
301
|
config: view.config,
|
|
308
|
-
|
|
302
|
+
login: view.login,
|
|
309
303
|
fetchContext,
|
|
310
304
|
fetchDetails,
|
|
311
305
|
defaultBranch,
|
|
@@ -316,38 +310,26 @@ function AttentionList({ navigation, openSettings }: Pick<PluginScreenProps, "na
|
|
|
316
310
|
const { target } = item;
|
|
317
311
|
if (action === "reply") return void openExternalUrl(item.person?.url ?? item.url);
|
|
318
312
|
if (session) return void startWithDefaults(item.key, session, target);
|
|
319
|
-
if (action === "update")
|
|
320
|
-
void run(item.key, "Update", async () => {
|
|
321
|
-
await update({ target });
|
|
322
|
-
toast.show(`Updating PR ${target.number} with ${target.baseRefName}`, { variant: "success" });
|
|
323
|
-
});
|
|
313
|
+
if (action === "update") change(item.key, "Update", () => update({ key: item.key, target }), `Updating PR ${target.number} with ${target.baseRefName}`);
|
|
324
314
|
// [PRS-11]
|
|
325
315
|
if (action === "ready")
|
|
326
|
-
|
|
316
|
+
change(item.key, "Ready for review", () => setReady({ key: item.key, target, ready: true }), `PR ${target.number} is ready for review`, () => setReady({ key: item.key, target, ready: false }));
|
|
327
317
|
// [PRS-10]
|
|
328
318
|
if (action === "automerge")
|
|
329
|
-
|
|
319
|
+
change(item.key, "Auto-merge", () => setAutoMerge({ key: item.key, target, on: true }), `PR ${target.number} merges once checks pass`, () => setAutoMerge({ key: item.key, target, on: false }));
|
|
330
320
|
},
|
|
331
321
|
// [PRS-09]
|
|
332
|
-
rerun: (item, runIds) =>
|
|
333
|
-
onGitHub(item.key, "Rerun", () => rerunFailed({ repo: item.target.repo, runIds }), `Rerunning the failed jobs of PR ${item.target.number}`),
|
|
322
|
+
rerun: (item, runIds) => change(item.key, "Rerun", () => rerunFailed({ key: item.key, repo: item.target.repo, runIds }), `Rerunning the failed jobs of PR ${item.target.number}`),
|
|
334
323
|
// [MEN-07]
|
|
335
324
|
acknowledge: (item, ids) =>
|
|
336
|
-
|
|
337
|
-
react({ subjectIds: ids, on: false }),
|
|
325
|
+
change(item.key, "Acknowledge", () => react({ key: item.key, subjectIds: ids, on: true }), `Acknowledged ${ids.length === 1 ? "a comment" : `${ids.length} comments`} on #${item.number}`, () =>
|
|
326
|
+
react({ key: item.key, subjectIds: ids, on: false }),
|
|
338
327
|
),
|
|
339
328
|
confirm: (item, action, comment) =>
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
await attention.refreshNow("live");
|
|
345
|
-
}),
|
|
346
|
-
dismiss: (item) =>
|
|
347
|
-
void run(item.key, "Dismiss", async () => {
|
|
348
|
-
attention.setView(await dismiss({ key: item.key }));
|
|
349
|
-
offerUndo(`Dismissed β${item.title}β`, async () => attention.setView(await undismiss({ key: item.key })), true);
|
|
350
|
-
}),
|
|
329
|
+
action === "merge"
|
|
330
|
+
? change(item.key, "Merge", () => merge({ key: item.key, target: item.target }), `PR ${item.target.number} merged`)
|
|
331
|
+
: change(item.key, "Close", () => close({ key: item.key, target: item.target, comment }), `PR ${item.target.number} closed`),
|
|
332
|
+
dismiss: (item) => change(item.key, "Dismiss", () => dismiss({ key: item.key }), `Dismissed β${item.title}β`, () => undismiss({ key: item.key }), true),
|
|
351
333
|
};
|
|
352
334
|
|
|
353
335
|
const switchTab = (id: TabId) => {
|
|
@@ -364,9 +346,15 @@ function AttentionList({ navigation, openSettings }: Pick<PluginScreenProps, "na
|
|
|
364
346
|
))}
|
|
365
347
|
</View>
|
|
366
348
|
<View style={[styles.row, { gap: 16 }]}>
|
|
367
|
-
<Pressable
|
|
368
|
-
|
|
369
|
-
|
|
349
|
+
<Pressable
|
|
350
|
+
accessibilityRole="button"
|
|
351
|
+
accessibilityLabel="Refresh now"
|
|
352
|
+
accessibilityState={{ busy: refreshing }}
|
|
353
|
+
style={styles.row}
|
|
354
|
+
onPress={() => void attention.refreshNow(TAB_FEED[tab]).catch(() => {})}
|
|
355
|
+
>
|
|
356
|
+
<SpinningIcon name="update" size={14} spinning={refreshing} />
|
|
357
|
+
<Text style={styles.muted}>{feed.fetchedAt ? `${ago(feed.fetchedAt)} ago` : "never"}</Text>
|
|
370
358
|
</Pressable>
|
|
371
359
|
{openSettings ? (
|
|
372
360
|
<Pressable accessibilityRole="button" accessibilityLabel="Attention Span settings" onPress={openSettings} hitSlop={8}>
|
|
@@ -389,7 +377,6 @@ function AttentionList({ navigation, openSettings }: Pick<PluginScreenProps, "na
|
|
|
389
377
|
void run(String(row.id), "Undo", async () => {
|
|
390
378
|
await row.undo();
|
|
391
379
|
setUndoable((rows) => rows.filter((other) => other.id !== row.id));
|
|
392
|
-
if (!row.dismissal) void attention.refreshNow("live").catch(() => {});
|
|
393
380
|
})
|
|
394
381
|
}
|
|
395
382
|
/>
|
|
@@ -426,22 +413,40 @@ function AttentionList({ navigation, openSettings }: Pick<PluginScreenProps, "na
|
|
|
426
413
|
attention.setView({ ...view, scopes });
|
|
427
414
|
saveScopes({ scopes }).catch((error) => toast.error(`Saving the filter failed: ${(error as Error).message}`));
|
|
428
415
|
}}
|
|
416
|
+
sources={nextUpSources(view.config)}
|
|
417
|
+
selectedSources={view.sources}
|
|
418
|
+
onSelectSources={(sources) => {
|
|
419
|
+
attention.setView({ ...view, sources });
|
|
420
|
+
saveSources({ sources }).catch((error) => toast.error(`Saving the filter failed: ${(error as Error).message}`));
|
|
421
|
+
}}
|
|
429
422
|
agents={actions.agents}
|
|
423
|
+
login={view.login}
|
|
430
424
|
busy={busy}
|
|
431
425
|
fetchDetails={fetchDetails}
|
|
432
426
|
onOpenAgent={openAgent}
|
|
433
427
|
onStart={(issue, claimFirst) => {
|
|
434
428
|
const target = issueTarget(issue);
|
|
435
|
-
void startWithDefaults(issue.key, "start", target, claimFirst ? () => claim({ target }) : undefined);
|
|
429
|
+
void startWithDefaults(issue.key, "start", target, claimFirst ? async () => attention.setView(await claim({ key: issue.key, target })) : undefined);
|
|
430
|
+
}}
|
|
431
|
+
onOptions={(issue, claimFirst, label) => {
|
|
432
|
+
const target = issueTarget(issue);
|
|
433
|
+
setOptions({ itemKey: issue.key, title: `${label}: ${issue.title}`, kind: "start", target, before: claimFirst ? async () => attention.setView(await claim({ key: issue.key, target })) : undefined });
|
|
436
434
|
}}
|
|
437
435
|
// Claim without starting, or give it back; each undoes the other [NXT-07].
|
|
438
436
|
onClaim={(issue, on) => {
|
|
439
437
|
const target = issueTarget(issue);
|
|
440
|
-
const [take, giveBack] = [() => claim({ target }), () => unclaim({ target })];
|
|
441
|
-
|
|
438
|
+
const [take, giveBack] = [() => claim({ key: issue.key, target }), () => unclaim({ key: issue.key, target })];
|
|
439
|
+
change(issue.key, on ? "Claim" : "Unclaim", on ? take : giveBack, `${on ? "Claimed" : "Unclaimed"} #${issue.number}`, on ? giveBack : take);
|
|
440
|
+
}}
|
|
441
|
+
// Undo reopens; a comment already posted stays [NXT-11].
|
|
442
|
+
onCloseIssue={(issue, reason, comment) => {
|
|
443
|
+
const target = issueTarget(issue);
|
|
444
|
+
const done = `Closed #${issue.number} as ${reason === "completed" ? "completed" : "not planned"}`;
|
|
445
|
+
change(issue.key, "Close", () => closeIssue({ key: issue.key, target, reason, comment: comment || undefined }), done, () => reopenIssue({ key: issue.key, target }));
|
|
442
446
|
}}
|
|
443
447
|
/>
|
|
444
448
|
) : null}
|
|
449
|
+
{options ? <SessionOptions spec={options} actions={actions} onClose={() => setOptions(null)} /> : null}
|
|
445
450
|
{placing ? <CodeRepoPicker issueRepo={placing.target.repo} missing={placing.missing} onPick={place} onClose={() => setPlacing(null)} /> : null}
|
|
446
451
|
</ScrollView>
|
|
447
452
|
);
|
|
@@ -467,10 +472,11 @@ function Tab({ icon, label, count, active, onPress }: { icon: IconName; label: s
|
|
|
467
472
|
}
|
|
468
473
|
|
|
469
474
|
interface Actions {
|
|
470
|
-
agents:
|
|
471
|
-
|
|
475
|
+
agents: AgentSummary[];
|
|
476
|
+
startWithOptions: (spec: OptionsSpec) => void;
|
|
477
|
+
busy: ReadonlySet<string>;
|
|
472
478
|
config: AttentionConfig;
|
|
473
|
-
|
|
479
|
+
login: string | null;
|
|
474
480
|
fetchContext: FetchContext;
|
|
475
481
|
fetchDetails: FetchDetails;
|
|
476
482
|
defaultBranch: DefaultBranch;
|
|
@@ -483,31 +489,32 @@ interface Actions {
|
|
|
483
489
|
started: (agentId: string) => Promise<void>;
|
|
484
490
|
}
|
|
485
491
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
if (item.kind === "
|
|
489
|
-
|
|
492
|
+
// What the card is: open, draft, merged or closed. Urgency stays in the chips and section headers.
|
|
493
|
+
function stateMark(item: Item): CardProps["mark"] {
|
|
494
|
+
if (item.closedAt) return item.kind === "pr" ? { icon: "merge", tone: "good" } : { icon: "issueClosed", tone: item.chips.length ? "neutral" : "good" };
|
|
495
|
+
if (item.kind === "issue") return { icon: "issue", tone: "good" };
|
|
496
|
+
return item.draft ? { icon: "draft", tone: "neutral" } : { icon: "pr", tone: "good" };
|
|
490
497
|
}
|
|
491
498
|
|
|
492
499
|
// A card that works collapsed: its main action and β―. Tapping it opens the sheet with everything else [ATT-05, ATT-06].
|
|
493
500
|
const isRed = (chips: Chip[]) => chips.some((chip) => chip.tone === "bad");
|
|
494
501
|
|
|
495
|
-
|
|
502
|
+
// The sheet, Acknowledge, or a split button's menu: for the open sessions, or for starting one of `kind`.
|
|
503
|
+
type Sheet = "item" | "acknowledge" | { anchor?: Anchor; kind?: SessionKind } | null;
|
|
504
|
+
|
|
505
|
+
// A session on an item that has no session action of its own starts with this prompt; it's editable first.
|
|
506
|
+
const fallbackKind = (item: Item): SessionKind => (item.target.kind === "issue" ? "start" : "review");
|
|
496
507
|
|
|
497
508
|
function ItemRow({ item, first, actions }: { item: Item; first: boolean; actions: Actions }) {
|
|
498
|
-
|
|
499
|
-
const
|
|
500
|
-
const chips =
|
|
509
|
+
// An open session leads; without one, the item's own action does [SES-03].
|
|
510
|
+
const sessions = itemSessions(actions.agents, item);
|
|
511
|
+
const chips = sessions[0] ? [...item.chips, agentSignal(sessions[0])] : item.chips;
|
|
501
512
|
const [sheet, setSheet] = useState<Sheet>(null);
|
|
502
513
|
const [confirm, setConfirm] = useState<"merge" | "close" | null>(null);
|
|
503
|
-
const [comment, setComment] = useState("");
|
|
504
|
-
const sessionAction = item.actions.find((action) => ACTION_SESSION[action]);
|
|
505
|
-
const sessionKind = sessionAction ? ACTION_SESSION[sessionAction] : undefined;
|
|
506
514
|
const main = item.actions[0];
|
|
507
|
-
const
|
|
515
|
+
const mainKind = main ? ACTION_SESSION[main] : undefined;
|
|
508
516
|
// The full stack is in the sheet; the card shows the PRs that need attention [ATT-04].
|
|
509
517
|
const children = item.children.filter((child) => child.attention || isRed(child.chips));
|
|
510
|
-
const icon = stateIcon(item, styles.c);
|
|
511
518
|
const open = () => setSheet("item");
|
|
512
519
|
const copy = useCopy();
|
|
513
520
|
const history = item.section === "done" || item.section === "reviewed";
|
|
@@ -518,82 +525,122 @@ function ItemRow({ item, first, actions }: { item: Item; first: boolean; actions
|
|
|
518
525
|
else if (action === "acknowledge") setSheet("acknowledge");
|
|
519
526
|
else actions.act(item, action);
|
|
520
527
|
}
|
|
521
|
-
const
|
|
528
|
+
const onMenu = (kind?: SessionKind) => (anchor: Anchor | undefined) => setSheet({ anchor, kind });
|
|
529
|
+
const handlers: SheetHandlers = { onPerform: perform, onMenu, onClose: () => setSheet(null) };
|
|
522
530
|
// A menu with one action is a wasted tap: show that action instead of β―. The card still opens the sheet [ATT-06].
|
|
523
|
-
const entries = sheetEntries(item,
|
|
531
|
+
const entries = sheetEntries(item, sessions, actions, handlers);
|
|
524
532
|
const only = entries.length === 1 ? entries[0] : undefined;
|
|
525
|
-
|
|
526
|
-
const
|
|
527
|
-
<View style={styles.wrap}>
|
|
528
|
-
{actions.busy === item.key ? (
|
|
529
|
-
<Text style={styles.muted}>workingβ¦</Text>
|
|
530
|
-
) : agent && sessionKind ? (
|
|
531
|
-
<Button label={CONTINUE_LABELS[sessionKind]} icon="agent" variant="calm" onPress={() => actions.openAgent(agent.id)} />
|
|
532
|
-
) : main ? (
|
|
533
|
-
<Button label={actionLabel(main, item)} icon={ACTION_ICONS[main]} variant="calm" onPress={() => perform(main)} />
|
|
534
|
-
) : null}
|
|
535
|
-
{only ? (
|
|
536
|
-
<Button icon={only.icon} variant="ghost" accessibilityLabel={only.label} onPress={only.onPress} />
|
|
537
|
-
) : (
|
|
538
|
-
<Button icon="dots" variant="ghost" accessibilityLabel="More actions" onPress={open} />
|
|
539
|
-
)}
|
|
540
|
-
{/* History is where I report from, so its cards copy their link in one tap [ATT-15]. */}
|
|
541
|
-
{history ? <Button icon="copy" variant="ghost" accessibilityLabel={`Copy link to #${item.number}`} onPress={() => copy(item.url, `Copied link to #${item.number}`)} /> : null}
|
|
542
|
-
</View>
|
|
543
|
-
);
|
|
533
|
+
const confirmed = (action: "merge" | "close") => (comment: string) => (setConfirm(null), actions.confirm(item, action, comment));
|
|
534
|
+
const sessionMenu = { label: "Session choices", onPress: onMenu() };
|
|
544
535
|
|
|
545
536
|
return (
|
|
546
|
-
<
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
537
|
+
<CardRow
|
|
538
|
+
first={first}
|
|
539
|
+
mark={stateMark(item)}
|
|
540
|
+
title={item.title}
|
|
541
|
+
meta={{
|
|
542
|
+
place: `${repoLabel(item.repo, actions.login)} #${item.number}`,
|
|
543
|
+
when: item.closedAt ? `${item.kind === "pr" ? "merged" : "closed"} ${ago(item.closedAt)} ago` : undefined,
|
|
544
|
+
signals: chips,
|
|
545
|
+
}}
|
|
546
|
+
extra={
|
|
547
|
+
item.person || children.length > 0 ? (
|
|
548
|
+
<>
|
|
557
549
|
{item.person ? <PersonQuote person={item.person} expanded={false} /> : null}
|
|
558
550
|
{children.length > 0 ? <StackLine rows={children} merged={!!item.closedAt} /> : null}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
551
|
+
</>
|
|
552
|
+
) : null
|
|
553
|
+
}
|
|
554
|
+
onOpen={open}
|
|
555
|
+
busy={actions.busy.has(item.key)}
|
|
556
|
+
primary={
|
|
557
|
+
sessions[0]
|
|
558
|
+
? { label: "Open session", icon: "agent", onPress: () => actions.openAgent(sessions[0].id), menu: sessionMenu }
|
|
559
|
+
: main
|
|
560
|
+
? {
|
|
561
|
+
label: actionLabel(main, item),
|
|
562
|
+
icon: ACTION_ICONS[main],
|
|
563
|
+
onPress: () => perform(main),
|
|
564
|
+
menu: mainKind ? { label: `${actionLabel(main, item)} choices`, onPress: onMenu(mainKind) } : undefined,
|
|
565
|
+
}
|
|
566
|
+
: undefined
|
|
567
|
+
}
|
|
568
|
+
secondary={[
|
|
569
|
+
only ? { label: only.label, icon: only.icon, onPress: only.onPress } : { label: "More actions", icon: "dots", onPress: open },
|
|
570
|
+
// History is where I report from, so its cards copy their link in one tap [ATT-15].
|
|
571
|
+
...(history ? [{ label: `Copy link to #${item.number}`, icon: "copy" as const, onPress: () => copy(item.url, `Copied link to #${item.number}`) }] : []),
|
|
572
|
+
]}
|
|
573
|
+
confirm={
|
|
574
|
+
confirm === "merge"
|
|
575
|
+
? {
|
|
576
|
+
text: `Merge PR ${item.target.number} into ${item.target.baseRefName} (${item.target.mergeMethod})?`,
|
|
577
|
+
choices: [{ label: "Merge", icon: "merge", solid: true, onConfirm: confirmed("merge") }],
|
|
578
|
+
onCancel: () => setConfirm(null),
|
|
579
|
+
}
|
|
580
|
+
: confirm === "close"
|
|
581
|
+
? {
|
|
582
|
+
text: `Close PR ${item.target.number}? A comment is only posted if you write one.`,
|
|
583
|
+
comment: true,
|
|
584
|
+
choices: [{ label: "Close PR", icon: "close", solid: true, onConfirm: confirmed("close") }],
|
|
585
|
+
onCancel: () => setConfirm(null),
|
|
586
|
+
}
|
|
587
|
+
: null
|
|
588
|
+
}
|
|
589
|
+
overlay={
|
|
590
|
+
<>
|
|
591
|
+
{sheet === "item" ? <ItemSheet item={item} sessions={sessions} actions={actions} {...handlers} /> : null}
|
|
592
|
+
{sheet === "acknowledge" ? <AcknowledgeSheet item={item} onReact={(ids) => (setSheet(null), actions.acknowledge(item, ids))} onClose={() => setSheet(null)} /> : null}
|
|
593
|
+
{sheet && typeof sheet === "object" ? (
|
|
594
|
+
<MenuSheet title={item.title} anchor={sheet.anchor} groups={menuGroups(item, sessions, sheet.kind, actions, perform, () => setSheet(null))} onClose={() => setSheet(null)} />
|
|
576
595
|
) : null}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
{sheet === "item" ? (
|
|
581
|
-
<ItemSheet item={item} agent={agent} actions={actions} {...handlers} />
|
|
582
|
-
) : null}
|
|
583
|
-
{sheet === "acknowledge" ? <AcknowledgeSheet item={item} onReact={(ids) => (setSheet(null), actions.acknowledge(item, ids))} onClose={() => setSheet(null)} /> : null}
|
|
584
|
-
{sheet && typeof sheet === "object" ? <SessionOptions item={item} kind={sheet.options} actions={actions} onClose={() => setSheet(null)} /> : null}
|
|
585
|
-
</View>
|
|
596
|
+
</>
|
|
597
|
+
}
|
|
598
|
+
/>
|
|
586
599
|
);
|
|
587
600
|
}
|
|
588
601
|
|
|
602
|
+
// A split button's menu. With sessions open: each of them, then starting a new one. Without: the action with options [SES-02, SES-03].
|
|
603
|
+
function menuGroups(
|
|
604
|
+
item: Item,
|
|
605
|
+
sessions: AgentSummary[],
|
|
606
|
+
kind: SessionKind | undefined,
|
|
607
|
+
actions: Actions,
|
|
608
|
+
perform: (action: ActionId) => void,
|
|
609
|
+
close: () => void,
|
|
610
|
+
): MenuGroup[] {
|
|
611
|
+
const withOptions = (action: ActionId | undefined, sessionKind: SessionKind): SheetEntry => {
|
|
612
|
+
const label = action ? actionLabel(action, item) : "Start session";
|
|
613
|
+
return {
|
|
614
|
+
key: `${action ?? "start"}-options`,
|
|
615
|
+
icon: "agent",
|
|
616
|
+
label: `${label} with optionsβ¦`,
|
|
617
|
+
detail: "Choose the workspace, agent profile and prompt first",
|
|
618
|
+
onPress: () => (close(), actions.startWithOptions({ itemKey: item.key, title: `${label}: ${item.title}`, kind: sessionKind, target: item.target })),
|
|
619
|
+
};
|
|
620
|
+
};
|
|
621
|
+
const sessionActions = item.actions.filter((action) => ACTION_SESSION[action]);
|
|
622
|
+
if (sessions.length === 0) {
|
|
623
|
+
const action = sessionActions.find((candidate) => ACTION_SESSION[candidate] === kind);
|
|
624
|
+
return [{ entries: [withOptions(action, kind ?? fallbackKind(item))] }];
|
|
625
|
+
}
|
|
626
|
+
const start = sessionActions.flatMap((action): SheetEntry[] => [
|
|
627
|
+
{ key: action, icon: "agent", label: actionLabel(action, item), detail: actionDetail(action as Exclude<ActionId, "rerun">, item), onPress: () => perform(action) },
|
|
628
|
+
withOptions(action, ACTION_SESSION[action]!),
|
|
629
|
+
]);
|
|
630
|
+
return [
|
|
631
|
+
sessionsGroup(sessions, (agentId) => (close(), actions.openAgent(agentId))),
|
|
632
|
+
{ title: "Start a new one", entries: start.length ? start : [withOptions(undefined, fallbackKind(item))] },
|
|
633
|
+
];
|
|
634
|
+
}
|
|
635
|
+
|
|
589
636
|
interface SheetHandlers {
|
|
590
637
|
onPerform: (action: ActionId) => void;
|
|
591
|
-
|
|
638
|
+
onMenu: (kind?: SessionKind) => (anchor: Anchor | undefined) => void;
|
|
592
639
|
onClose: () => void;
|
|
593
640
|
}
|
|
594
641
|
|
|
595
642
|
// What the card already knows on top, then every action, then what's fetched when it opens, so nothing jumps as it loads [ATT-06, GH-01].
|
|
596
|
-
function ItemSheet({ item,
|
|
643
|
+
function ItemSheet({ item, sessions, actions, ...handlers }: { item: Item; sessions: AgentSummary[]; actions: Actions } & SheetHandlers) {
|
|
597
644
|
const checks = item.actions.includes("rerun");
|
|
598
645
|
const details = useQuery({
|
|
599
646
|
queryKey: ["attention-span", "details", item.key, checks],
|
|
@@ -615,7 +662,7 @@ function ItemSheet({ item, agent, actions, ...handlers }: { item: Item; agent?:
|
|
|
615
662
|
{item.children.length > 0 ? <StackLine rows={item.children} merged={!!item.closedAt} links /> : null}
|
|
616
663
|
</>
|
|
617
664
|
}
|
|
618
|
-
entries={sheetEntries(item,
|
|
665
|
+
entries={sheetEntries(item, sessions, actions, handlers, details)}
|
|
619
666
|
bottom={<DetailLines details={extra} loading={details.isLoading} error={details.error} linkedLabel={item.kind === "issue" ? "PR" : "Closes"} />}
|
|
620
667
|
/>
|
|
621
668
|
);
|
|
@@ -624,26 +671,31 @@ function ItemSheet({ item, agent, actions, ...handlers }: { item: Item; agent?:
|
|
|
624
671
|
// Everything an item's sheet offers, each saying what it will do [ATT-06]. Rerun's line needs the fetched checks.
|
|
625
672
|
function sheetEntries(
|
|
626
673
|
item: Item,
|
|
627
|
-
|
|
674
|
+
sessions: AgentSummary[],
|
|
628
675
|
actions: Actions,
|
|
629
|
-
{ onPerform,
|
|
676
|
+
{ onPerform, onMenu, onClose }: SheetHandlers,
|
|
630
677
|
details?: { data?: { failing: FailingChecks[] }; isLoading: boolean },
|
|
631
678
|
): SheetEntry[] {
|
|
632
679
|
const inDoing = !item.section.startsWith("wait_") && item.section !== "done" && item.section !== "reviewed";
|
|
633
680
|
const close = (then: () => void) => () => (onClose(), then());
|
|
634
681
|
|
|
635
|
-
|
|
636
|
-
|
|
682
|
+
// An open session first; starting another is in its menu [SES-03].
|
|
683
|
+
const entries: SheetEntry[] = sessions.length
|
|
684
|
+
? [openSessionEntry(sessions, (agentId) => close(() => actions.openAgent(agentId))(), { label: "Session choices", onPress: onMenu() })]
|
|
685
|
+
: [];
|
|
637
686
|
for (const action of item.actions) {
|
|
638
687
|
const kind = ACTION_SESSION[action];
|
|
639
688
|
const label = actionLabel(action, item);
|
|
640
|
-
if (kind &&
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
689
|
+
if (kind && sessions.length) continue;
|
|
690
|
+
else if (kind) {
|
|
691
|
+
entries.push({
|
|
692
|
+
key: action,
|
|
693
|
+
icon: "agent",
|
|
694
|
+
label,
|
|
695
|
+
detail: actionDetail(action as Exclude<ActionId, "rerun">, item),
|
|
696
|
+
onPress: () => onPerform(action),
|
|
697
|
+
menu: { label: `${label} choices`, onPress: onMenu(kind) },
|
|
698
|
+
});
|
|
647
699
|
} else if (action === "rerun") {
|
|
648
700
|
const { detail, runIds } = rerunEntry(details?.data?.failing, details?.isLoading ?? true);
|
|
649
701
|
entries.push({ key: action, icon: ACTION_ICONS.rerun, label, detail, disabled: runIds.length === 0, onPress: close(() => actions.rerun(item, runIds)) });
|
|
@@ -674,7 +726,10 @@ function AcknowledgeSheet({ item, onReact, onClose }: { item: Item; onReact: (id
|
|
|
674
726
|
<Modal title={`Acknowledge: ${item.title}`} open onOpenChange={(open) => (open ? null : onClose())}>
|
|
675
727
|
<Modal.Content>
|
|
676
728
|
<KeepStyles styles={styles}>
|
|
677
|
-
<
|
|
729
|
+
<View style={styles.row}>
|
|
730
|
+
<TablerIcon name="thumbUp" size={14} />
|
|
731
|
+
<Text style={[styles.muted, { flexShrink: 1 }]}>Tells them you've seen it, and clears it from your list.</Text>
|
|
732
|
+
</View>
|
|
678
733
|
{comments.map((c) => (
|
|
679
734
|
<Pressable
|
|
680
735
|
key={c.id}
|
|
@@ -695,7 +750,9 @@ function AcknowledgeSheet({ item, onReact, onClose }: { item: Item; onReact: (id
|
|
|
695
750
|
))}
|
|
696
751
|
<View style={styles.wrap}>
|
|
697
752
|
<Button
|
|
698
|
-
label={
|
|
753
|
+
label={`${picked.size} comment${picked.size === 1 ? "" : "s"}`}
|
|
754
|
+
icon="thumbUp"
|
|
755
|
+
accessibilityLabel={`Acknowledge ${picked.size} comment${picked.size === 1 ? "" : "s"}`}
|
|
699
756
|
variant="solid"
|
|
700
757
|
disabled={picked.size === 0}
|
|
701
758
|
onPress={() => onReact(comments.filter((c) => picked.has(c.id)).map((c) => c.id))}
|
|
@@ -741,13 +798,12 @@ function Sections({ sections, actions, empty }: { sections: Section[]; actions:
|
|
|
741
798
|
}
|
|
742
799
|
|
|
743
800
|
function Card({ items, actions }: { items: Item[]; actions: Actions }) {
|
|
744
|
-
const styles = useStyles();
|
|
745
801
|
return (
|
|
746
|
-
<
|
|
802
|
+
<CardList>
|
|
747
803
|
{items.map((item, index) => (
|
|
748
804
|
<ItemRow key={item.key} item={item} first={index === 0} actions={actions} />
|
|
749
805
|
))}
|
|
750
|
-
</
|
|
806
|
+
</CardList>
|
|
751
807
|
);
|
|
752
808
|
}
|
|
753
809
|
|
|
@@ -827,7 +883,7 @@ function StackLine({ rows, merged, links = false }: { rows: SubRow[]; merged: bo
|
|
|
827
883
|
<StackRow key={row.key} url={row.url} number={row.number} link={links}>
|
|
828
884
|
<View style={{ width: 16, alignItems: "center" }}>
|
|
829
885
|
<View style={{ width: 2, flex: 1, backgroundColor: index === 0 ? "transparent" : styles.c.border }} />
|
|
830
|
-
<TablerIcon name={merged ? "merge" : row.draft ? "draft" : "pr"} size={14} color={merged ? styles.c.
|
|
886
|
+
<TablerIcon name={merged ? "merge" : row.draft ? "draft" : "pr"} size={14} color={merged ? styles.c.statusSuccess : row.draft ? styles.c.foregroundMuted : styles.c.statusSuccess} />
|
|
831
887
|
<View style={{ width: 2, flex: 1, backgroundColor: index === rows.length - 1 ? "transparent" : styles.c.border }} />
|
|
832
888
|
</View>
|
|
833
889
|
<View style={{ flex: 1, paddingVertical: 3, gap: 2 }}>
|
|
@@ -865,13 +921,13 @@ function StackRow({ url, number, link, children }: { url: string; number: number
|
|
|
865
921
|
}
|
|
866
922
|
|
|
867
923
|
// Session options in a modal: a bottom sheet on phones [SES-02].
|
|
868
|
-
function SessionOptions({
|
|
924
|
+
function SessionOptions({ spec, actions, onClose }: { spec: OptionsSpec; actions: Actions; onClose: () => void }) {
|
|
869
925
|
const styles = useStyles();
|
|
870
926
|
const paseo = usePaseo();
|
|
871
927
|
const toast = useToast();
|
|
872
|
-
const { target } =
|
|
928
|
+
const { itemKey, kind, target } = spec;
|
|
873
929
|
const options = useQuery({
|
|
874
|
-
queryKey: ["attention-span", "options",
|
|
930
|
+
queryKey: ["attention-span", "options", itemKey, kind],
|
|
875
931
|
queryFn: async () => {
|
|
876
932
|
const [{ context }, profiles, checkout, defaults] = await Promise.all([
|
|
877
933
|
actions.fetchContext({ kind, target }),
|
|
@@ -895,7 +951,8 @@ function SessionOptions({ item, kind, actions, onClose }: { item: Item; kind: Se
|
|
|
895
951
|
if (!data) return;
|
|
896
952
|
setStarting(true);
|
|
897
953
|
try {
|
|
898
|
-
await
|
|
954
|
+
await spec.before?.();
|
|
955
|
+
await actions.started(await startSession(paseo, { itemKey, kind, target, prompt: prompt ?? data.prompt, config: actions.config, checkout: data.checkout, profileId, workspaceId }));
|
|
899
956
|
onClose();
|
|
900
957
|
} catch (error) {
|
|
901
958
|
toast.error(`Starting the session failed: ${(error as Error).message}`);
|
|
@@ -905,10 +962,10 @@ function SessionOptions({ item, kind, actions, onClose }: { item: Item; kind: Se
|
|
|
905
962
|
}
|
|
906
963
|
|
|
907
964
|
return (
|
|
908
|
-
<Modal title={
|
|
965
|
+
<Modal title={spec.title} open onOpenChange={(open) => (open ? null : onClose())}>
|
|
909
966
|
<Modal.Content>
|
|
910
967
|
<KeepStyles styles={styles}>
|
|
911
|
-
{options.isLoading ? <
|
|
968
|
+
{options.isLoading ? <Loading text="Loading contextβ¦" /> : null}
|
|
912
969
|
{!options.isLoading && !data ? <Text style={styles.danger}>{(options.error as Error)?.message ?? "No options"}</Text> : null}
|
|
913
970
|
{data && !data.checkout.project ? <Text style={styles.danger}>{noProjectMessage(data.checkout, target)}</Text> : null}
|
|
914
971
|
{data?.checkout.project ? (
|
|
@@ -952,7 +1009,7 @@ function CodeRepoPicker({ issueRepo, missing, onPick, onClose }: { issueRepo: st
|
|
|
952
1009
|
<KeepStyles styles={styles}>
|
|
953
1010
|
<View style={{ gap: 10 }}>
|
|
954
1011
|
<Text style={styles.text}>No Paseo project has {missing} as its GitHub remote. Pick the project that holds the code for issues in {issueRepo}.</Text>
|
|
955
|
-
{projects.isLoading ? <
|
|
1012
|
+
{projects.isLoading ? <Loading text="Loading projectsβ¦" /> : null}
|
|
956
1013
|
{projects.data?.length === 0 ? <Text style={styles.danger}>No Paseo project has a GitHub remote. Add the code repository as a project first.</Text> : null}
|
|
957
1014
|
<View style={styles.wrap}>
|
|
958
1015
|
{projects.data?.map((project) => (
|