@andrioid/paseo-attention-span 0.8.0 → 0.8.2
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 +5 -5
- package/client/attention-screen.tsx +18 -11
- package/client/icons.ts +2 -0
- package/client/item-actions.ts +8 -4
- package/client/item-row.tsx +3 -1
- package/client/mark.ts +6 -2
- package/client/next-up.tsx +1 -1
- package/docs/architecture.md +3 -3
- 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.png +0 -0
- package/docs/screenshots/desktop-dark-history-filtered.png +0 -0
- package/docs/screenshots/desktop-dark-history-groups.png +0 -0
- package/docs/screenshots/desktop-dark-history.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/desktop-dark-waiting-too-long.png +0 -0
- package/docs/screenshots/desktop-dark-waiting.png +0 -0
- package/docs/screenshots/phone-dark-doing.png +0 -0
- package/docs/screenshots/phone-dark-history.png +0 -0
- package/docs/screenshots/phone-light-next-up-filtered.png +0 -0
- package/index.server.ts +1 -1
- package/package.json +1 -1
- package/server/changes.ts +1 -1
- package/server/classify.ts +9 -2
- package/server/fixture.ts +2 -0
- package/server/service.ts +7 -5
- package/server/store.ts +2 -2
- package/server/view.ts +12 -5
- package/shared/attention.ts +8 -1
- package/shared/item-view.ts +2 -1
- package/shared/rpc.ts +2 -1
package/OVERVIEW.md
CHANGED
|
@@ -10,11 +10,11 @@ This is the tab you'll live in. Items are grouped by reason: someone's waiting f
|
|
|
10
10
|
|
|
11
11
|
At the top is **Wrap up**. It lists merged, closed or handed-off work that still has a Paseo session open. Archive puts the session and its worktree away. It leaves alone worktrees another session still uses, and your own checkout. It also checks for uncommitted or unpushed work first, because there's no Undo.
|
|
12
12
|
|
|
13
|
-

|
|
14
14
|
|
|
15
15
|
Every item has one main button that matches why it's there: Reply, Review, Fix CI, Merge. Open the item to see every action, each with a line saying what it'll do. I wanted buttons you can press without wondering what's about to happen to your repo.
|
|
16
16
|
|
|
17
|
-

|
|
18
18
|
|
|
19
19
|
Mentions clear when you reply or react. Team mentions don't count, because "@everyone-in-backend" isn't really a question for *me*. If something's just an FYI, dismiss it.
|
|
20
20
|
|
|
@@ -24,7 +24,7 @@ This is your work where someone else has the next move: a review you asked for,
|
|
|
24
24
|
|
|
25
25
|
Otherwise there's nothing to do here, and that's kind of the point. It's tracked, so you can stop holding it in your head.
|
|
26
26
|
|
|
27
|
-

|
|
28
28
|
|
|
29
29
|
## Next up
|
|
30
30
|
|
|
@@ -32,7 +32,7 @@ For when your plate is clear. It does happen. Issues assigned to you come first,
|
|
|
32
32
|
|
|
33
33
|
**Start** launches an agent that reads the issue and proposes a plan. **New issue** (also in ⌘K) takes a line or two, and an agent turns that into a proper issue. It checks for duplicates and shows you the result before anything goes to GitHub.
|
|
34
34
|
|
|
35
|
-

|
|
36
36
|
|
|
37
37
|
## History
|
|
38
38
|
|
|
@@ -40,7 +40,7 @@ What you finished in recent weeks, grouped by week. There's a copy button per we
|
|
|
40
40
|
|
|
41
41
|
Things other people did to your work, like merging your PR or taking an issue over, wait at the top until you've seen them. None of it is a to-do, but it shouldn't happen behind your back either.
|
|
42
42
|
|
|
43
|
-

