@andrioid/paseo-attention-span 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/OVERVIEW.md +3 -1
- package/client/attention-screen.tsx +61 -1174
- package/client/coverage-settings.tsx +5 -4
- package/client/data.ts +4 -2
- package/client/feedback.tsx +21 -25
- package/client/history.tsx +12 -50
- package/client/item-actions.ts +363 -0
- package/client/item-row.tsx +450 -0
- package/client/new-issue.tsx +244 -0
- package/client/next-up.tsx +22 -183
- package/client/pickers.tsx +237 -0
- package/client/session-menu.ts +3 -11
- package/client/sessions.ts +58 -57
- package/client/setup.tsx +2 -1
- package/client/sheet.tsx +92 -15
- package/client/ui.tsx +23 -14
- package/client/wrap-up.tsx +151 -85
- package/docs/architecture.md +22 -11
- package/docs/screenshots/desktop-dark-doing-acknowledge.png +0 -0
- package/docs/screenshots/desktop-dark-doing-clear.png +0 -0
- package/docs/screenshots/desktop-dark-doing-issue-sheet.png +0 -0
- package/docs/screenshots/desktop-dark-doing-reviewers.png +0 -0
- package/docs/screenshots/desktop-dark-doing-sheet.png +0 -0
- package/docs/screenshots/desktop-dark-doing-wrap-dirty.png +0 -0
- package/docs/screenshots/desktop-dark-doing-wrap-multi.png +0 -0
- package/docs/screenshots/desktop-dark-doing-wrap.png +0 -0
- package/docs/screenshots/desktop-dark-doing.png +0 -0
- package/docs/screenshots/desktop-dark-next-up-setup.png +0 -0
- package/docs/screenshots/desktop-dark-next-up.png +0 -0
- package/docs/screenshots/desktop-dark-settings.png +0 -0
- package/docs/screenshots/phone-dark-doing.png +0 -0
- package/docs/screenshots/phone-light-next-up-filtered.png +0 -0
- package/index.client.tsx +19 -0
- package/index.server.ts +43 -26
- package/package.json +2 -1
- package/requirements.yaml +8 -3
- package/server/actions.ts +2 -1
- package/server/archive.ts +146 -67
- package/server/archived.ts +12 -16
- package/server/changes.ts +34 -54
- package/server/classify.ts +142 -136
- package/server/feedback.ts +2 -6
- package/server/fetch.ts +262 -0
- package/server/fixture.ts +83 -14
- package/server/github-types.ts +3 -1
- package/server/markdown.ts +3 -1
- package/server/port.ts +46 -0
- package/server/queries.ts +33 -23
- package/server/service.ts +155 -272
- package/server/setup.ts +15 -14
- package/server/store.ts +94 -80
- package/server/update.ts +34 -13
- package/server/view.ts +16 -15
- package/shared/archive.ts +116 -13
- package/shared/attention.ts +50 -18
- package/shared/changes.ts +2 -1
- package/shared/config.ts +2 -6
- package/shared/drafting.ts +17 -0
- package/shared/feedback.ts +6 -5
- package/shared/format.ts +2 -1
- package/shared/history-report.ts +2 -1
- package/shared/item-sessions.ts +76 -0
- package/shared/item-view.ts +223 -0
- package/shared/linked-sessions.ts +59 -8
- package/shared/names.ts +17 -0
- package/shared/new-issue.ts +129 -0
- package/shared/next-up-filter.ts +137 -0
- package/shared/paging.ts +16 -0
- package/shared/rpc.ts +23 -10
- package/shared/setup.ts +3 -1
- package/shared/wrap-up.ts +20 -23
package/client/wrap-up.tsx
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
2
|
import { Text, View } from "react-native";
|
|
3
3
|
import type { AgentSummary, WrapItem } from "../shared/attention";
|
|
4
|
-
import type
|
|
4
|
+
import { type ArchiveOutcome, type KeptRow, keptText, sheetLines, type UnsavedSession, unsavedWords } from "../shared/archive";
|
|
5
5
|
import { allWrapBusy, wrapBusy } from "../shared/got-it";
|
|
6
|
-
import { cleanSingle, sessionCleanliness,
|
|
6
|
+
import { cleanSingle, sessionCleanliness, sessionUnsaved } from "../shared/wrap-up";
|
|
7
7
|
import { CardList, CardRow } from "./card";
|
|
8
8
|
import { stateMark } from "./mark";
|
|
9
|
-
import {
|
|
10
|
-
import { Button,
|
|
9
|
+
import { Dialog } from "./sheet";
|
|
10
|
+
import { Button, SectionHeader, TablerIcon, useStyles } from "./ui";
|
|
11
11
|
|
|
12
12
|
// Doing's Wrap up: finished or out-of-my-hands work whose sessions are still open, and archiving them [ATT-22]. The screen
|
|
13
|
-
// assembles the rows and runs the archive; these draw them and ask before archiving anything unsaved
|
|
13
|
+
// assembles the rows and runs the archive; these draw them and ask before archiving anything unsaved or closing a terminal,
|
|
14
|
+
// in a sheet shaped like Paseo's own. A worktree that stayed lingers as a row saying why.
|
|
14
15
|
|
|
15
16
|
interface RowProps {
|
|
16
17
|
busy: ReadonlySet<string>;
|
|
@@ -18,11 +19,17 @@ interface RowProps {
|
|
|
18
19
|
// Previews have made-up sessions: their snapshot is the answer, as there's no daemon to ask.
|
|
19
20
|
fixture: boolean;
|
|
20
21
|
openAgent: (agentId: string) => void;
|
|
21
|
-
onArchive: (item: WrapItem, confirm: boolean) => Promise<ArchiveOutcome | null>;
|
|
22
|
+
onArchive: (item: WrapItem, confirm: boolean, terminals?: string[]) => Promise<ArchiveOutcome | null>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface KeptProps {
|
|
26
|
+
kept: KeptRow[];
|
|
27
|
+
onArchiveWorktree: (row: KeptRow, confirm: boolean, terminals?: string[]) => Promise<ArchiveOutcome | null>;
|
|
28
|
+
onDismissKept: (row: KeptRow) => void;
|
|
22
29
|
}
|
|
23
30
|
|
|
24
31
|
// Finished or out-of-my-hands work whose Paseo sessions are all idle: the cleanup Doing owns [ATT-22].
|
|
25
|
-
export function WrapUp({ items, onArchiveAll, ...row }: { items: WrapItem[]; onArchiveAll: () => Promise<void> } & RowProps) {
|
|
32
|
+
export function WrapUp({ items, onArchiveAll, kept, onArchiveWorktree, onDismissKept, ...row }: { items: WrapItem[]; onArchiveAll: () => Promise<void> } & RowProps & KeptProps) {
|
|
26
33
|
const styles = useStyles();
|
|
27
34
|
const clean = items.filter(cleanSingle);
|
|
28
35
|
return (
|
|
@@ -49,6 +56,18 @@ export function WrapUp({ items, onArchiveAll, ...row }: { items: WrapItem[]; onA
|
|
|
49
56
|
{items.map((item, index) => (
|
|
50
57
|
<WrapRow key={item.key} item={item} first={index === 0} {...row} />
|
|
51
58
|
))}
|
|
59
|
+
{kept.map((keptRow, index) => (
|
|
60
|
+
<KeptWorktreeRow
|
|
61
|
+
key={keptRow.workspaceId}
|
|
62
|
+
row={keptRow}
|
|
63
|
+
first={items.length === 0 && index === 0}
|
|
64
|
+
busy={row.busy.has(`kept:${keptRow.workspaceId}`)}
|
|
65
|
+
login={row.login}
|
|
66
|
+
openSession={row.openAgent}
|
|
67
|
+
onArchive={onArchiveWorktree}
|
|
68
|
+
onDismiss={onDismissKept}
|
|
69
|
+
/>
|
|
70
|
+
))}
|
|
52
71
|
</CardList>
|
|
53
72
|
</View>
|
|
54
73
|
);
|
|
@@ -65,29 +84,37 @@ function WrapRow({ item, first, busy, login, fixture, openAgent: openSession, on
|
|
|
65
84
|
const { sessions } = item.wrap;
|
|
66
85
|
const [sheet, setSheet] = useState<"multi" | "dirty" | null>(null);
|
|
67
86
|
const [unsaved, setUnsaved] = useState<UnsavedSession[]>([]);
|
|
87
|
+
// The terminals the confirm sheet names, sent back with it: a terminal opened since brings the sheet back [ATT-22].
|
|
88
|
+
const [terminals, setTerminals] = useState<string[]>([]);
|
|
89
|
+
// The worktrees the sheet's archive removes, by name, for its title.
|
|
90
|
+
const [leaving, setLeaving] = useState<string[]>([]);
|
|
68
91
|
const dirty = sessions.some((session) => sessionCleanliness(session) === "dirty");
|
|
69
92
|
const press = async () => {
|
|
70
93
|
if (sessions.length > 1) return setSheet("multi");
|
|
71
94
|
// A preview has no daemon to ask; its made-up snapshot is the answer. Elsewhere the server checks git too, so the sheet
|
|
72
95
|
// can name the files and commits it found.
|
|
73
96
|
if (sessionCleanliness(sessions[0]) !== "clean" && fixture) {
|
|
74
|
-
|
|
97
|
+
const workspace = sessions[0].workspace;
|
|
98
|
+
setUnsaved([readingOf(sessions[0])]);
|
|
99
|
+
setLeaving(workspace?.kind === "worktree" ? [workspace.name] : []);
|
|
75
100
|
return setSheet("dirty");
|
|
76
101
|
}
|
|
77
|
-
|
|
102
|
+
asked(await onArchive(item, false));
|
|
103
|
+
};
|
|
104
|
+
const asked = (outcome: ArchiveOutcome | null) => {
|
|
78
105
|
if (outcome && !outcome.ok && outcome.reason === "unsaved") {
|
|
79
106
|
setUnsaved(outcome.sessions);
|
|
107
|
+
setTerminals(outcome.terminals);
|
|
108
|
+
setLeaving(outcome.leaving);
|
|
80
109
|
setSheet("dirty");
|
|
81
110
|
}
|
|
82
111
|
};
|
|
83
|
-
// The multi sheet asks the server first, like a single row; unsaved work it finds
|
|
112
|
+
// The multi sheet asks the server first, like a single row; unsaved work or open terminals it finds get the confirm that
|
|
113
|
+
// names them [ATT-22].
|
|
84
114
|
const confirm = async (confirm: boolean) => {
|
|
85
|
-
const outcome = await onArchive(item, confirm);
|
|
115
|
+
const outcome = await onArchive(item, confirm, confirm ? terminals : []);
|
|
86
116
|
if (outcome?.ok) return setSheet(null);
|
|
87
|
-
|
|
88
|
-
setUnsaved(outcome.sessions);
|
|
89
|
-
setSheet("dirty");
|
|
90
|
-
}
|
|
117
|
+
asked(outcome);
|
|
91
118
|
};
|
|
92
119
|
return (
|
|
93
120
|
<CardRow
|
|
@@ -110,54 +137,44 @@ function WrapRow({ item, first, busy, login, fixture, openAgent: openSession, on
|
|
|
110
137
|
secondary={[{ label: `Details for #${item.number}`, icon: "chevronRight", onPress: () => (sessions.length > 1 ? setSheet("multi") : sessions[0] ? openSession(sessions[0].id) : undefined) }]}
|
|
111
138
|
overlay={
|
|
112
139
|
sheet === "multi" ? (
|
|
113
|
-
<
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
<View style={[styles.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
))}
|
|
130
|
-
</View>
|
|
131
|
-
<Text style={styles.muted}>
|
|
132
|
-
Archives {sessions.length} sessions. Their worktrees go too when nothing else lives in them
|
|
133
|
-
{sessions.some((session) => sessionCleanliness(session) === "unknown") ? "; the one that couldn't be checked may hold unsaved work" : ""}.
|
|
134
|
-
</Text>
|
|
135
|
-
<View style={[styles.row, { justifyContent: "flex-end" }]}>
|
|
136
|
-
<Button label="Cancel" onPress={() => setSheet(null)} />
|
|
137
|
-
<Button label={sessions.length === 2 ? "Archive both" : `Archive ${sessions.length}`} variant="danger" onPress={() => void confirm(false)} />
|
|
138
|
-
</View>
|
|
139
|
-
</KeepStyles>
|
|
140
|
-
</Modal.Content>
|
|
141
|
-
</Modal>
|
|
142
|
-
) : sheet === "dirty" ? (
|
|
143
|
-
<Modal title={sessions.length > 1 ? `Archive the sessions on #${item.number}?` : `Archive the session on #${item.number}?`} open onOpenChange={(open) => (open ? null : setSheet(null))}>
|
|
144
|
-
<Modal.Content>
|
|
145
|
-
<KeepStyles styles={styles}>
|
|
146
|
-
{(unsaved.length ? unsaved : [dirtyFallback(sessions[0])]).map((info) => (
|
|
147
|
-
<View key={info.agentId} style={{ gap: 2 }}>
|
|
148
|
-
<Text style={styles.text}>{info.title ?? "Session"}</Text>
|
|
149
|
-
<Text style={{ color: styles.c.statusWarning, fontSize: 13 }}>
|
|
150
|
-
{info.unknown ? "Couldn't check for unsaved changes. Archiving may remove the worktree." : `Its worktree has ${unsavedTextFrom(info)}. Archiving may remove them.`}
|
|
151
|
-
</Text>
|
|
140
|
+
<Dialog title={`Sessions on #${item.number}`} onClose={() => setSheet(null)}>
|
|
141
|
+
<Text style={styles.muted}>
|
|
142
|
+
{item.title} · {item.wrap.finish}
|
|
143
|
+
</Text>
|
|
144
|
+
<View style={[styles.card, { backgroundColor: styles.c.surface2 }]}>
|
|
145
|
+
{sessions.map((session, index) => (
|
|
146
|
+
<View key={session.id} style={[styles.row, { paddingVertical: 10, paddingHorizontal: 12 }, index > 0 ? styles.divider : null]}>
|
|
147
|
+
<TablerIcon name="agent" size={16} />
|
|
148
|
+
<View style={{ flex: 1, gap: 2 }}>
|
|
149
|
+
<Text style={styles.text}>{session.title ?? "Session"}</Text>
|
|
150
|
+
<Text style={styles.muted}>{sessionStateText(session)}</Text>
|
|
151
|
+
{session.subAgents?.count ? (
|
|
152
|
+
<Text style={styles.muted}>
|
|
153
|
+
+{session.subAgents.count} sub-agent{session.subAgents.count === 1 ? "" : "s"}
|
|
154
|
+
</Text>
|
|
155
|
+
) : null}
|
|
152
156
|
</View>
|
|
153
|
-
|
|
154
|
-
<View style={[styles.row, { justifyContent: "flex-end" }]}>
|
|
155
|
-
<Button label="Open session" icon="agent" variant="calm" onPress={() => openSession(unsaved[0]?.agentId ?? sessions[0].id)} />
|
|
156
|
-
<Button label="Archive anyway" variant="danger" onPress={() => void confirm(true)} />
|
|
157
|
+
<Button label="Open" variant="ghost" onPress={() => openSession(session.id)} />
|
|
157
158
|
</View>
|
|
158
|
-
|
|
159
|
-
</
|
|
160
|
-
|
|
159
|
+
))}
|
|
160
|
+
</View>
|
|
161
|
+
<Text style={styles.muted}>
|
|
162
|
+
Archives {sessions.length} sessions. Their worktrees go too when no other session lives in them, closing their terminals
|
|
163
|
+
{sessions.some((session) => sessionCleanliness(session) === "unknown") ? "; the one that couldn't be checked may hold unsaved work" : ""}.
|
|
164
|
+
</Text>
|
|
165
|
+
<View style={[styles.row, { justifyContent: "flex-end" }]}>
|
|
166
|
+
<Button label="Cancel" onPress={() => setSheet(null)} />
|
|
167
|
+
<Button label={sessions.length === 2 ? "Archive both" : `Archive ${sessions.length}`} variant="danger" onPress={() => void confirm(false)} />
|
|
168
|
+
</View>
|
|
169
|
+
</Dialog>
|
|
170
|
+
) : sheet === "dirty" ? (
|
|
171
|
+
<ArchiveSheet
|
|
172
|
+
title={leaving.length === 1 ? `Archive "${leaving[0]}"?` : sessions.length > 1 ? `Archive the sessions on #${item.number}?` : `Archive the session on #${item.number}?`}
|
|
173
|
+
unsaved={unsaved.length ? unsaved : [readingOf(sessions[0])]}
|
|
174
|
+
onOpen={() => openSession(unsaved[0]?.agentId ?? sessions[0].id)}
|
|
175
|
+
onArchive={() => void confirm(true)}
|
|
176
|
+
onClose={() => setSheet(null)}
|
|
177
|
+
/>
|
|
161
178
|
) : null
|
|
162
179
|
}
|
|
163
180
|
/>
|
|
@@ -166,32 +183,81 @@ function WrapRow({ item, first, busy, login, fixture, openAgent: openSession, on
|
|
|
166
183
|
|
|
167
184
|
// What a session in Wrap up's multi sheet says about its worktree [ATT-22].
|
|
168
185
|
function sessionStateText(session: AgentSummary): string {
|
|
169
|
-
const
|
|
170
|
-
if (
|
|
171
|
-
|
|
172
|
-
return "idle · couldn't check for unsaved changes";
|
|
186
|
+
const unsaved = sessionUnsaved(session);
|
|
187
|
+
if (!unsaved) return "idle · nothing unsaved";
|
|
188
|
+
return sessionCleanliness(session) === "unknown" ? "idle · couldn't check for unsaved changes" : `idle · ${unsavedWords(unsaved)}`;
|
|
173
189
|
}
|
|
174
190
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
191
|
+
// What the confirm sheet names for a session the server hasn't checked: Paseo's reading of it.
|
|
192
|
+
const readingOf = (session: AgentSummary | undefined): UnsavedSession =>
|
|
193
|
+
session ? (sessionUnsaved(session) ?? { agentId: session.id, title: session.title }) : { agentId: "", title: null, unknown: true };
|
|
194
|
+
|
|
195
|
+
// The confirm sheet, shaped like Paseo's "Archive workspace" one: what each session's worktree would lose, in Paseo's
|
|
196
|
+
// words, then the terminals archiving closes; Open session to look first, or Archive [ATT-22].
|
|
197
|
+
function ArchiveSheet({ title, unsaved, onOpen, onArchive, onClose }: { title: string; unsaved: UnsavedSession[]; onOpen?: () => void; onArchive: () => void; onClose: () => void }) {
|
|
198
|
+
const styles = useStyles();
|
|
199
|
+
return (
|
|
200
|
+
<Dialog title={title} onClose={onClose}>
|
|
201
|
+
{unsaved.map((info) => (
|
|
202
|
+
<View key={info.agentId} style={{ gap: 2 }}>
|
|
203
|
+
{unsaved.length > 1 || info.title ? <Text style={styles.text}>{info.title ?? "Session"}</Text> : null}
|
|
204
|
+
{sheetLines(info).map((line) => (
|
|
205
|
+
<Text key={line} style={{ color: line.startsWith("Closes") ? styles.c.foregroundMuted : styles.c.statusWarning, fontSize: 13 }}>
|
|
206
|
+
{line}
|
|
207
|
+
</Text>
|
|
208
|
+
))}
|
|
209
|
+
</View>
|
|
210
|
+
))}
|
|
211
|
+
<View style={[styles.row, { justifyContent: "flex-end" }]}>
|
|
212
|
+
{onOpen ? <Button label="Open session" icon="agent" variant="calm" onPress={onOpen} /> : <Button label="Cancel" onPress={onClose} />}
|
|
213
|
+
<Button label="Archive" variant="danger" onPress={onArchive} />
|
|
214
|
+
</View>
|
|
215
|
+
</Dialog>
|
|
216
|
+
);
|
|
187
217
|
}
|
|
188
218
|
|
|
189
|
-
//
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
219
|
+
// A row whose sessions are archived but whose worktree stayed, saying why, until the worktree goes or I dismiss it [ATT-22].
|
|
220
|
+
// Its button fits the reason: open the session that kept it, archive the worktree a terminal kept, or try Paseo again.
|
|
221
|
+
function KeptWorktreeRow({
|
|
222
|
+
row,
|
|
223
|
+
first,
|
|
224
|
+
busy,
|
|
225
|
+
login,
|
|
226
|
+
openSession,
|
|
227
|
+
onArchive,
|
|
228
|
+
onDismiss,
|
|
229
|
+
}: {
|
|
230
|
+
row: KeptRow;
|
|
231
|
+
first: boolean;
|
|
232
|
+
busy: boolean;
|
|
233
|
+
login: string | null;
|
|
234
|
+
openSession: (agentId: string) => void;
|
|
235
|
+
onArchive: KeptProps["onArchiveWorktree"];
|
|
236
|
+
onDismiss: (row: KeptRow) => void;
|
|
237
|
+
}) {
|
|
238
|
+
const [sheet, setSheet] = useState<{ unsaved: UnsavedSession[]; terminals: string[] } | null>(null);
|
|
239
|
+
const archive = async (confirm: boolean) => {
|
|
240
|
+
const outcome = await onArchive(row, confirm, confirm ? (sheet?.terminals ?? []) : []);
|
|
241
|
+
if (outcome && !outcome.ok && outcome.reason === "unsaved") return setSheet({ unsaved: outcome.sessions, terminals: outcome.terminals });
|
|
242
|
+
setSheet(null);
|
|
243
|
+
};
|
|
244
|
+
const primary =
|
|
245
|
+
row.reason === "session" && row.agentId
|
|
246
|
+
? { label: "Open session", icon: "agent" as const, onPress: () => openSession(row.agentId!) }
|
|
247
|
+
: { label: row.reason === "refused" ? "Try again" : "Archive worktree", icon: "archive" as const, onPress: () => void archive(false) };
|
|
248
|
+
return (
|
|
249
|
+
<CardRow
|
|
250
|
+
first={first}
|
|
251
|
+
mark={{ icon: "archive", tone: "neutral" }}
|
|
252
|
+
title={row.title}
|
|
253
|
+
meta={{ place: { repo: row.repo, number: row.number, login }, when: keptText(row), signals: [] }}
|
|
254
|
+
onOpen={primary.onPress}
|
|
255
|
+
busy={busy}
|
|
256
|
+
primary={{ ...primary, accessibilityLabel: `${primary.label}: ${row.name}` }}
|
|
257
|
+
secondary={[{ label: "Dismiss", icon: "close", accessibilityLabel: `Dismiss: keep ${row.name}`, onPress: () => onDismiss(row) }]}
|
|
258
|
+
overlay={
|
|
259
|
+
sheet ? <ArchiveSheet title={`Archive "${row.name}"?`} unsaved={sheet.unsaved} onArchive={() => void archive(true)} onClose={() => setSheet(null)} /> : null
|
|
260
|
+
}
|
|
261
|
+
/>
|
|
262
|
+
);
|
|
197
263
|
}
|
package/docs/architecture.md
CHANGED
|
@@ -24,7 +24,7 @@ flowchart LR
|
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
- **Paseo plugin**, installed per daemon.
|
|
27
|
-
- Client: one screen
|
|
27
|
+
- Client: one screen, a sidebar header item and two Command Center items for a new issue [ISS-01]. React Native primitives only, so it works on phone and desktop [REACH-01].
|
|
28
28
|
- Server: RPC handlers for fetching and for GitHub actions.
|
|
29
29
|
- With several hosts, each runs its own copy, with its own `gh` login, `config.json` and `state.json`. Paseo shows one sidebar row for all of them and switches hosts with the picker in the screen's header; the row follows the host in view, else the one picked last.
|
|
30
30
|
- **GitHub access** goes through the host's existing `gh` login. The plugin stores no token [SEC-01]. Projects need the `read:project` scope, which `gh auth login` doesn't ask for; Next up reads them only once the login has it [NXT-12].
|
|
@@ -40,7 +40,7 @@ flowchart LR
|
|
|
40
40
|
- optional merge method per repo [PRS-04]
|
|
41
41
|
- `codeRepos`: where an issue repo's code lives, for issues kept in their own repo [SES-07]
|
|
42
42
|
- `nextUp`: where unclaimed issues come from (`mine`, `orgs`, `repos`, set in Settings) and the org issue fields for priority, effort and scope [NXT-04]
|
|
43
|
-
- `state.json`: dismissals [ATT-08], what others did to my work, with which notes I've cleared or an archive acknowledged [HIS-06, HIS-07, ATT-22], Reviewed and Changed by others shown in History's weeks [HIS-07], the scopes, sources and project statuses ticked in Next up's filter [NXT-03, NXT-09], my Paseo projects' GitHub repos [NXT-08], the update put off with Not now [UPD-01] and the last fetch of each feed, so the screen shows instantly after a restart [PRIV-01].
|
|
43
|
+
- `state.json`: dismissals [ATT-08], what others did to my work, with which notes I've cleared or an archive acknowledged [HIS-06, HIS-07, ATT-22], Reviewed and Changed by others shown in History's weeks [HIS-07], the scopes, sources and project statuses ticked in Next up's filter [NXT-03, NXT-09], the repository and profile the New issue sheet last started with [ISS-01], my Paseo projects' GitHub repos [NXT-08], the device's time zone for History's weeks [HIS-01], the update put off with Not now [UPD-01] and the last fetch of each feed, so the screen shows instantly after a restart [PRIV-01].
|
|
44
44
|
|
|
45
45
|
## Tabs
|
|
46
46
|
|
|
@@ -48,12 +48,12 @@ The tabs tell the story of my work, left to right: what I finished, what needs m
|
|
|
48
48
|
|
|
49
49
|
| Tab | Shows |
|
|
50
50
|
|---|---|
|
|
51
|
-
| History | The last `historyWeeks` (default 4) by week, newest first, in the device's time zone [HIS-01]; which items each week shows and copies is `shared/history-report.ts`, drawn by `client/history.tsx`. Above the weeks, **Changed by others** lists the unread notes, newest first: my PR merged or closed unmerged by someone else, an issue assigned to me closed by someone else as completed or not planned, a PR of mine reopened by someone else after Attention Span saw it closed, my PR or issue taken over or handed on, or me unassigned from an issue. Each is a row in the same words ("merged by dave 2h ago", "closed by alice 6h ago as completed", "reopened by bob 1h ago", "phil took over", "bob unassigned you 8d ago"), its tile showing what happened [HIS-07]. **Got it**, an icon-only check in the main action's style, clears one (Undo brings it back); with two or more, a ghost **✓ Mark all as read** clears the notes on screen, one Undo bringing them all back, and the two wait for each other in `shared/got-it.ts`. A note about work already in Doing's Wrap up waits there instead, because archiving it is the acknowledgement; unread notes expire after `mentionDays` (default 30). They never count in Doing's count, the sidebar's or the horizon, and the History tab shows a green dot and says "unread changes" to screen readers while any is unread. **Filter** between the notes and the weeks opens a sheet, *Show in each week*: Finished (always, disabled), Reviewed and Changed by others, both off at first and remembered in `state.json`; the button reads "Filter · n" in green when on. With Reviewed on, each week shows a labelled **Reviewed** list of others' merged PRs I reviewed [HIS-02]; with Changed by others on, a labelled list of its cleared notes that aren't already finished work, like a PR closed unmerged, a handover or a reopen [HIS-06, HIS-07]. These replace the old collapsed disclosures. Each week's count is its finished items. A PR of mine someone else merged says so: "merged 2h ago by dave", with its copied line unchanged; under the issue it closed, its row in the sheet says "merged by dave" [HIS-05]. An issue someone else closed says "closed 6h ago by alice" too. A merge or issue close the live refresh sees fills its week at once, before History's daily fetch; when the fetch catches up, its richer card takes the live one's place [HIS-07]. A PR that left my hands isn't listed as done even once its new owner merges it; a handover cleared into a week stays there if the work comes back to me, but doesn't hide what I later finish [HIS-06]. The copy icon on a week's heading copies what's shown as Markdown lists of links, per kind: Finished, plus Reviewed when shown, separated by `## Finished` and `## Reviewed` headings; never Changed by others; an issue and the PRs that closed it are one line, linking the issue; an issue closed as not planned isn't copied, and PRs that referred to it are listed on their own [HIS-03]. Each card has a plain chip (bug, feature or task) for what kind of work it was, and each copied line leads with its emoji: 🐞, 🚀 or 🔧; a PR of none of those leads with 🔀 and has no chip, an issue of none leads with nothing [HIS-04]. The first of these that names a kind decides: the issue type, the labels (bug beats feature beats task), a Conventional Commit title prefix (`fix:` bug, `feat:` feature, `chore:`, `refactor:`, `docs:`, `build:`, `ci:`, `test:`, `perf:`, `style:` task). Types and labels match only as whole names, ignoring case, emoji and wrappers like `type:` or `kind/`, so "bug", "Type: Bug 🐞" and "kind/bug" count but "not a bug" and "bug bash" don't. Until History is fetched again, what I just finished uses the issue type and title only. |
|
|
51
|
+
| History | The last `historyWeeks` (default 4) by week, newest first, in the device's time zone [HIS-01]; which items each week shows and copies is `shared/history-report.ts`, drawn by `client/history.tsx`. Above the weeks, **Changed by others** lists the unread notes, newest first: my PR merged or closed unmerged by someone else, an issue assigned to me closed by someone else as completed or not planned, a PR of mine reopened by someone else after Attention Span saw it closed, my PR or issue taken over or handed on, or me unassigned from an issue. Each is a row in the same words ("merged by dave 2h ago", "closed by alice 6h ago as completed", "reopened by bob 1h ago", "phil took over", "bob unassigned you 8d ago"), its tile showing what happened [HIS-07]. **Got it**, an icon-only check in the main action's style, clears one (Undo brings it back); with two or more, a ghost **✓ Mark all as read** clears the notes on screen, one Undo bringing them all back, and the two wait for each other in `shared/got-it.ts`. A note about work already in Doing's Wrap up waits there instead, because archiving it is the acknowledgement; unread notes expire after `mentionDays` (default 30). They never count in Doing's count, the sidebar's or the horizon, and the History tab shows a green dot and says "unread changes" to screen readers while any is unread. **Filter** between the notes and the weeks opens a sheet, *Show in each week*: Finished (always, disabled), Reviewed and Changed by others, both off at first and remembered in `state.json`; the button reads "Filter · n" in green when on. With Reviewed on, each week shows a labelled **Reviewed** list of others' merged PRs I reviewed [HIS-02]; with Changed by others on, a labelled list of its cleared notes that aren't already finished work, like a PR closed unmerged, a handover or a reopen [HIS-06, HIS-07]. These replace the old collapsed disclosures. Each week's count is its finished items. A PR of mine someone else merged says so: "merged 2h ago by dave", with its copied line unchanged; under the issue it closed, its row in the sheet says "merged by dave" [HIS-05]. An issue someone else closed says "closed 6h ago by alice" too. A merge or issue close the live refresh sees fills its week at once, before History's daily fetch; when the fetch catches up, its richer card takes the live one's place [HIS-07]. A PR of mine the live refresh sees merged that History doesn't list, merged on GitHub say, has History fetched once its search has caught up (`SETTLE_MS` later), once per PR, so a search slow to show it doesn't fetch on every refresh [FRESH-03]. A PR that left my hands isn't listed as done even once its new owner merges it; a handover cleared into a week stays there if the work comes back to me, but doesn't hide what I later finish [HIS-06]. The copy icon on a week's heading copies what's shown as Markdown lists of links, per kind: Finished, plus Reviewed when shown, separated by `## Finished` and `## Reviewed` headings; never Changed by others; an issue and the PRs that closed it are one line, linking the issue; an issue closed as not planned isn't copied, and PRs that referred to it are listed on their own [HIS-03]. Each card has a plain chip (bug, feature or task) for what kind of work it was, and each copied line leads with its emoji: 🐞, 🚀 or 🔧; a PR of none of those leads with 🔀 and has no chip, an issue of none leads with nothing [HIS-04]. The first of these that names a kind decides: the issue type, the labels (bug beats feature beats task), a Conventional Commit title prefix (`fix:` bug, `feat:` feature, `chore:`, `refactor:`, `docs:`, `build:`, `ci:`, `test:`, `perf:`, `style:` task). Types and labels match only as whole names, ignoring case, emoji and wrappers like `type:` or `kind/`, so "bug", "Type: Bug 🐞" and "kind/bug" count but "not a bug" and "bug bash" don't. Until History is fetched again, what I just finished uses the issue type and title only. |
|
|
52
52
|
| Doing | The sections below |
|
|
53
53
|
| Waiting | My work where someone else has the next move [WAI-01]: *Waiting for review* (while GitHub records a review as owed: a pending request, or an approval or requested changes; or approved but blocked by a repo rule [PRS-13]), *Waiting for the reviewer* (after I replied or pushed), *CI running*, *Questions I asked* (threads where my comment is the last from a person, bots don't count, and my comments since someone else last spoke ask something: a question mark outside quotes, code and links, read from GitHub's rendered comments (`bodyHTML`) so code and links count however they were written; a statement, tagged or not, waits on nobody and isn't listed): on my own issues however old, on others' only while my comment is within `mentionDays` [ATT-11]. Each shows who it waits on, never a guess [WAI-02]: on a PR, the reviewers currently requested and, after I replied, whoever requested changes, but nobody when a repo rule blocks it; on a question, the people and teams my comments since the last answer tag, read from GitHub's rendered comments (`bodyHTML`), where only real accounts and teams I can see are linked, never in code; tags in quotes don't count, and only the last 10 comments are read. Waiting groups it all by who it waits on, not by those reasons [WAI-01]: one group per person or team (a person tagged with other capitals is one), whoever blocks the most items first, ties by whose oldest item has waited longest, then requested bots, who can't be nudged, and last *Not on a person* for work nobody is on record for. In each group, work with a session that needs me leads, then one that's working, then the rest, oldest first; a finished session I've seen doesn't lift it. Work waiting on several is under each, saying "also waiting on" the rest, and counts once in the tab. Each card says why it waits (review, re-review or question; nothing where its chips say, like approved, blocked by repo rules, or CI running) and since when. A group's **Copy list** copies its items oldest first as a Markdown list, each line led by why and how long ("- Review 2h: [title](url)"), for a nudge; a requested bot gets none [WAI-03]. My PRs in Doing that wait on people or teams I asked, approved or not, are listed here too, under each of them [PRS-15]. Once something has waited `waitingTooLongDays` (default 3), its age turns amber with ⌛ and says so on hover, but only where a nudge is fair: not while CI fails or runs, nor with conflicts, changes to make or a reply I owe (`nudgeable` in `server/rules.ts`) [ATT-11]. In Doing, one person shows by name, several by picture, named on hover and in the sheet. |
|
|
54
54
|
| Next up | *Assigned to you* [NXT-06], then *Unclaimed* [NXT-01] |
|
|
55
55
|
|
|
56
|
-
Every card in every tab is the same component, `CardRow` in `client/card.tsx` [ATT-05]: a tinted mark for what it is, a title of at most two lines, then the item's number, its repo (the name brighter than the owner, which my own repos leave out) [ATT-20], when it happened and signal chips, then content only some lists have (pills, a quote, a stack line), and its actions: on the right on desktop, labelled under the text on phones. A change on GitHub asks first in a `ConfirmBar` on the card [SAFE-01]. Tabs differ only in what they pass in: each maps its data to the card's mark, meta, actions and slots. Marks and signals take a tone, never a raw theme color, because some themes draw `accent` close to white. How an item itself is shown, its number and repo and an issue's pills, lives in `client/entity.tsx` (`PlaceText`, `IssuePills`, `ProjectPill`, `FieldPill`, GitHub's option colors), so cards and sheets compose the same pieces rather than format their own; `client/ui.tsx` keeps the generic ones (`Meta`, `Pill`, `Signal`).
|
|
56
|
+
Every card in every tab is the same component, `CardRow` in `client/card.tsx` [ATT-05]: a tinted mark for what it is, a title of at most two lines, then the item's number, its repo (the name brighter than the owner, which my own repos leave out) [ATT-20], when it happened and signal chips, then content only some lists have (pills, a quote, a stack line), and its actions: on the right on desktop, labelled under the text on phones. A change on GitHub asks first in a `ConfirmBar` on the card [SAFE-01]. Tabs differ only in what they pass in: each maps its data to the card's mark, meta, actions and slots. What an item's card and sheet show, and in what order, is decided in `shared/item-view.ts` and drawn by `client/item-row.tsx`; the actions behind them are `useItemActions` in `client/item-actions.ts`. Marks and signals take a tone, never a raw theme color, because some themes draw `accent` close to white. How an item itself is shown, its number and repo and an issue's pills, lives in `client/entity.tsx` (`PlaceText`, `IssuePills`, `ProjectPill`, `FieldPill`, GitHub's option colors), so cards and sheets compose the same pieces rather than format their own; `client/ui.tsx` keeps the generic ones (`Meta`, `Pill`, `Signal`).
|
|
57
57
|
|
|
58
58
|
A sheet shows what the card knows on top, in the same pieces as the card, then every action, then what's fetched when it opens (a PR's size, linked PRs or issues). Tapping a card opens its sheet at once, with every action, and what's fetched fills in; it comes last, so the actions don't move when it arrives. Resting the pointer on a card for 300 ms fetches it ahead, best effort (`usePrefetchOnRest` in `client/sheet.tsx`), and it stays fresh for a minute, so the card and its sheet share one query and on desktop most sheets open complete. Until then `Skeleton` bars hold the room of the lines the card expects, at the lines' own height: one for the size of the PR its actions apply to, one per open PR a Next up issue is known to have. They show only after 150 ms, holding their room meanwhile, so a quick answer doesn't flash them, and lines that come in while the sheet is open fade in. An issue's sheet lists only its open PRs, as its card knows them. A failed fetch shows its error line. On desktop the sheet is a centered dialog, so the one line it can't expect, someone else's PR closing the same issue, grows it a little when it comes [ATT-06, GH-01].
|
|
59
59
|
|
|
@@ -84,7 +84,7 @@ Top to bottom. Each item appears once, under its most urgent reason [ATT-02]. `s
|
|
|
84
84
|
| Needs upstream | My PRs with conflicts or an out-of-sync stack [UPS-01, UPS-02] |
|
|
85
85
|
| Needs a reviewer | My PRs nobody has been asked to review, even while CI runs [PRS-12]. Only what GitHub records counts as asked: a pending request, an approval or requested changes. GitHub drops a reviewer's request once they review, so a review that only commented, by a person or a bot, leaves it here to re-request; the repo, not us, decides whose approval counts |
|
|
86
86
|
| My drafts | My drafts, with their own state tags [PRS-05, PRS-06] |
|
|
87
|
-
| Wrap up | First, the cleanup: finished or out-of-my-hands work whose unarchived Paseo sessions are all idle, including a review session on someone else's merged PR [ATT-22]. It takes merged, closed and handed-off items, mine or anyone's, including my own PRs I closed without merging ("closed 3h ago, not merged", from the live closed search, never listed in History), as far back as History and its ledger keep, with no age cutoff of its own; a stack or issue group enters only when everything its sessions serve is done, and counts once; one session never makes two rows. A busy session keeps its row out until idle. Newest finish first, each row saying what happened and what is still open: "merged by dave 2h ago · your session's still open", "merged by alice 1d ago · your review session's still open", "2 sessions still open", with an amber "unsaved changes" where a worktree has them. **Archive session** (plural for several) archives the item's agents; a worktree goes too only when it's Paseo's and
|
|
87
|
+
| Wrap up | First, the cleanup: finished or out-of-my-hands work whose unarchived Paseo sessions are all idle, including a review session on someone else's merged PR [ATT-22]. It takes merged, closed and handed-off items, mine or anyone's, including my own PRs I closed without merging ("closed 3h ago, not merged", from the live closed search, never listed in History) and my merged PRs from the same search, which stand in until History has them (`ownClosed` in `server/changes.ts`; History's entry wins) [FRESH-03], as far back as History and its ledger keep, with no age cutoff of its own; a stack or issue group enters only when everything its sessions serve is done, and counts once; one session never makes two rows. A busy session keeps its row out until idle. Newest finish first, each row saying what happened and what is still open: "merged by dave 2h ago · your session's still open", "merged by alice 1d ago · your review session's still open", "2 sessions still open", with an amber "unsaved changes" where a worktree has them. **Archive session** (plural for several) archives the item's agents and the sub-agents they started; a worktree goes too only when it's Paseo's and no other session lives in it, never a local checkout. A sub-agent still running or starting, or flagged for anything but finished or failed (a permission, say), keeps its session's row out, like a busy session; a finished or failed one Paseo still flags for attention doesn't (`subAgentBusy`), as nobody opens a sub-agent and reporting back is its parent's job. One idle session with nothing uncommitted or unpushed archives at once; unsaved or unknown work, or a terminal open in a worktree that goes, asks first in a sheet shaped like Paseo's own "Archive workspace" one: 'Archive "Split invoice PDF"?' when the worktree goes with it (else "Archive the session on #186?"), then each session's lines in Paseo's words ("Uncommitted changes: 2 files (+12 −3)", "1 unpushed commit", "Couldn't check for unsaved changes") and a muted "Closes terminals: dev, shell", with Open session and Archive; a terminal that opened after the sheet brings it back; the multi sheet notes "+1 sub-agent" under a session that has them; several sessions open a sheet listing each one's state with Open; archiving from there checks first too, and any unsaved work it finds gets the naming confirm. **Archive all clean · n** sits in the header with 2+ rows and archives every clean single-session row; it and single archives wait for each other like Got it and Mark all. Success acknowledges exactly the changes present at that moment, so they go to their week as cleared rather than History's unread notes; so does archiving a session Attention Span started in Paseo itself, for what others did up to then, once no session it started is left on that work; a failure keeps the row and says why, and a worktree that stayed after its sessions went keeps a row in Wrap up, uncounted, saying why, briefly, beside the archive mark ("Fix flaky test still in it", "dev server opened meanwhile", "Paseo: worktree is locked") with a button for the reason (Open session, Archive worktree, Try again) and × to dismiss; it goes once the worktree is archived anywhere, and keeps the horizon away until then. Until the session list has loaded, or when it fails, Wrap up isn't known: Doing says so instead of showing the horizon. There is no Undo: Paseo's SDK can't restore a workspace and its agents, so the dirty check and confirmation are the safeguard instead. Its rows count in Doing's and the sidebar's count, and keep the horizon away. |
|
|
88
88
|
|
|
89
89
|
**Nothing in Doing** shows a horizon instead of a list (`client/still.tsx`) [ATT-18], with "Nothing's on you. Enjoy the quiet." It follows the device's clock at fixed hours: a low sun in the morning (5–11), a high sun at midday (11–16), a setting sun in the evening (16–21), and a moon with a few stars at night, each in its own soft tint. It settles in on every arrival on the tab (the sky drifts up as it fades in, then its reflections, 700 ms; not with reduced motion), then holds still; when the hour changes while it's open, it crossfades. It shows only after a refresh that worked: before the first one there's a spinner, and after a failed one just the error. Items that are all dismissed count as clear; the "show them again" line sits faintly at the bottom. Wrap up's rows don't: the horizon waits until they're archived too [ATT-22]. Changed by others never touches Doing; it lives in History [HIS-07].
|
|
90
90
|
|
|
@@ -96,7 +96,7 @@ Top to bottom. Each item appears once, under its most urgent reason [ATT-02]. `s
|
|
|
96
96
|
- **Mentions** [MEN-01..06]: a thread counts when a person @-mentioned me after my last comment, review or reaction there. Team mentions are ignored. A bot counts only when it opened a thread I need to resolve, and is marked with 🤖. The quote on a card is cut around the mention, so it's shown as plain text: links keep their text, Markdown marks and quoted replies go.
|
|
97
97
|
- **Handed over** [PRS-08]: my PRs assigned to someone else, and not to me, are left out. Mentions of me on them still count. A PR of mine with nobody assigned is mine.
|
|
98
98
|
- **Changed by others** [HIS-07] (`server/changes.ts`) keeps a ledger of what others did, in `state.json`, by GitHub's node ids, which a transfer keeps. Only someone else's doing counts; my own actions and others' pushes don't. Merges, unmerged closes and issue closes come from live searches: `mergedBy`, the last close event's actor, and an issue's `stateReason`. A PR that left my hands before it ended counts as the handover, not the merge; one assigned to someone after it ended is still my merge, and a PR someone else has waits a refresh for its lookup rather than be called a merge. Handovers come from GitHub's assign and unassign events, which are separate, never one "handover": a PR is looked up when it's assigned to someone else and not me, once per change of its assignees; it left my hands with whichever came last of my removal and the new owner's assignment, so a PR I took myself off is mine until someone takes it, and an earlier round's removal doesn't name who took it this time; an issue when it leaves my assigned search since the last refresh that worked. Leaving the search proves nothing (search lag, a coverage change, its 50 results), so only an unassign event of me by someone else counts; one closed by then is left to its close note. So unassignments are noticed only for issues Attention Span has seen assigned to me; on the first run none count as gone. A PR seen closed unmerged is tracked; once it drops out of the closed search, as a reopen takes it out, a batch asks for its state and last reopen event. A reopen removes the old close from its week whoever did it, and only someone else's is a note; a merged one stops being tracked, and nothing older than the ledger's window is tracked. A first run tracks from then on, so old closes don't replay as new. A failed lookup, or one node in it GitHub failed on (anything but not found), is asked again on the next refresh. A PR handed over isn't listed under the finished issue it closed either; when a cleared handover's work comes back to me it stays in its week, marked returned, so my later work on it is mine again. Events are kept `historyWeeks` + 1 weeks, or `mentionDays` if longer; unread notes expire after `mentionDays` for History's top section.
|
|
99
|
-
- **Wrap up** [ATT-22] (`shared/wrap-up.ts`, drawn by `client/wrap-up.tsx`) is assembled on the client from the sessions the screen and the sidebar already poll; the server archives and acknowledges. An item's identity is `memberKeys` in `shared/attention.ts`: its key, the PRs under it and the work a change note is about, spelled as GitHub spells them since Paseo's labels match exactly, and compared ignoring case; Wrap up, archiving and acknowledging all use it. A finished item, reviewed PR, my own unmerged close, cleared change or unread change is a candidate; its sessions are the ones on any of its member keys. It enters when it has at least one unarchived session, every one is idle (not working and not needing me), none serves an item still in Doing or Waiting, and no session already belongs to another row. History lists a merged PR alone, as its branches are gone, so each live refresh remembers every open stack's and issue group's keys under each member (`groups` in `state.json`, kept as long as the ledger): a merged member whose remembered sibling is still open stays out, and so does its session. The screen freezes rows whose archive runs and Archive all clean while any row's archive runs (`shared/got-it.ts`). Archiving goes through `paseo.agents.ref(id).archive()`; a Paseo worktree is archived too only when every unarchived agent in it is being archived, and a local checkout never is. The dirty check reads Paseo's workspace snapshot and, for counts, `git status --porcelain` and `git rev-list --count @{upstream}..HEAD` (with no upstream, `HEAD --not --remotes`) on the daemon host. Clean needs both answers: when either can't say, it's treated as dirty and the sheet says so. Agents and their status are listed again right before archiving, so a session that started working during the checks, or one that moved into the worktree, stops it. A session Attention Span started, archived in Paseo itself, is caught by the `agent.archived` hook in `index.server.ts` (`server/archived.ts`), even with the screen closed: once no other open session labelled with any key of its item's group is left, the group's changes up to the archive's `archivedAt` are acknowledged, so what others do later still shows. A sub-agent's archive, a restored session and a session without an item label acknowledge nothing; sessions linked only by their workspace neither acknowledge nor hold an acknowledgement back. Lists read every page, and a lookup that fails is tried again on the next hook event or list request, never taken as "none left"; tries are kept in memory, so an archive while the server isn't running, or one pending at a restart, isn't noticed, and Got it or Mark all clears its notes. When a session leaves the screen's 15-second poll (`useItemAgents` in `client/sessions.ts`, shared with the sidebar), the screen reads the server's view from memory first, so the notes acknowledged for it are cleared before its Wrap up row goes. Paseo's SDK has no `restoreWorkspace`, so there is no Undo; `server/archive.ts` confirms instead.
|
|
99
|
+
- **Wrap up** [ATT-22] (`shared/wrap-up.ts`, drawn by `client/wrap-up.tsx`) is assembled on the client from the sessions the screen and the sidebar already poll; the server archives and acknowledges. An item's identity is `memberKeys` in `shared/attention.ts`: its key, the PRs under it and the work a change note is about, spelled as GitHub spells them since Paseo's labels match exactly, and compared ignoring case (`shared/names.ts`, as all GitHub names are); Wrap up, archiving and acknowledging all use it. A finished item, reviewed PR, my own unmerged close, cleared change or unread change is a candidate; its sessions are the ones on any of its member keys. It enters when it has at least one unarchived session, every one is idle (not working and not needing me), none serves an item still in Doing or Waiting, and no session already belongs to another row. History lists a merged PR alone, as its branches are gone, so each live refresh remembers every open stack's and issue group's keys under each member (`groups` in `state.json`, kept as long as the ledger): a merged member whose remembered sibling is still open stays out, and so does its session. The screen freezes rows whose archive runs and Archive all clean while any row's archive runs (`shared/got-it.ts`). Archiving goes through `paseo.agents.ref(id).archive()`, sub-agents first (found by Paseo's `paseo.parent-agent-id` label, `subAgentsOf` in `shared/linked-sessions.ts`; one in another workspace is archived, its workspace left alone; archive lists every page of agents, archived ones too, so one under an archived sub-agent still counts, and a sub-agent that won't archive and stays open stops the archive before its session goes); a Paseo worktree is archived too, through `paseo.workspaces.archive`, which archives everything in it, only when every unarchived agent in it is being archived, and a local checkout never is. Workspaces are named as Paseo's sidebar names them: the title, else the branch. A worktree that stays is a `KeptRow` in `state.json` (`kept`) with its row's item; the `workspace.archived` hook forgets it, and remembers the workspace so an archive still running doesn't add it back, Dismiss forgets it, and Archive worktree or Try again runs the same checks on the worktree alone (`rpc.archiveWorktree`). Paseo closes a worktree's terminals when it archives it, so they're listed (`paseo.terminals.list`) right before archiving and named on the sheet; the confirm sends back the ids it named, and any other asks again. They're listed once more right before each worktree goes: one that opened while the sessions were being archived keeps its worktree, said in its kept row, as Paseo's SDK has no archive that checks and removes at once. Terminals that can't be listed don't keep the worktree, as Paseo would close them anyway. The plugin SDK says nothing of what a terminal runs, so an idle shell and a dev server are named alike. The dirty check reads Paseo's workspace snapshot and, for counts, `git status --porcelain`, `git diff --shortstat HEAD` for lines, and `git rev-list --count @{upstream}..HEAD` (with no upstream, `HEAD --not --remotes`) on the daemon host. Clean needs both answers: when either can't say, it's treated as dirty and the sheet says so (`unsavedOf` in `shared/archive.ts`, for the server and the screen alike). Agents and their status are listed again right before archiving, so a session that started working during the checks, or one that moved into the worktree, stops it. A session Attention Span started, archived in Paseo itself, is caught by the `agent.archived` hook in `index.server.ts` (`server/archived.ts`), even with the screen closed: once no other open session labelled with any key of its item's group is left, the group's changes up to the archive's `archivedAt` are acknowledged, so what others do later still shows. A sub-agent's archive, a restored session and a session without an item label acknowledge nothing; sessions linked only by their workspace neither acknowledge nor hold an acknowledgement back. Lists read every page, and a lookup that fails is tried again on the next hook event or list request, never taken as "none left"; tries are kept in memory, so an archive while the server isn't running, or one pending at a restart, isn't noticed, and Got it or Mark all clears its notes. A new list that brings other merged branches polls again at once, so a session linked by branch doesn't wait for the next round. When a session leaves the screen's 15-second poll (`useItemAgents` in `client/sessions.ts`, shared with the sidebar), the screen reads the server's view from memory first, so the notes acknowledged for it are cleared before its Wrap up row goes. Paseo's SDK has no `restoreWorkspace`, so there is no Undo; `server/archive.ts` confirms instead.
|
|
100
100
|
|
|
101
101
|
- **Dismiss** [ATT-08] hides an item until someone other than me comments, reviews or pushes, or its reason changes. My own actions and CI reruns don't bring it back.
|
|
102
102
|
- **Behind base** [UPS-07] only matters when:
|
|
@@ -110,7 +110,7 @@ Top to bottom. Each item appears once, under its most urgent reason [ATT-02]. `s
|
|
|
110
110
|
|
|
111
111
|
## Next up
|
|
112
112
|
|
|
113
|
-
A second tab lists open issues nobody is assigned to [NXT-01], from the sources chosen under Next up in Settings: my own repos (`user:<login>`, forks left out), orgs I belong to (picked from `viewer.organizations`), and single repos checked on GitHub [NXT-04]. Each source is its own search, so an issue knows which sources found it and no query outgrows GitHub's length limit; one found by several is listed once. With more than one source, the Filter button on Unclaimed also filters by source, and what I tick is saved in `state.json` [NXT-09]. With no sources chosen, it looks in the configured orgs and repos. With neither, it looks in the GitHub repos of my Paseo projects, listed at each refresh through the app's last connection and kept in `state.json` for refreshes before the app connects; with no projects either, it says where to add some [NXT-08]. Unlike the other searches it isn't about me, so it never runs across all of GitHub. They are ordered by priority, then effort, then age [NXT-02]. Priority and effort are org issue fields named in `config.json`; a value ranks by the configured `order` (matched by name, so "Small" matches "🐇 Small (0.5-2d)") or else by the field's own option order in the issue's own org, as two orgs may order a Priority field differently. Issues without a value go last. Each card shows the issue's number and repo, its age, then pills, each an icon half and a value half: the projects it's on with its Status there (a board icon and the project's name), then priority (flag), effort (weight) and scope (layers), values with the org's emoji and notes in brackets trimmed. Pointing at a pill names it ("Priority: P1 High"), and the sheet lists each by name, as phones can't point. Status and priority get a soft fill in the color GitHub has for the option, drawn in GitHub's shade for a dark or light theme (told by the theme's base surface); GRAY is what an option looks like with no color chosen, so it's left plain. Where an org colored none of its priorities, the top two are warm and accent instead. An open PR that closes the issue (`closedByPullRequestsReferences`, from the same search) shows as "PR by alice", without changing the order [NXT-10]. The type is a badge tinted with theme colors. **Close issue** in the sheet asks on the card for the reason (completed or not planned) and an optional comment, then runs `gh issue close`; Undo reopens it [NXT-11]. The Filter button on Unclaimed opens a sheet (a dialog on desktop) with a checkbox per source, per project and per scope; ticks apply right away, all are off at first, and what I tick is saved in `state.json` [NXT-03]. Each project the unclaimed issues are on lists every option of its Status field under it, in the board's order with its color, dimmed where no unclaimed issue has it, plus *No status* where some issue on it has none; *No project* comes last. Ticking a project ticks all its statuses; ticking some shows it partly ticked. An issue shows when any of its projects' ticks is on.
|
|
113
|
+
A second tab lists open issues nobody is assigned to [NXT-01], from the sources chosen under Next up in Settings: my own repos (`user:<login>`, forks left out), orgs I belong to (picked from `viewer.organizations`), and single repos checked on GitHub [NXT-04]. Each source is its own search, so an issue knows which sources found it and no query outgrows GitHub's length limit; one found by several is listed once. With more than one source, the Filter button on Unclaimed also filters by source, and what I tick is saved in `state.json` [NXT-09]. With no sources chosen, it looks in the configured orgs and repos. With neither, it looks in the GitHub repos of my Paseo projects, listed at each refresh through the app's last connection and kept in `state.json` for refreshes before the app connects; with no projects either, it says where to add some [NXT-08]. Unlike the other searches it isn't about me, so it never runs across all of GitHub. They are ordered by priority, then effort, then age [NXT-02]. Priority and effort are org issue fields named in `config.json`; a value ranks by the configured `order` (matched by name, so "Small" matches "🐇 Small (0.5-2d)") or else by the field's own option order in the issue's own org, as two orgs may order a Priority field differently. Issues without a value go last. Each card shows the issue's number and repo, its age, then pills, each an icon half and a value half: the projects it's on with its Status there (a board icon and the project's name), then priority (flag), effort (weight) and scope (layers), values with the org's emoji and notes in brackets trimmed. Pointing at a pill names it ("Priority: P1 High"), and the sheet lists each by name, as phones can't point. Status and priority get a soft fill in the color GitHub has for the option, drawn in GitHub's shade for a dark or light theme (told by the theme's base surface); GRAY is what an option looks like with no color chosen, so it's left plain. Where an org colored none of its priorities, the top two are warm and accent instead. An open PR that closes the issue (`closedByPullRequestsReferences`, from the same search) shows as "PR by alice", without changing the order [NXT-10]. The type is a badge tinted with theme colors. **Close issue** in the sheet asks on the card for the reason (completed or not planned) and an optional comment, then runs `gh issue close`; Undo reopens it [NXT-11]. The Filter button on Unclaimed opens a sheet (a dialog on desktop, its rules in `shared/next-up-filter.ts`) with a checkbox per source, per project and per scope; ticks apply right away, all are off at first, and what I tick is saved in `state.json` [NXT-03]. Each project the unclaimed issues are on lists every option of its Status field under it, in the board's order with its color, dimmed where no unclaimed issue has it, plus *No status* where some issue on it has none; *No project* comes last. Ticking a project ticks all its statuses; ticking some shows it partly ticked. An issue shows when any of its projects' ticks is on.
|
|
114
114
|
|
|
115
115
|
**Projects** [NXT-12] are the open org or user projects an issue's on (`projectItems`, the first 10, archived items left out), with the value of the board's built-in Status field. Boards the token can't see, like an SSO org's, come back empty and are left out. When GitHub cuts the list short and none of the first 10 is open, the issue's boards are unknown: no pill, and a project filter hides it rather than call it on no project. Each board's Status options come once per board, in their own request after the searches (`projectStatusesQuery`), so a board that can't be read costs only its statuses in the filter.
|
|
116
116
|
|
|
@@ -144,7 +144,7 @@ An agent icon (Tabler's `message-ai`, a speech bubble with "AI") marks every act
|
|
|
144
144
|
|
|
145
145
|
A tap starts with defaults. An existing workspace for the branch or PR is resumed instead of creating a new one.
|
|
146
146
|
|
|
147
|
-
While an item has an open session, its main action is **Open session** instead, in every tab [SES-03, ATT-07]. A session belongs to an item when it was started on the item or on any PR under it, and isn't archived; none do once the item is merged or closed. With several, it opens one that needs me, else the most recent. In the sheet each session sits in the line of the action that started it, named after it ("Fix CI", "Rebase stack"), one line per session: a session's kind is saved as the `attention-span-kind` label when it starts. Sessions none of the item's actions would start lead the sheet: those started before kinds were saved, as "Continue session", and those whose action is gone, like Fix CI once checks pass. Sessions started outside Attention Span count too, with no kind, so they lead as "Continue session" [SES-08]: an agent in a workspace Paseo linked to a PR (`githubRuntime.pullRequest`) belongs to that PR, and one in a worktree belongs to the item of the Attention Span session there, unless the worktree has sessions for two items. Main and local checkouts never pass an item on, a labelled session keeps its own item, and agents another agent started belong to that agent. Issues get only the sessions Attention Span started: Paseo doesn't record which issue a workspace was started from. Next up's sheet does the same with Start: "Claim & start…" or "Start…" until there's a session, then the sessions as "Continue session" and a muted "Start another session…". Collapsed, a stack shows only the PRs that need attention [ATT-04]; once it shows any, an issue's card shows the PR its actions apply to as well, tinted with "actions apply here", and says that PR's facts on its row rather than in the meta, as the sheet does [ATT-06].
|
|
147
|
+
While an item has an open session, its main action is **Open session** instead, in every tab [SES-03, ATT-07]. A session belongs to an item when it was started on the item or on any PR under it, and isn't archived; none do once the item is merged or closed. With several, it opens one that needs me, else the most recent. In the sheet each session sits in the line of the action that started it, named after it ("Fix CI", "Rebase stack"), one line per session: a session's kind is saved as the `attention-span-kind` label when it starts. Sessions none of the item's actions would start lead the sheet: those started before kinds were saved, as "Continue session", and those whose action is gone, like Fix CI once checks pass. Sessions started outside Attention Span count too, with no kind, so they lead as "Continue session" [SES-08]: an agent in a workspace Paseo linked to a PR (`githubRuntime.pullRequest`) belongs to that PR, and one in a worktree belongs to the item of the Attention Span session there, unless the worktree has sessions for two items; failing both, one in a worktree belongs to my merged or closed PR whose repo and head branch the worktree is on, the most recently merged or closed if a branch was used twice, and none while an open PR of mine is on that branch (`closedBranches`, from History, my own unmerged closes and a merge done here before History catches up), since Paseo may drop a PR link once it merges [ATT-22]. The poll's pure assembly is `sessionsFrom` in `shared/item-sessions.ts`; `client/sessions.ts` only fetches every page. Main and local checkouts never pass an item on, a labelled session keeps its own item, and agents another agent started belong to that agent. Issues get only the sessions Attention Span started: Paseo doesn't record which issue a workspace was started from. Next up's sheet does the same with Start: "Claim & start…" or "Start…" until there's a session, then the sessions as "Continue session" and a muted "Start another session…". Collapsed, a stack shows only the PRs that need attention [ATT-04]; once it shows any, an issue's card shows the PR its actions apply to as well, tinted with "actions apply here", and says that PR's facts on its row rather than in the meta, as the sheet does [ATT-06].
|
|
148
148
|
|
|
149
149
|
## Sessions
|
|
150
150
|
|
|
@@ -165,6 +165,17 @@ Each session gets its own workspace on an empty scratch directory, so archiving
|
|
|
165
165
|
|
|
166
166
|
The agent asks one question at a time from its kind's checklist, and checks the report against the requirements and docs, `config.json` and `state.json`, and open issues and discussions. A match gets its link and nothing else. It files an issue if a maintainer could finish and close it, otherwise a discussion in Q&A or Ideas, and says which and why. Posts are short up front, with the rest in collapsed `<details>` blocks, in English, in the user's voice, with nothing from their own setup they didn't write. It posts only after Post it in its question tool, or the reply "post" [SAFE-01], then archives its workspace (`archive_workspace`, or `archive_agent` without it). The client watches workspace updates, remembers the scratch ones by their directory, and opens Attention Span when one is removed, instead of leaving "workspace unavailable" on screen. The prompts are built in: `config.json` can't replace them, since they carry those rules.
|
|
167
167
|
|
|
168
|
+
## New issues
|
|
169
|
+
|
|
170
|
+
A new issue in a repository I cover, from anywhere in Paseo [ISS-01]:
|
|
171
|
+
|
|
172
|
+
- **Where it starts**: two Command Center items, and New issue in Next up's Unclaimed header. Paseo lists `global` items everywhere and `agent` items beside them when an agent is focused, so there are two with different meanings rather than one per context: **New issue…** (global) and **New issue from this session…** (agent), which knows the workspace and agent. A Command Center item can't show a sheet of its own (only sidebar items get `openPopover`), so both open the Attention Span screen with `newIssue` (a fresh timestamp), `workspaceId` and `agentId` as its params, and the screen shows the sheet once per timestamp.
|
|
173
|
+
- **The sheet** (`client/new-issue.tsx`): a text box first. Below it, one line says where it goes, with what and with which profile, and opens the choices: repository, whether this session's last messages come along (only from a session), and agent profile. The repositories are the ones covered (`newIssueRepos`, from the server's view): those chosen in Settings and for Next up, my Paseo projects' and shown items' repos under a chosen org or my own account (with My repos), and every shown item's. With nothing chosen, all my projects. It starts on the workspace's repository, then the one Next up's source filter is narrowed to, then the one used last, then the only one there is; the last repository and profile are kept in `state.json` (`new-issue.choice`).
|
|
174
|
+
- **Checkout**: the project whose remote is the repository, or the one `codeRepos` maps it to [SES-05, SES-07]. When there's none, the sheet lists my projects; the pick is saved to `codeRepos`, like Start's. The agent runs in the workspace I came from when it's a checkout of that project, else in the project's own checkout (`workspaces.open` on its root). No new worktree: it only reads.
|
|
175
|
+
- **Context**: from a session, the sheet reads that agent's last timeline page (`timeline.refetch`, `tail`, projected) and keeps its last four messages, mine and the agent's, cut at 800 characters, with its title, workspace and branch. Reading may fail; the rest still goes.
|
|
176
|
+
- **The prompt** (`shared/new-issue.ts`) shares its core with feedback's (`shared/drafting.ts`): one question at a time until a maintainer could act on it, the whole draft before anything is posted, and Post it / Change something / Cancel [SAFE-01]. It reads the code to cite `path:line` and changes nothing; the body goes in a `mktemp -d` file outside the checkout. It follows the repository's issue templates (the checkout's `.github/ISSUE_TEMPLATE/`, else `gh api`; always `gh api` when the checkout is another repository's code [SES-07]), else feedback's skimmable shape, and picks only labels and issue types the repository has. It assigns no one and adds it to no project. A likely duplicate gets its link and File anyway / Comment there instead / Cancel; a comment is drafted and approved the same way [ISS-02]. Once posted, the agent archives itself (`archive_agent`), never the workspace, since that's my checkout. Its title carries a short random tag, "New issue: acme/web (k3x9q)", so it finds itself by exact title and archives nothing if that isn't exactly one agent. Start waits until the workspace I came from and my profiles are known, so it neither falls back to the project's checkout nor drops the remembered profile.
|
|
177
|
+
- The session is labelled `attention-span-item: new-issue:<repo>`, and no tab shows it.
|
|
178
|
+
|
|
168
179
|
## Updates
|
|
169
180
|
|
|
170
181
|
A notice above the list says when a newer version is out, and Update installs it [UPD-01].
|
|
@@ -186,7 +197,7 @@ Light on GitHub's API [GH-01], and quick when I press ⟳. Attention Span has tw
|
|
|
186
197
|
|
|
187
198
|
### Live
|
|
188
199
|
|
|
189
|
-
One GraphQL request per search, sent in parallel. GitHub runs the searches in one request one after another, so a combined request took about 5 seconds where parallel ones take about 2.
|
|
200
|
+
One GraphQL request per search, sent in parallel (`server/fetch.ts`; the service reaches GitHub, Paseo, its files and the clock only through `server/port.ts`, and previews pass a fixture port). GitHub runs the searches in one request one after another, so a combined request took about 5 seconds where parallel ones take about 2.
|
|
190
201
|
|
|
191
202
|
- `is:pr is:open author:@me` (also asks for the viewer's login, and whether auto-merge is on and allowed)
|
|
192
203
|
- `is:pr is:open user-review-requested:@me` (personal requests only)
|
|
@@ -200,13 +211,13 @@ One GraphQL request per search, sent in parallel. GitHub runs the searches in on
|
|
|
200
211
|
|
|
201
212
|
Once my PRs and both issue searches are back, one batched **details** request asks for `Ref.compare` behind counts for my PRs, the open issues their descriptions refer to (at most 100), and the option order and colors of org issue fields when Next up needs them [NXT-02, NXT-10]. The other searches carry on meanwhile.
|
|
202
213
|
|
|
203
|
-
Then, only for PRs whose assignees changed to someone else and issues that left my assigned search, one request per 20 asks for their last 30 assign and unassign events (`assignmentsQuery`) [HIS-07]; and one per 20 for tracked closed PRs that left the closed search asks their state and last reopen event (`reopenQuery`) [HIS-07]; usually none.
|
|
214
|
+
Then, only for PRs whose assignees changed to someone else and issues that left my assigned search, one request per 20 asks for their last 30 assign and unassign events (`assignmentsQuery`) [HIS-07]; and, at the same time, one per 20 for tracked closed PRs that left the closed search asks their state and last reopen event (`reopenQuery`) [HIS-07]; usually none.
|
|
204
215
|
|
|
205
216
|
A live refresh is 10 requests and about 87 points, of the 5,000 GitHub allows per hour. Points depend on how much a query asks for, not how many requests carry it; my PRs (34) and review requests (20) cost the most.
|
|
206
217
|
|
|
207
218
|
### History
|
|
208
219
|
|
|
209
|
-
One request with three searches, each from the Monday `historyWeeks` back: `is:pr is:merged author:@me` (with `mergedBy` [HIS-05]), `is:pr is:merged reviewed-by:@me -author:@me` (with `mergedBy` [HIS-02]), `is:issue is:closed assignee:@me` (with the last close event's actor [HIS-07]), and the viewer's login. Each result brings up to 20 label names, and issues their type [HIS-04]. About 4 points, mostly the label lists.
|
|
220
|
+
One request with three searches, each from midnight on the Monday `historyWeeks` back in the device's time zone, to the second. The screen sends its IANA zone with each request for the list; the server keeps the last one in `state.json`, uses UTC until one comes, uses it for background fetches and for which cleared changes still show, and fetches History again when it changes [HIS-01]: `is:pr is:merged author:@me` (with `mergedBy` [HIS-05]), `is:pr is:merged reviewed-by:@me -author:@me` (with `mergedBy` [HIS-02]), `is:issue is:closed assignee:@me` (with the last close event's actor [HIS-07]), and the viewer's login. Each result brings up to 20 label names, and issues their type [HIS-04]. About 4 points, mostly the label lists.
|
|
210
221
|
|
|
211
222
|
Every search is scoped to the configured orgs and repos; Next up's unclaimed issues as described under Next up.
|
|
212
223
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/index.client.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import { CoverageSettings } from "./client/coverage-settings";
|
|
|
6
6
|
import { useAttention } from "./client/data";
|
|
7
7
|
import { returnFromFeedback } from "./client/feedback";
|
|
8
8
|
import { ICONS } from "./client/icons";
|
|
9
|
+
import { newIssueParams } from "./client/new-issue";
|
|
9
10
|
import { useItemAgents } from "./client/sessions";
|
|
10
11
|
import { doingCount, wrapItems } from "./shared/wrap-up";
|
|
11
12
|
|
|
@@ -38,5 +39,23 @@ export default function contribute(client: PluginClientContext) {
|
|
|
38
39
|
const Screen = (props: PluginScreenProps) => <AttentionScreen {...props} openSettings={() => client.openSettings("coverage")} />;
|
|
39
40
|
client.addScreen({ id: "attention", title: "Attention Span", Component: Screen });
|
|
40
41
|
client.addSidebarHeaderItem({ id: "attention", title: "Attention Span", Component: SidebarItem });
|
|
42
|
+
// A new issue from ⌘K anywhere [ISS-01]. ⌘K can't show a sheet, so it opens the screen with the sheet on it. Paseo lists
|
|
43
|
+
// global items everywhere and agent items beside them, so "from this session" is the one that knows where I am.
|
|
44
|
+
client.addCommandCenterItem({
|
|
45
|
+
id: "new-issue",
|
|
46
|
+
title: "New issue…",
|
|
47
|
+
icon: ICONS.issue,
|
|
48
|
+
context: "global",
|
|
49
|
+
keywords: ["issue", "github", "file", "report", "bug", "idea"],
|
|
50
|
+
onSelect: ({ openScreen }) => openScreen({ screenId: "attention", params: newIssueParams({}) }),
|
|
51
|
+
});
|
|
52
|
+
client.addCommandCenterItem({
|
|
53
|
+
id: "new-issue-from-session",
|
|
54
|
+
title: "New issue from this session…",
|
|
55
|
+
icon: ICONS.issue,
|
|
56
|
+
context: "agent",
|
|
57
|
+
keywords: ["issue", "github", "file", "follow-up", "later"],
|
|
58
|
+
onSelect: ({ openScreen, workspace, agent }) => openScreen({ screenId: "attention", params: newIssueParams({ workspaceId: workspace.id, agentId: agent.id }) }),
|
|
59
|
+
});
|
|
41
60
|
return returnFromFeedback(client);
|
|
42
61
|
}
|