|
|
44
44
|
|
|
45
45
|
## Agent sessions
|
|
46
46
|
|
|
@@ -15,7 +15,7 @@ import { cleanSingle, unreadChanges, wrapItems } from "../shared/wrap-up";
|
|
|
15
15
|
import { nudgeLead, tabCounts } from "../shared/item-view";
|
|
16
16
|
import { useAttention } from "./data";
|
|
17
17
|
import type { IconName } from "./icons";
|
|
18
|
-
import { type Actions, useItemActions } from "./item-actions";
|
|
18
|
+
import { type Actions, type Undoable, useItemActions } from "./item-actions";
|
|
19
19
|
import { Card } from "./item-row";
|
|
20
20
|
import { InProgress } from "./in-progress";
|
|
21
21
|
import { type IssueRowProps, NextUpList } from "./next-up";
|
|
@@ -247,19 +247,14 @@ function AttentionList({
|
|
|
247
247
|
) : !sessionsKnown ? (
|
|
248
248
|
<Loading text="Checking your sessions…" />
|
|
249
249
|
) : null}
|
|
250
|
-
{view.
|
|
251
|
-
<Pressable
|
|
252
|
-
accessibilityRole="button"
|
|
253
|
-
style={clear ? { alignSelf: "center", opacity: 0.7 } : undefined}
|
|
254
|
-
onPress={act.restoreDismissed}
|
|
255
|
-
>
|
|
256
|
-
<Text style={styles.muted}>{view.dismissedCount} dismissed · show them again</Text>
|
|
257
|
-
</Pressable>
|
|
258
|
-
) : null}
|
|
250
|
+
<ShowDismissed count={view.dismissed.doing} undoable={act.undoable} centered={clear} onPress={() => act.restoreDismissed("doing")} />
|
|
259
251
|
</>
|
|
260
252
|
) : null}
|
|
261
253
|
{tab === "waiting" ? (
|
|
262
|
-
|
|
254
|
+
<>
|
|
255
|
+
{calm.waiting ? <Still shore="jetty" title="Nobody's holding you up." line="Nothing to chase." /> : <Waiting groups={view.waiting} actions={actions} />}
|
|
256
|
+
<ShowDismissed count={view.dismissed.waiting} undoable={act.undoable} centered={calm.waiting} onPress={() => act.restoreDismissed("waiting")} />
|
|
257
|
+
</>
|
|
263
258
|
) : null}
|
|
264
259
|
{tab === "next" ? (
|
|
265
260
|
<NextUpList
|
|
@@ -347,6 +342,18 @@ function Sections({ sections, started, actions, issueRow }: { sections: Section[
|
|
|
347
342
|
);
|
|
348
343
|
}
|
|
349
344
|
|
|
345
|
+
// A tab's dismissed items, to bring back; not while the Undo of one just dismissed is still offered. Undo rows go when
|
|
346
|
+
// the tab changes, so the ones showing are this tab's [ATT-08].
|
|
347
|
+
function ShowDismissed({ count, undoable, centered, onPress }: { count: number; undoable: Undoable[]; centered: boolean; onPress: () => void }) {
|
|
348
|
+
const styles = useStyles();
|
|
349
|
+
if (count <= undoable.filter((row) => row.dismissal).length) return null;
|
|
350
|
+
return (
|
|
351
|
+
<Pressable accessibilityRole="button" style={centered ? { alignSelf: "center", opacity: 0.7 } : undefined} onPress={onPress}>
|
|
352
|
+
<Text style={styles.muted}>{count} dismissed · show them again</Text>
|
|
353
|
+
</Pressable>
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
|
|
350
357
|
// Waiting by who it waits on, each with a list to copy for a nudge, oldest first; a bot gets none, as there's nobody to send
|
|
351
358
|
// it to. Last, the work no person holds up. Cards with an active session lead their group [WAI-01, WAI-03].
|
|
352
359
|
function Waiting({ groups, actions }: { groups: WaitingGroup[]; actions: Actions }) {
|
package/client/icons.ts
CHANGED
|
@@ -33,6 +33,8 @@ export const ICONS = {
|
|
|
33
33
|
clock: { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0\"/><path d=\"M12 7v5l3 3\"/></g></svg>" },
|
|
34
34
|
history: { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"M12 8v4l2 2\"/><path d=\"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5\"/></g></svg>" },
|
|
35
35
|
issueClosed: { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0\"/><path d=\"m9 12l2 2l4-4\"/></g></svg>" },
|
|
36
|
+
// Tabler forbid: an issue closed as not planned, like GitHub's mark [HIS-03, HIS-07, NXT-11].
|
|
37
|
+
notPlanned: { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0\"/><path d=\"m9 9l6 6\"/></g></svg>" },
|
|
36
38
|
thumbUp: { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M7 11v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1h3a4 4 0 0 0 4-4V6a2 2 0 0 1 4 0v5h3a2 2 0 0 1 2 2l-1 5a2 3 0 0 1-2 2h-7a3 3 0 0 1-3-3\"/></svg>" },
|
|
37
39
|
star: { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m12 17.75l-6.172 3.245l1.179-6.873l-5-4.867l6.9-1l3.086-6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z\"/></svg>" },
|
|
38
40
|
settings: { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065\"/><path d=\"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0\"/></g></svg>" },
|
package/client/item-actions.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { RpcInput, RpcOutput } from "@getpaseo/plugin";
|
|
|
2
2
|
import { openExternalUrl, type PluginScreenProps, usePaseo, useRpc } from "@getpaseo/plugin/client";
|
|
3
3
|
import { useToast } from "@getpaseo/plugin/client/ui";
|
|
4
4
|
import { useQueryClient } from "@tanstack/react-query";
|
|
5
|
-
import { useState } from "react";
|
|
6
|
-
import type { ActionId, AgentSummary, AttentionView, HistoryFilter, IssueCloseReason, Item, NextUpIssue, Target, WrapItem } from "../shared/attention";
|
|
5
|
+
import { useRef, useState } from "react";
|
|
6
|
+
import type { ActionId, AgentSummary, AttentionView, DismissTab, HistoryFilter, IssueCloseReason, Item, NextUpIssue, Target, WrapItem } from "../shared/attention";
|
|
7
7
|
import type { AttentionConfig, SessionKind } from "../shared/config";
|
|
8
8
|
import { summarizeRerun } from "../shared/checks";
|
|
9
9
|
import { ALL_NOTES, ALL_WRAP } from "../shared/got-it";
|
|
@@ -124,6 +124,8 @@ export function useItemActions(attention: ReturnType<typeof useAttention>, navig
|
|
|
124
124
|
// makes a Wrap up row go away after its screenshot [ATT-22].
|
|
125
125
|
const [archivedSessions, setArchivedSessions] = useState<ReadonlySet<string>>(new Set());
|
|
126
126
|
const [undoable, setUndoable] = useState<Undoable[]>([]);
|
|
127
|
+
// Bumped when the tab changes and its Undo rows go, so a change still running then adds none to the next tab [ATT-08].
|
|
128
|
+
const undoTab = useRef(0);
|
|
127
129
|
const [placing, setPlacing] = useState<Placing | null>(null);
|
|
128
130
|
const [options, setOptions] = useState<OptionsSpec | null>(null);
|
|
129
131
|
const view = attention.data;
|
|
@@ -142,9 +144,11 @@ export function useItemActions(attention: ReturnType<typeof useAttention>, navig
|
|
|
142
144
|
// A change from one tap, without confirming: Undo instead, where it can be taken back [SAFE-01, ATT-08, ATT-14].
|
|
143
145
|
// The server answers each with the list after it, so nothing needs a refresh.
|
|
144
146
|
function change(key: string, label: string, work: () => Promise<AttentionView>, done: string, undo?: () => Promise<AttentionView>, dismissal?: boolean) {
|
|
147
|
+
const tab = undoTab.current;
|
|
145
148
|
void run(key, label, async () => {
|
|
146
149
|
attention.setView(await work());
|
|
147
150
|
if (!undo) return toast.show(done, { variant: "success" });
|
|
151
|
+
if (tab !== undoTab.current) return;
|
|
148
152
|
const id = Date.now() + Math.random();
|
|
149
153
|
setUndoable((rows) => [...rows, { id, text: done, undo: async () => attention.setView(await undo()), dismissal }]);
|
|
150
154
|
});
|
|
@@ -386,13 +390,13 @@ export function useItemActions(attention: ReturnType<typeof useAttention>, navig
|
|
|
386
390
|
busy,
|
|
387
391
|
archivedSessions,
|
|
388
392
|
undoable,
|
|
389
|
-
clearUndo: () => setUndoable([]),
|
|
393
|
+
clearUndo: () => ((undoTab.current += 1), setUndoable([])),
|
|
390
394
|
undo: (row: Undoable) =>
|
|
391
395
|
void run(String(row.id), "Undo", async () => {
|
|
392
396
|
await row.undo();
|
|
393
397
|
setUndoable((rows) => rows.filter((other) => other.id !== row.id));
|
|
394
398
|
}),
|
|
395
|
-
restoreDismissed: () => void run("restore", "Restore", async () => (attention.setView(await restore({})), setUndoable([]))),
|
|
399
|
+
restoreDismissed: (tab: DismissTab) => void run("restore", "Restore", async () => (attention.setView(await restore({ tab })), setUndoable([]))),
|
|
396
400
|
placing,
|
|
397
401
|
place,
|
|
398
402
|
cancelPlacing: () => setPlacing(null),
|
package/client/item-row.tsx
CHANGED
|
@@ -233,7 +233,9 @@ function ItemSheet({ item, waitChips, sessions, actions, ...handlers }: { item:
|
|
|
233
233
|
const elsewhere = !!targetUrl(item);
|
|
234
234
|
// The row of the PR its actions apply to, where it's in the stack line: marked there instead of named on top.
|
|
235
235
|
const targetRow = elsewhere ? item.children.find((child) => child.url === item.target.url) : undefined;
|
|
236
|
-
|
|
236
|
+
// How it finished, as its card says it ("closed 1d ago by bob as not planned"), so the sheet keeps the close reason [HIS-07].
|
|
237
|
+
const when = cardWhen(item);
|
|
238
|
+
const meta = [...(when ? [when] : []), ...(elsewhere && !targetRow ? [`actions apply to PR #${item.target.number}`] : [])];
|
|
237
239
|
// PRs already in the stack line link from there; list only the rest, like someone else's PR closing the same issue.
|
|
238
240
|
const shown = new Set(item.children.map((child) => child.url));
|
|
239
241
|
const extra = details.data && { ...details.data, linked: details.data.linked.filter((link) => !shown.has(link.url)) };
|
package/client/mark.ts
CHANGED
|
@@ -16,6 +16,10 @@ export function stackMark(row: Pick<SubRow, "state" | "draft" | "mergedAt">): Ca
|
|
|
16
16
|
return prStateMark(row.state ?? (row.mergedAt ? "MERGED" : row.draft ? "DRAFT" : "OPEN"));
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
// An issue closed as completed is done like a merged PR, in GitHub's purple; one closed as not planned was set aside.
|
|
20
|
+
const issueClosedMark = (notPlanned: boolean): CardProps["mark"] =>
|
|
21
|
+
notPlanned ? { icon: "notPlanned", tone: "neutral" } : { icon: "issueClosed", tone: "good", color: "PURPLE" };
|
|
22
|
+
|
|
19
23
|
// What the card is: open, draft, merged or closed. Urgency stays in the chips and section headers.
|
|
20
24
|
// A note on what someone else did shows what happened instead; its words say it too, so color isn't the only sign [HIS-07].
|
|
21
25
|
export function stateMark(item: Item): CardProps["mark"] {
|
|
@@ -24,12 +28,12 @@ export function stateMark(item: Item): CardProps["mark"] {
|
|
|
24
28
|
const kind = item.change.kind;
|
|
25
29
|
if (kind === "merged") return prStateMark("MERGED");
|
|
26
30
|
if (kind === "closed") return prStateMark("CLOSED");
|
|
27
|
-
if (kind === "issue_closed") return item.change.reason === "not_planned"
|
|
31
|
+
if (kind === "issue_closed") return issueClosedMark(item.change.reason === "not_planned");
|
|
28
32
|
if (kind === "reopened") return { icon: "pr", tone: "warn" };
|
|
29
33
|
return { icon: kind === "unassigned" ? "userMinus" : "userShare", tone: "warn" };
|
|
30
34
|
}
|
|
31
35
|
if (item.kind === "pr" && item.closedUnmerged) return prStateMark("CLOSED");
|
|
32
|
-
if (item.closedAt) return item.kind === "pr" ? prStateMark("MERGED") :
|
|
36
|
+
if (item.closedAt) return item.kind === "pr" ? prStateMark("MERGED") : issueClosedMark(!!item.notPlanned);
|
|
33
37
|
if (item.kind === "issue") return { icon: "issue", tone: "good" };
|
|
34
38
|
return prStateMark(item.draft ? "DRAFT" : "OPEN");
|
|
35
39
|
}
|
package/client/next-up.tsx
CHANGED
|
@@ -231,7 +231,7 @@ export function IssueRow({ issue, claim, first, agents, login, busy, fetchDetail
|
|
|
231
231
|
comment: true,
|
|
232
232
|
choices: [
|
|
233
233
|
{ label: "Completed", icon: "issueClosed", solid: true, onConfirm: close("completed") },
|
|
234
|
-
{ label: "Not planned", icon: "
|
|
234
|
+
{ label: "Not planned", icon: "notPlanned", onConfirm: close("not_planned") },
|
|
235
235
|
],
|
|
236
236
|
onCancel: () => setClosing(false),
|
|
237
237
|
}
|
package/docs/architecture.md
CHANGED
|
@@ -49,7 +49,7 @@ The tabs tell the story of my work, left to right: what I finished, what needs m
|
|
|
49
49
|
|
|
50
50
|
| Tab | Shows |
|
|
51
51
|
|---|---|
|
|
52
|
-
| 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
|
+
| 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 closed issue's tile is the closed-issue check in GitHub's purple, like a merged PR, when completed, and a grey circle-slash when not planned, both in the weeks and in the notes; one closed as not planned says so once, in its line ("closed 1d ago by bob as not planned"), and Next up's Not planned button wears the same circle-slash. 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. |
|
|
53
53
|
| Doing | The sections below |
|
|
54
54
|
| 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 words are the last from a person, bots don't count, and my words since someone else last spoke tag someone or 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. On an issue I opened, its opening is my first words, when the fetched comments reach back to it. With `onlyQuestionsWait` on (Settings → Waiting → Only questions wait, off by default) a statement waits on nobody, tagged or not; with it off, a tagged statement waits on whom it tags. An untagged statement 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 or tag, the people and teams my words 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; bots aren't tags: GitHub links no app (`@github-actions`), links some to an organization (`@dependabot`), which is nobody to nudge, and `@renovate[bot]` to a user followed by `[bot]`, and all of those are skipped; 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, question or tagged; 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. |
|
|
55
55
|
| Next up | *Assigned to you* [NXT-06], then *Unclaimed* [NXT-01] |
|
|
@@ -100,7 +100,7 @@ Top to bottom. Each item appears once, under its most urgent reason [ATT-02]. `s
|
|
|
100
100
|
- **Wrap up** [ATT-22] (`shared/wrap-up.ts`, drawn by `client/wrap-up.tsx`) uses the shared `ActionSheet` on every card-body or Details tap, including close-issue prompts and kept worktrees [ATT-06]. PR cards and linked stack rows share state marks: open green, draft muted, closed unmerged red and merged purple; each stack row uses its own state, with merge timestamps supporting older saved rows. Cards show their main action and one Details chevron; Keep open and Dismiss live in the sheet. Close-issue prompts also offer the shared Start a session / Start another session entry, opening the usual session options on the issue. Their navigation lists all matching sessions, including working sessions; archive eligibility stays separate. Item sheets reuse the detail query, hover prefetch, session entries, linked-PR rows (`client/stack.tsx`) and GitHub links from the other tabs; cleanup is an explicit action, with unsaved-work and terminal confirmations kept separate. Wrap up 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.
|
|
101
101
|
- **Close #12?** [ATT-24] (`classifyCloseAsks` in `server/classify.ts`): after History's searches, the issues my merged PRs close, by GitHub's link or a closing keyword, that History doesn't know closed (`mergedToLookUp` in `server/references.ts`, at most 100) are looked up, a batch per request, for their state and the open PRs GitHub links to them, anyone's. A merged PR is put under an issue as `issueFor` picks one, counting History's closed issues as issues so a PR that closed one isn't put under another it also closes. An issue that's open, with no linked PR open, is asked about (`asks` in `state.json`'s History); as History is fetched daily, each live refresh looks the asked issues up again (`askOff`, one batched request while any is asked; one that can't be looked up keeps asking); the view leaves out one with a PR of mine open under it in the live feed (a mention or answer on the issue alone doesn't count), one Next up knows has anyone's PR open, one the live lookup found closed or with a PR open, one whose latest merge is older than History's weeks, one kept open (`keptOpen`: the latest merge then, so a later one asks again; kept for History's weeks, so an ask missing from one fetch doesn't lose it) and one I just closed. Closing goes through `rpc.closeIssue`, its done item carrying the merged PRs with their branches, so a session linked by branch keeps its row, whether the issue is assigned to me or not; as History's search only finds closed issues assigned to me, it's kept in `closedAsks` for History's weeks, listed in History with its PRs under it rather than alone, and Undo forgets it; Next up's card gets a "PRs merged" pill (`prsMerged`).
|
|
102
102
|
|
|
103
|
-
- **Dismiss** [ATT-08] hides an item until someone other than me comments, reviews or pushes, or its reason changes. My
|
|
103
|
+
- **Dismiss** [ATT-08], in the sheet of Doing and Waiting items, hides an item until someone other than me comments, reviews or pushes, or its reason changes. It also comes back when I add to it: my new words on a thread, or a push, review reply or conversation comment on my PR; a comment, like a nudge, doesn't restart the wait's age (`mineAt` on the item). My other actions and CI reruns don't bring it back. A PR of mine in both Doing and Waiting is one item, hidden from both. Doing and Waiting each say how many of theirs are dismissed, "n dismissed · show them again", and bring back only theirs.
|
|
104
104
|
- **Behind base** [UPS-07] only matters when:
|
|
105
105
|
1. the PR conflicts with its base,
|
|
106
106
|
2. a stacked PR no longer builds on its parent's head,
|
|
@@ -120,7 +120,7 @@ Projects are extra, so they never cost the searches they ride on (`server/projec
|
|
|
120
120
|
|
|
121
121
|
## Actions
|
|
122
122
|
|
|
123
|
-
A card shows its main action and ›. Tapping the card or › opens its **sheet**, a bottom sheet on phones and a dialog on desktop [ATT-06]. When the sheet would hold a single action, as on
|
|
123
|
+
A card shows its main action and ›. Tapping the card or › opens its **sheet**, a bottom sheet on phones and a dialog on desktop [ATT-06]. When the sheet would hold a single action, as on History cards where it's only Open PR (or issue) on GitHub, the card shows that action instead of ›; Doing and Waiting cards always have Dismiss too, so they show ›; tapping the card still opens the sheet. History cards also have a copy icon that copies the item's URL [ATT-15]. Top to bottom, the sheet has:
|
|
124
124
|
|
|
125
125
|
1. **What the card knows:** repo#number, its chips, the full quote and the full stack. Each PR in the stack opens on GitHub, so an issue's PRs are a tap away [ATT-12]. On an issue, the PR its actions apply to is tinted in the stack and says "actions apply here", and its chips are said once, on its row: the top keeps only what the row doesn't say [ATT-04].
|
|
126
126
|
2. **Every action,** each with a line saying what it will do, in one list, with what takes the item off my list or gives it up (Dismiss, Unclaim, Close issue, Close PR) apart below the work, icons quiet. A session action's line asks first: it ends in "…" and opens Options, since the card's button is the one-tap start [SES-01, SES-02]. Once a session of that kind runs, the line opens it instead and shows its state as a badge (working, idle, needs you, failed) [SES-03, ATT-07]. Then Open issue or Open PR on GitHub [ATT-12], with a copy icon at its end that copies the URL without adding a line [ATT-15]. An issue with a PR splits that line in two halves of the same weight, "Open issue #90" and "Open PR #103 · 1 of 2", each with its own copy icon, side by side on desktop and one above the other on phones: the PR is the one its actions apply to (in Next up, the first open PR against it), so reaching it doesn't mean going through the issue on GitHub. Then a muted "Start a session…" ("Start another session…" once there is one) for a session with no action preset [SES-02], and Dismiss [ATT-08].
|
|
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.server.ts
CHANGED
|
@@ -77,7 +77,7 @@ export default function contribute(server: PluginServerContext) {
|
|
|
77
77
|
return ready(() => attention.dismissKept(workspaceId)).then(shown);
|
|
78
78
|
});
|
|
79
79
|
server.on("workspace.archived", ({ workspace }) => void ready(() => attention.forgetKept(workspace.id)));
|
|
80
|
-
server.handle(rpc.restoreDismissed, () => ready(() => attention.restoreDismissed()).then(shown));
|
|
80
|
+
server.handle(rpc.restoreDismissed, ({ tab }) => ready(() => attention.restoreDismissed(tab)).then(shown));
|
|
81
81
|
server.handle(rpc.setCodeRepo, ({ issueRepo, codeRepo }) => ready(() => attention.setCodeRepo(issueRepo, codeRepo)).then(shown));
|
|
82
82
|
server.handle(rpc.setupStatus, () => setupStatus(store, answers.ghStatus));
|
|
83
83
|
server.handle(rpc.getCoverage, () => configStatus(store));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrioid/paseo-attention-span",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "For when your attention is spread thin: the GitHub issues and pull requests waiting on you, grouped by why, with one-tap Paseo sessions.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
package/server/changes.ts
CHANGED
|
@@ -322,7 +322,7 @@ export function changeItems(ledger: ChangeLedger, now: Date, windowDays: number,
|
|
|
322
322
|
change: undefined,
|
|
323
323
|
...(change.kind === "merged" && change.actor ? { mergedBy: change.actor } : {}),
|
|
324
324
|
...(change.kind === "issue_closed" && change.actor ? { closedBy: change.actor } : {}),
|
|
325
|
-
...(change.reason === "not_planned" ? { notPlanned: true as const
|
|
325
|
+
...(change.reason === "not_planned" ? { notPlanned: true as const } : {}),
|
|
326
326
|
}),
|
|
327
327
|
);
|
|
328
328
|
return { notes, history, finished };
|
package/server/classify.ts
CHANGED
|
@@ -46,6 +46,7 @@ interface Part {
|
|
|
46
46
|
waitingOn?: WaitingOn[];
|
|
47
47
|
wait?: Item["wait"];
|
|
48
48
|
othersActivityAt: string;
|
|
49
|
+
mineAt?: string;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
const EPOCH = "1970-01-01T00:00:00Z";
|
|
@@ -137,6 +138,8 @@ function prState(
|
|
|
137
138
|
// Requested changes stay mine until I push after them.
|
|
138
139
|
changes: onMe.length > 0 || (pr.reviewDecision === "CHANGES_REQUESTED" && !(lastCommitAt > changesRequestedAt)),
|
|
139
140
|
repliedAt: latest(...unresolved.filter((thread) => isMe(last(thread)?.author)).map((thread) => last(thread)?.createdAt)),
|
|
141
|
+
// My last conversation comment, like a nudge: it brings a dismissed PR back, but doesn't restart its wait [ATT-08].
|
|
142
|
+
commentedAt: latest(...pr.comments.nodes.filter((c) => isMe(c.author)).map((c) => c.createdAt)),
|
|
140
143
|
lastCommitAt,
|
|
141
144
|
behindBy,
|
|
142
145
|
// A stacked PR no longer builds on its parent's latest version [UPS-02].
|
|
@@ -296,6 +299,7 @@ export function classify({ data, details, config, now }: ClassifyInput): Attenti
|
|
|
296
299
|
(section === "changes" && s.botThreadsOnly ? { login: "review bot", bot: true, since: s.lastCommitAt, role: "changes" as const } : undefined),
|
|
297
300
|
waitingOn: waitingOn.length > 0 ? waitingOn : undefined,
|
|
298
301
|
othersActivityAt: latest(...stack.map((pr) => state(pr).othersActivityAt), waiting?.since, answer?.since),
|
|
302
|
+
mineAt: latest(waitingSince, ...stack.map((pr) => state(pr).commentedAt)),
|
|
299
303
|
};
|
|
300
304
|
};
|
|
301
305
|
|
|
@@ -337,6 +341,7 @@ export function classify({ data, details, config, now }: ClassifyInput): Attenti
|
|
|
337
341
|
wait: lead.wait ?? other?.wait,
|
|
338
342
|
chips: [...lead.chips, ...(stack.length > 1 ? [chip(`stack of ${stack.length}`)] : [])],
|
|
339
343
|
othersActivityAt: latest(lead.othersActivityAt, other?.othersActivityAt),
|
|
344
|
+
mineAt: latest(lead.mineAt, other?.mineAt),
|
|
340
345
|
};
|
|
341
346
|
});
|
|
342
347
|
type Unit = (typeof units)[number];
|
|
@@ -408,6 +413,7 @@ export function classify({ data, details, config, now }: ClassifyInput): Attenti
|
|
|
408
413
|
// Actions on GitHub act on my PRs, from my bottom one; Review checks out the top of the stack [ATT-04].
|
|
409
414
|
target: target(unit.own[0] ?? bottom, unit.stack),
|
|
410
415
|
othersActivityAt: latest(...grouped.map((u) => u.othersActivityAt), issueWaiting?.since),
|
|
416
|
+
mineAt: latest(...grouped.map((u) => u.mineAt)),
|
|
411
417
|
});
|
|
412
418
|
}
|
|
413
419
|
|
|
@@ -438,8 +444,9 @@ export function classify({ data, details, config, now }: ClassifyInput): Attenti
|
|
|
438
444
|
waitingOn: section !== "answered" && tagged.length > 0 ? tagged : undefined,
|
|
439
445
|
wait: section === "answered" ? undefined : { reason: flags.question ? "question" : "tagged", since, ...(tooLong ? { tooLong } : {}) },
|
|
440
446
|
actions: section === "answered" ? replyActions(person) : [],
|
|
441
|
-
// A new answer brings back a dismissed one [ATT-08].
|
|
447
|
+
// A new answer brings back a dismissed one, and so do my new words [ATT-08].
|
|
442
448
|
othersActivityAt: person ? latest(...(person.comments ?? []).map((c) => c.createdAt)) : EPOCH,
|
|
449
|
+
mineAt: mine,
|
|
443
450
|
});
|
|
444
451
|
}
|
|
445
452
|
|
|
@@ -475,7 +482,7 @@ export function classifyHistory(data: HistoryResult): Item[] {
|
|
|
475
482
|
// Who closed it, when it wasn't me [HIS-07].
|
|
476
483
|
const closer = issue.timelineItems?.nodes.at(-1)?.actor?.login;
|
|
477
484
|
const closedBy = closer && me && closer.toLowerCase() !== me ? { closedBy: closer } : {};
|
|
478
|
-
const item = kinded({ ...plain(issue, "issue", "done"), closedAt: issue.closedAt, chips:
|
|
485
|
+
const item = kinded({ ...plain(issue, "issue", "done"), closedAt: issue.closedAt, chips: [], ...closedBy, ...(notPlanned ? { notPlanned: true as const } : {}) }, issue);
|
|
479
486
|
// Not planned issues get no PRs under them: the PRs were still done, so they're listed on their own [HIS-03].
|
|
480
487
|
if (!notPlanned) closed.set(prKey(issue), item);
|
|
481
488
|
items.push(item);
|
package/server/fixture.ts
CHANGED
|
@@ -374,6 +374,8 @@ export function fixtureChanges(now: Date): OthersChange[] {
|
|
|
374
374
|
event("took_over", "pr", 186, "Split the invoice PDF job", 5, "phil", "phil"),
|
|
375
375
|
{ ...event("issue_closed", "issue", 188, "Export fails on empty months", 6, "alice"), reason: "completed" as const },
|
|
376
376
|
event("closed", "pr", 169, "Cache exchange rates", 26, "alice"),
|
|
377
|
+
// Closed as not planned, so History shows both closed-issue marks side by side [HIS-07].
|
|
378
|
+
{ ...event("issue_closed", "issue", 187, "Import contacts from the old CRM", 30, "bob"), reason: "not_planned" as const },
|
|
377
379
|
event("handed", "pr", 179, "Move invoices to the new queue", 96, "dave", "carol"),
|
|
378
380
|
event("unassigned", "issue", 160, "Refunds skip the ledger", 192, "bob"),
|
|
379
381
|
event("closed", "pr", 170, "Drop the legacy CSV import", 216, "bob"),
|
package/server/service.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Attention, type AttentionView, baseItem, type CloseAsk, type FeedId, type FeedStatus, type HistoryFilter, type Item, memberKeys, type ProjectsAccess, type Reviewer } from "../shared/attention";
|
|
1
|
+
import { type Attention, type AttentionView, baseItem, type CloseAsk, type DismissTab, type FeedId, type FeedStatus, type HistoryFilter, type Item, memberKeys, type ProjectsAccess, type Reviewer } from "../shared/attention";
|
|
2
2
|
import type { PluginHandlerContext } from "@getpaseo/plugin/server";
|
|
3
3
|
import { AttentionConfig, type FieldRole } from "../shared/config";
|
|
4
4
|
import { newIssueRepos } from "../shared/new-issue";
|
|
@@ -12,7 +12,7 @@ import type { Port } from "./port";
|
|
|
12
12
|
import { historySince, isTimeZone, type UnclaimedSearch, unclaimedSearches } from "./queries";
|
|
13
13
|
import type { Details, LiveResult, ReferencedIssue } from "./github-types";
|
|
14
14
|
import { State } from "./store";
|
|
15
|
-
import { applyPending, buildView, doneItem, type Effect, isPending, type Pending, SETTLE_MS } from "./view";
|
|
15
|
+
import { applyPending, buildView, dismissedIn, doneItem, type Effect, isPending, type Pending, SETTLE_MS } from "./view";
|
|
16
16
|
import { keySet, uniqueKeys } from "../shared/names";
|
|
17
17
|
|
|
18
18
|
// History changes only when I finish something, so it's fetched daily, on ⟳ in its tab and after a merge.
|
|
@@ -102,7 +102,7 @@ export class AttentionService {
|
|
|
102
102
|
async dismiss(key: string): Promise<AttentionView> {
|
|
103
103
|
const item = this.items().find((candidate) => candidate.key === key);
|
|
104
104
|
if (item) {
|
|
105
|
-
this.state.dismissed[key] = { at: item.othersActivityAt, section: item.section };
|
|
105
|
+
this.state.dismissed[key] = { at: item.othersActivityAt, section: item.section, ...(item.mineAt ? { mine: item.mineAt } : {}) };
|
|
106
106
|
await this.save();
|
|
107
107
|
}
|
|
108
108
|
return this.view();
|
|
@@ -133,8 +133,10 @@ export class AttentionService {
|
|
|
133
133
|
return this.view();
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
// A tab's dismissed items, or all of them [ATT-08].
|
|
137
|
+
async restoreDismissed(tab?: DismissTab): Promise<AttentionView> {
|
|
138
|
+
if (!tab) this.state.dismissed = {};
|
|
139
|
+
else for (const key of dismissedIn(this.items(), this.state.dismissed, tab)) delete this.state.dismissed[key];
|
|
138
140
|
await this.save();
|
|
139
141
|
return this.view();
|
|
140
142
|
}
|
package/server/store.ts
CHANGED
|
@@ -19,8 +19,8 @@ export const OLD_DIR = CHOSEN_DIR ? undefined : join(homedir(), ".config", "pase
|
|
|
19
19
|
const knownSections = (items: unknown): boolean => Array.isArray(items) && items.every((item) => Object.hasOwn(SECTIONS, (item as Item)?.section));
|
|
20
20
|
|
|
21
21
|
export const State = z.object({
|
|
22
|
-
// Item key -> others' activity and
|
|
23
|
-
dismissed: z.record(z.string(), z.object({ at: z.string(), section: z.custom<SectionId>() })).default({}),
|
|
22
|
+
// Item key -> others' activity, section, and my latest words or push, when dismissed [ATT-08].
|
|
23
|
+
dismissed: z.record(z.string(), z.object({ at: z.string(), section: z.custom<SectionId>(), mine: z.string().optional() })).default({}),
|
|
24
24
|
// Item key -> what I just changed on GitHub, until a fetch shows it [FRESH-02].
|
|
25
25
|
pending: z.record(z.string(), z.custom<Pending>((value) => typeof (value as Pending)?.at === "string" && !!(value as Pending)?.effect)).default({}).catch({}),
|
|
26
26
|
// Scopes ticked in Next up's filter; none means all [NXT-03].
|
package/server/view.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Attention, type AttentionView, baseItem, type Chip, type CloseAsk, type FeedId, type FeedStatus, type HistoryFilter, type Item, type NextUpIssue, type Section, SECTION_ORDER, SECTIONS, type TabId, type WaitingGroup } from "../shared/attention";
|
|
1
|
+
import { type Attention, type AttentionView, baseItem, type Chip, type CloseAsk, type DismissTab, type FeedId, type FeedStatus, type HistoryFilter, type Item, type NextUpIssue, type Section, SECTION_ORDER, SECTIONS, type TabId, type WaitingGroup } from "../shared/attention";
|
|
2
2
|
import type { AttentionConfig } from "../shared/config";
|
|
3
3
|
import type { KeptRow } from "../shared/archive";
|
|
4
4
|
import type { NewIssueInfo } from "../shared/new-issue";
|
|
@@ -64,7 +64,7 @@ export function doneItem(source: Item | NextUpIssue, closedAt: string, notPlanne
|
|
|
64
64
|
return {
|
|
65
65
|
...base,
|
|
66
66
|
target: { ...base.target, ...head },
|
|
67
|
-
chips:
|
|
67
|
+
chips: work ? [workChip(work)] : [],
|
|
68
68
|
...(work ? { work } : {}),
|
|
69
69
|
...(notPlanned ? { notPlanned: true as const } : {}),
|
|
70
70
|
// Not planned issues list their PRs on their own, as classifyHistory does [HIS-03].
|
|
@@ -93,10 +93,17 @@ export function applyPending(attention: Attention | null, history: Item[], pendi
|
|
|
93
93
|
return { attention: { ...attention, items, assigned, unclaimed }, history: [...done, ...history] };
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
// A dismissed item stays hidden until someone else does something on it
|
|
96
|
+
// A dismissed item stays hidden until someone else does something on it, its reason changes, or I add words or push to it
|
|
97
|
+
// [ATT-08].
|
|
97
98
|
export function isDismissed(item: Item, dismissed: State["dismissed"]): boolean {
|
|
98
99
|
const entry = dismissed[item.key];
|
|
99
|
-
return !!entry && entry.section === item.section && item.othersActivityAt <= entry.at;
|
|
100
|
+
return !!entry && entry.section === item.section && item.othersActivityAt <= entry.at && !(entry.mine && item.mineAt && item.mineAt > entry.mine);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// The keys of a tab's dismissed items: Doing's, or Waiting's, where my Doing PRs that wait on others are too [ATT-08, PRS-15].
|
|
104
|
+
export function dismissedIn(items: Item[], dismissed: State["dismissed"], tab: DismissTab): string[] {
|
|
105
|
+
const inTab = tab === "doing" ? (item: Item) => SECTIONS[item.section].tab === "doing" : inWaiting;
|
|
106
|
+
return items.filter((item) => inTab(item) && isDismissed(item, dismissed)).map((item) => item.key);
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
// Waiting by who it waits on, so I know whom to nudge: whoever blocks the most first, ties by the longest wait, then bots, who
|
|
@@ -185,6 +192,6 @@ export function buildView(attention: Attention | null, fetched: Item[], dismisse
|
|
|
185
192
|
unclaimed: marked(attention?.unclaimed ?? []),
|
|
186
193
|
unclaimedFrom: attention?.unclaimedFrom ?? "config",
|
|
187
194
|
projects: attention?.projects ?? [],
|
|
188
|
-
|
|
195
|
+
dismissed: { doing: dismissedIn(items, dismissed, "doing").length, waiting: dismissedIn(items, dismissed, "waiting").length },
|
|
189
196
|
};
|
|
190
197
|
}
|
package/shared/attention.ts
CHANGED
|
@@ -254,6 +254,9 @@ export interface Item {
|
|
|
254
254
|
target: Target;
|
|
255
255
|
// Latest activity by someone else, for bringing back dismissed items [ATT-08].
|
|
256
256
|
othersActivityAt: string;
|
|
257
|
+
// My latest words or push on it, which bring back a dismissed wait too: my comments on a thread, or a push, review reply or
|
|
258
|
+
// conversation comment on my PR [ATT-08].
|
|
259
|
+
mineAt?: string;
|
|
257
260
|
// History only: when it merged or closed.
|
|
258
261
|
closedAt?: string;
|
|
259
262
|
// History only: what kind of work it was, when that can be told [HIS-04].
|
|
@@ -515,6 +518,9 @@ export interface FeedStatus {
|
|
|
515
518
|
error: string | null;
|
|
516
519
|
}
|
|
517
520
|
|
|
521
|
+
// The tabs whose items can be dismissed [ATT-08].
|
|
522
|
+
export type DismissTab = "doing" | "waiting";
|
|
523
|
+
|
|
518
524
|
// What the client renders: dismissed items removed, grouped per tab.
|
|
519
525
|
export interface AttentionView {
|
|
520
526
|
feeds: Record<FeedId, FeedStatus>;
|
|
@@ -537,7 +543,8 @@ export interface AttentionView {
|
|
|
537
543
|
unclaimedFrom: UnclaimedSource;
|
|
538
544
|
// The projects Next up's issues are on [NXT-03, NXT-12].
|
|
539
545
|
projects: ProjectInfo[];
|
|
540
|
-
|
|
546
|
+
// How many of each tab's items are dismissed, for its "show them again" [ATT-08].
|
|
547
|
+
dismissed: Record<DismissTab, number>;
|
|
541
548
|
// Scopes ticked in Next up's filter; none means all [NXT-03].
|
|
542
549
|
scopes: string[];
|
|
543
550
|
// Sources ticked in Next up's filter; none means all [NXT-09].
|
package/shared/item-view.ts
CHANGED
|
@@ -125,7 +125,8 @@ export function sheetPlan(item: Item, sessions: AgentSummary[]): SheetStep[] {
|
|
|
125
125
|
steps.push({ kind: "github", ...(pr ? { pr } : {}) });
|
|
126
126
|
// Nothing's left to start on once it's merged or closed, or out of my hands; a note is cleared with Got it, not dismissed [HIS-07].
|
|
127
127
|
if (!item.closedAt && !item.change) steps.push({ kind: "start", any: sessions.length > 0, session: fallbackKind(item) });
|
|
128
|
-
|
|
128
|
+
// Doing and Waiting can be dismissed, apart at the bottom; History and Next up can't [ATT-08].
|
|
129
|
+
if ((SECTIONS[item.section].tab === "doing" || SECTIONS[item.section].tab === "waiting") && !item.change) steps.push({ kind: "dismiss" });
|
|
129
130
|
return steps;
|
|
130
131
|
}
|
|
131
132
|
|
package/shared/rpc.ts
CHANGED
|
@@ -50,7 +50,8 @@ export const archiveWorktree = defineRpc({
|
|
|
50
50
|
output: z.custom<ArchiveOutcome>(),
|
|
51
51
|
});
|
|
52
52
|
export const dismissKept = defineRpc({ name: "attention.dismiss-kept", input: z.object({ workspaceId: z.string() }), output: view });
|
|
53
|
-
|
|
53
|
+
// One tab's dismissed items back, or every tab's [ATT-08].
|
|
54
|
+
export const restoreDismissed = defineRpc({ name: "attention.restore-dismissed", input: z.object({ tab: z.enum(["doing", "waiting"]).optional() }), output: view });
|
|
54
55
|
// Adds one entry to codeRepos in config.json [SES-07].
|
|
55
56
|
export const setCodeRepo = defineRpc({ name: "config.set-code-repo", input: z.object({ issueRepo: z.string(), codeRepo: z.string() }), output: view });
|
|
56
57
|
// What the setup checklist shows when nothing loads [SET-01].
|