@andrioid/paseo-attention-span 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/OVERVIEW.md +4 -0
- package/client/attention-screen.tsx +13 -2
- package/client/history.tsx +5 -0
- package/client/next-up.tsx +16 -2
- package/client/still.tsx +70 -27
- package/docs/screenshots/desktop-dark-next-up-setup.png +0 -0
- package/package.json +2 -1
- package/requirements.yaml +3 -0
- package/server/fixture.ts +15 -0
- package/server/service.ts +4 -4
- package/shared/still.ts +28 -7
package/OVERVIEW.md
CHANGED
|
@@ -18,6 +18,10 @@ When there's nothing in it, you get a quiet horizon that follows the time of day
|
|
|
18
18
|
|
|
19
19
|

|
|
20
20
|
|
|
21
|
+
The other tabs get their own version when they're empty: a bench in History, an empty jetty in Waiting, a blank signpost in Next up. An empty Next up also points you to Settings, since it usually means it doesn't know where to look yet.
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
21
25
|
Mentions only count while the person is still waiting for you. Reply or react and it's gone. On your own issues and PRs, a new comment from the last 30 days shows up under **Answered** even if it doesn't tag you. On other people's threads only tags count. The point is to pick out the signal, and most of what happens in threads you once commented on isn't. If you do want those replies, turn on **Follow threads I've commented on** in Settings. Team mentions are left out entirely, because "@everyone-in-backend" is not really a question for *me*. And if something's just an FYI, dismiss it. It stays gone until something new happens on it.
|
|
22
26
|
|
|
23
27
|
Sometimes other people move your work without asking: they merge your PR, close it, close an issue assigned to you, reopen a PR you'd seen closed, take work over, or unassign you. None of that is something to do, so it doesn't count, but it shouldn't happen behind your back either. Each one waits at the top of **History**, like "merged by dave 2h ago" or "phil took over", and the tab gets a little green dot until you tap its check, or **Mark all as read** to clear them all. If the work is already in Wrap up, archiving the session acknowledges it instead.
|
|
@@ -9,7 +9,7 @@ import { type AttentionConfig, nextUpSources, type SessionKind } from "../shared
|
|
|
9
9
|
import { failingList, groupLabel, rerunHistory, summarizeRerun } from "../shared/checks";
|
|
10
10
|
import { changeText } from "../shared/changes";
|
|
11
11
|
import { ago, linkList } from "../shared/format";
|
|
12
|
-
import { isClear } from "../shared/still";
|
|
12
|
+
import { historyClear, isClear, nextUpClear, waitingClear } from "../shared/still";
|
|
13
13
|
import { ACTION_SESSION, renderPrompt } from "../shared/prompts";
|
|
14
14
|
import * as rpc from "../shared/rpc";
|
|
15
15
|
import { type FeedbackKind, themeName } from "../shared/feedback";
|
|
@@ -394,6 +394,12 @@ function AttentionList({
|
|
|
394
394
|
// Sessions not known yet, or failing to load, leave Wrap up unknown: no calm on that [ATT-18, ATT-22].
|
|
395
395
|
const sessionsKnown = !!view.fixtureAgents || (agents.isSuccess && !agents.isError);
|
|
396
396
|
const clear = sessionsKnown && isClear(view, !!attention.error, wrap.length);
|
|
397
|
+
// The other tabs' scenes, on the same terms [HIS-08, WAI-04, NXT-13].
|
|
398
|
+
const calm = {
|
|
399
|
+
history: historyClear(view, notes.length, !!attention.error),
|
|
400
|
+
waiting: waitingClear(view, !!attention.error),
|
|
401
|
+
next: nextUpClear(view, !!attention.error),
|
|
402
|
+
};
|
|
397
403
|
// ⟳ turns for any refresh of this tab's feed, but only my own press locks it: the cached view can still say a background one runs after it's done.
|
|
398
404
|
const pressed = attention.isRefreshing(TAB_FEED[tab]);
|
|
399
405
|
const refreshing = feed.refreshing || attention.isFetching || pressed;
|
|
@@ -558,6 +564,7 @@ function AttentionList({
|
|
|
558
564
|
))}
|
|
559
565
|
{tab === "history" ? (
|
|
560
566
|
<History
|
|
567
|
+
calm={calm.history}
|
|
561
568
|
notes={notes}
|
|
562
569
|
items={view.history}
|
|
563
570
|
filter={view.historyFilter ?? []}
|
|
@@ -615,9 +622,13 @@ function AttentionList({
|
|
|
615
622
|
) : null}
|
|
616
623
|
</>
|
|
617
624
|
) : null}
|
|
618
|
-
{tab === "waiting" ?
|
|
625
|
+
{tab === "waiting" ? (
|
|
626
|
+
calm.waiting ? <Still shore="jetty" title="Nobody's holding you up." line="Nothing to chase." /> : <Waiting groups={view.waiting} actions={actions} />
|
|
627
|
+
) : null}
|
|
619
628
|
{tab === "next" ? (
|
|
620
629
|
<NextUpList
|
|
630
|
+
calm={calm.next}
|
|
631
|
+
openSettings={openSettings}
|
|
621
632
|
assigned={view.assigned}
|
|
622
633
|
unclaimed={view.unclaimed}
|
|
623
634
|
unclaimedFrom={view.unclaimedFrom}
|
package/client/history.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import { allNotesBusy } from "../shared/got-it";
|
|
|
5
5
|
import { historyWeeks, weekOf } from "../shared/history-report";
|
|
6
6
|
import type { IconName } from "./icons";
|
|
7
7
|
import { Modal } from "./sheet";
|
|
8
|
+
import { Still } from "./still";
|
|
8
9
|
import { Button, KeepStyles, SectionHeader, TablerIcon, useCopy, useStyles } from "./ui";
|
|
9
10
|
|
|
10
11
|
// History: what others did to my work, unread, on top until Got it or an archive; then what I finished, by week, with
|
|
@@ -22,6 +23,7 @@ function weekLabel(monday: Date): string {
|
|
|
22
23
|
|
|
23
24
|
export function History({
|
|
24
25
|
notes,
|
|
26
|
+
calm,
|
|
25
27
|
items,
|
|
26
28
|
filter,
|
|
27
29
|
filtering,
|
|
@@ -31,6 +33,8 @@ export function History({
|
|
|
31
33
|
onMarkAllRead,
|
|
32
34
|
card,
|
|
33
35
|
}: {
|
|
36
|
+
// Nothing finished and nothing unread, after a refresh that worked [HIS-08].
|
|
37
|
+
calm: boolean;
|
|
34
38
|
notes: Item[];
|
|
35
39
|
items: Item[];
|
|
36
40
|
filter: HistoryFilter[];
|
|
@@ -45,6 +49,7 @@ export function History({
|
|
|
45
49
|
const styles = useStyles();
|
|
46
50
|
const copy = useCopy();
|
|
47
51
|
const { weeks, anything } = historyWeeks(items, filter);
|
|
52
|
+
if (calm) return <Still shore="bench" title="Nothing finished yet." line="Your accomplishments will show up here." />;
|
|
48
53
|
if (notes.length === 0 && !anything) return <Text style={styles.text}>Nothing finished in this period.</Text>;
|
|
49
54
|
return (
|
|
50
55
|
<>
|
package/client/next-up.tsx
CHANGED
|
@@ -22,11 +22,15 @@ import { CardList, CardRow, type Tone } from "./card";
|
|
|
22
22
|
import { sessionEntry, startAnotherEntry } from "./session-menu";
|
|
23
23
|
import { ActionSheet, DETAILS_STALE_MS, DetailLines, type DetailsQuery, detailsKey, githubEntry, Modal, type SheetEntry, usePrefetchOnRest } from "./sheet";
|
|
24
24
|
import { githubColor, IssuePills, PlaceText } from "./entity";
|
|
25
|
+
import { Still } from "./still";
|
|
25
26
|
import { Button, KeepStyles, Meta, SectionHeader, TablerIcon, useHover, useStyles } from "./ui";
|
|
26
27
|
|
|
27
28
|
const TYPE_ICONS: Record<string, IconName> = { bug: "bug", feature: "feature", debt: "debt", task: "task", epic: "epic" };
|
|
28
29
|
|
|
29
30
|
interface Props {
|
|
31
|
+
// Nothing at all to show: nowhere to look yet, or nothing to pick up after a refresh that worked [NXT-13].
|
|
32
|
+
calm: "setup" | "clear" | null;
|
|
33
|
+
openSettings?: () => void;
|
|
30
34
|
assigned: NextUpIssue[];
|
|
31
35
|
unclaimed: NextUpIssue[];
|
|
32
36
|
unclaimedFrom: UnclaimedSource;
|
|
@@ -57,10 +61,10 @@ interface Props {
|
|
|
57
61
|
|
|
58
62
|
type FilterChange = { scopes?: string[]; sources?: string[]; projectFilter?: string[] };
|
|
59
63
|
|
|
60
|
-
type RowProps = Omit<Props, "assigned" | "unclaimed" | "unclaimedFrom" | "selected" | "sources" | "selectedSources" | "projects" | "selectedProjects" | "onFilter">;
|
|
64
|
+
type RowProps = Omit<Props, "calm" | "openSettings" | "assigned" | "unclaimed" | "unclaimedFrom" | "selected" | "sources" | "selectedSources" | "projects" | "selectedProjects" | "onFilter">;
|
|
61
65
|
|
|
62
66
|
// Assigned issues first [NXT-06], then unclaimed ones [NXT-01]; both already ranked by the server [NXT-02].
|
|
63
|
-
export function NextUpList({ assigned, unclaimed, unclaimedFrom, selected, sources, selectedSources, projects, selectedProjects, onFilter, ...rowProps }: Props) {
|
|
67
|
+
export function NextUpList({ calm, openSettings, assigned, unclaimed, unclaimedFrom, selected, sources, selectedSources, projects, selectedProjects, onFilter, ...rowProps }: Props) {
|
|
64
68
|
const styles = useStyles();
|
|
65
69
|
const scopes = useMemo(() => [...new Set(unclaimed.map((issue) => issue.scope).filter((scope): scope is string => !!scope))].sort(), [unclaimed]);
|
|
66
70
|
// Filter by the scopes I picked last time [NXT-03]; a picked scope with no issues left is ignored.
|
|
@@ -109,6 +113,16 @@ export function NextUpList({ assigned, unclaimed, unclaimedFrom, selected, sourc
|
|
|
109
113
|
...(scopes.length > 0 ? [{ title: "Scope", options: scopes.map((scope) => ({ id: scope, label: scope })), active, onToggle: toggle }] : []),
|
|
110
114
|
];
|
|
111
115
|
|
|
116
|
+
// Both point at where Next up looks: plainly when it has nowhere to look, quietly when it found nothing [NXT-13].
|
|
117
|
+
if (calm === "setup") {
|
|
118
|
+
const way = openSettings ? { label: "Open settings", onPress: openSettings } : undefined;
|
|
119
|
+
return <Still shore="signpost" title="Nowhere to look yet." line="Choose where Next up finds issues." way={way} />;
|
|
120
|
+
}
|
|
121
|
+
if (calm === "clear") {
|
|
122
|
+
const way = openSettings ? { label: "Look in more places", onPress: openSettings, link: true } : undefined;
|
|
123
|
+
return <Still shore="signpost" title="Nothing ready for work." line="Want more to choose from?" way={way} />;
|
|
124
|
+
}
|
|
125
|
+
|
|
112
126
|
return (
|
|
113
127
|
<View style={{ gap: 24 }}>
|
|
114
128
|
{assigned.length > 0 ? (
|
package/client/still.tsx
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Icon } from "@getpaseo/plugin/client/ui";
|
|
2
|
-
import { useEffect, useRef, useState } from "react";
|
|
3
|
-
import { AccessibilityInfo, Animated, Easing, Platform, Text, View } from "react-native";
|
|
2
|
+
import { type ReactNode, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { AccessibilityInfo, Animated, Easing, Platform, Pressable, Text, View } from "react-native";
|
|
4
4
|
import { themeName } from "../shared/feedback";
|
|
5
5
|
import { type Scene, sceneAt } from "../shared/still";
|
|
6
|
-
import { useStyles } from "./ui";
|
|
6
|
+
import { Button, useStyles } from "./ui";
|
|
7
7
|
|
|
8
|
-
//
|
|
8
|
+
// A tab with nothing in it: a horizon that follows the clock, and nothing that asks for anything [ATT-18].
|
|
9
|
+
// History, Waiting and Next up each add one thing on the shore [HIS-08, WAI-04, NXT-13].
|
|
9
10
|
// It settles in on every arrival, then stays still; the hour changing crossfades it.
|
|
10
11
|
|
|
11
12
|
// One tint per time of day, darker on light themes so it holds up on white.
|
|
@@ -20,31 +21,46 @@ const H = 110;
|
|
|
20
21
|
const svg = (body: string) =>
|
|
21
22
|
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${W} ${H}" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">${body}</svg>`;
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
// The sun or moon, moved right by `dx` to make room for a shore; the stars stay put.
|
|
25
|
+
const sky = (scene: Scene, dx: number) =>
|
|
26
|
+
svg(
|
|
27
|
+
`<g transform="translate(${dx} 0)">${SUN[scene]}</g>` +
|
|
28
|
+
(scene === "night" ? STARS : ""),
|
|
29
|
+
);
|
|
30
|
+
const SUN: Record<Scene, string> = {
|
|
31
|
+
morning: `<path d="M100 66a20 20 0 0 1 40 0"/>`,
|
|
32
|
+
midday: `<circle cx="120" cy="30" r="16"/>`,
|
|
33
|
+
evening: `<path d="M88 66a32 32 0 0 1 64 0"/>`,
|
|
34
|
+
night: `<path d="M126 18a16 16 0 1 0 14 22a12.5 12.5 0 0 1 -14 -22z"/>`,
|
|
35
|
+
};
|
|
36
|
+
const STARS = [
|
|
30
37
|
[70, 24],
|
|
31
38
|
[168, 16],
|
|
32
39
|
[190, 40],
|
|
33
40
|
[52, 46],
|
|
34
41
|
]
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
),
|
|
38
|
-
};
|
|
42
|
+
.map(([x, y]) => `<circle cx="${x}" cy="${y}" r="1" fill="currentColor" stroke="none" opacity=".6"/>`)
|
|
43
|
+
.join("");
|
|
39
44
|
|
|
40
45
|
// The sun's light on the water, fading downwards; wider under a low sun.
|
|
41
46
|
const WIDTHS: Record<Scene, number[]> = { morning: [40, 26, 12], midday: [24, 16, 8], evening: [56, 40, 20], night: [30, 18, 8] };
|
|
42
|
-
const
|
|
43
|
-
(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
const water = (scene: Scene, dx: number) =>
|
|
48
|
+
svg(WIDTHS[scene].map((width, i) => `<path d="M${W / 2 + dx - width / 2} ${76 + i * 8}h${width}" stroke-opacity="${[0.45, 0.28, 0.15][i]}"/>`).join(""));
|
|
49
|
+
|
|
50
|
+
// One thing on the shore, left of the sun, in the line's muted colour: History's bench to look back from, Waiting's
|
|
51
|
+
// jetty with nothing tied to it, Next up's signpost with blank boards. `dx` moves the sun right to make room.
|
|
52
|
+
export type Shore = "bench" | "jetty" | "signpost";
|
|
53
|
+
const SHORES: Record<Shore, { dx: number; svg: string }> = {
|
|
54
|
+
bench: { dx: 36, svg: svg(`<path d="M36 57h28"/><path d="M38 57l-4-14"/><path d="M40 57v9M62 57v9"/>`) },
|
|
55
|
+
jetty: {
|
|
56
|
+
dx: 30,
|
|
57
|
+
svg: svg(`<path d="M20 58h82"/>` + [28, 50, 72, 94].map((x) => `<path d="M${x} 58v14"/><path d="M${x} 78v3" stroke-opacity=".35"/>`).join("")),
|
|
58
|
+
},
|
|
59
|
+
signpost: {
|
|
60
|
+
dx: 40,
|
|
61
|
+
svg: svg(`<path d="M64 66v-34"/><path d="M50 36h26l5 4-5 4h-26z"/><path d="M78 48h-26l-5 4 5 4h26z" stroke-opacity=".6"/>`),
|
|
62
|
+
},
|
|
63
|
+
};
|
|
48
64
|
|
|
49
65
|
const LINE = { svg: svg(`<path d="M20 66h200"/>`) };
|
|
50
66
|
|
|
@@ -52,8 +68,18 @@ const SETTLE_MS = 700;
|
|
|
52
68
|
const CROSSFADE_MS = 4000;
|
|
53
69
|
const native = Platform.OS !== "web";
|
|
54
70
|
|
|
55
|
-
|
|
71
|
+
// What the scene says, and at most one way on: a calm button, or a quieter link in the action colour, which stays
|
|
72
|
+
// readable where the sun's tints are too pale for small text.
|
|
73
|
+
type Way = { label: string; onPress: () => void; link?: boolean };
|
|
74
|
+
|
|
75
|
+
export function Still({
|
|
76
|
+
shore,
|
|
77
|
+
title = "Nothing's on you.",
|
|
78
|
+
line = "Enjoy the quiet.",
|
|
79
|
+
way,
|
|
80
|
+
}: { shore?: Shore; title?: string; line?: string; way?: Way } = {}) {
|
|
56
81
|
const styles = useStyles();
|
|
82
|
+
const dx = shore ? SHORES[shore].dx : 0;
|
|
57
83
|
const theme = themeName(styles.c.surface0);
|
|
58
84
|
const width = styles.compact ? 200 : 240;
|
|
59
85
|
const height = Math.round((width * H) / W);
|
|
@@ -95,6 +121,8 @@ export function Still() {
|
|
|
95
121
|
|
|
96
122
|
const skyIn = { opacity: arrive.interpolate({ inputRange: [0, 0.65, 1], outputRange: [0, 1, 1] }), transform: [{ translateY: arrive.interpolate({ inputRange: [0, 0.65, 1], outputRange: [6, 0, 0] }) }] };
|
|
97
123
|
const waterIn = { opacity: arrive.interpolate({ inputRange: [0, 0.35, 1], outputRange: [0, 0, 1] }) };
|
|
124
|
+
// The shore settles in with the water, rising a little.
|
|
125
|
+
const shoreIn = { opacity: waterIn.opacity, transform: [{ translateY: arrive.interpolate({ inputRange: [0, 0.35, 1], outputRange: [3, 3, 0] }) }] };
|
|
98
126
|
const fadeOut = fade.interpolate({ inputRange: [0, 1], outputRange: [1, 0] });
|
|
99
127
|
|
|
100
128
|
// SvgXml draws a size × size square; the canvas sits in its middle, so crop the square to the canvas.
|
|
@@ -105,8 +133,8 @@ export function Still() {
|
|
|
105
133
|
);
|
|
106
134
|
const scenery = (shown: Scene, opacity: Animated.AnimatedInterpolation<number> | Animated.Value) => (
|
|
107
135
|
<Animated.View key={shown} style={{ position: "absolute", inset: 0, opacity }}>
|
|
108
|
-
<Animated.View style={[{ position: "absolute", inset: 0 }, skyIn]}>{layer({ svg:
|
|
109
|
-
<Animated.View style={[{ position: "absolute", inset: 0 }, waterIn]}>{layer({ svg:
|
|
136
|
+
<Animated.View style={[{ position: "absolute", inset: 0 }, skyIn]}>{layer({ svg: sky(shown, dx) }, TINTS[theme][shown])}</Animated.View>
|
|
137
|
+
<Animated.View style={[{ position: "absolute", inset: 0 }, waterIn]}>{layer({ svg: water(shown, dx) }, TINTS[theme][shown])}</Animated.View>
|
|
110
138
|
</Animated.View>
|
|
111
139
|
);
|
|
112
140
|
|
|
@@ -114,16 +142,31 @@ export function Still() {
|
|
|
114
142
|
// Upper two-fifths: a little above the middle, so it reads as a place, not a floating notice.
|
|
115
143
|
<View style={{ flex: 1, minHeight: styles.compact ? 300 : 360 }}>
|
|
116
144
|
<View style={{ flex: 2 }} />
|
|
117
|
-
<View
|
|
145
|
+
<View style={{ alignItems: "center", gap: 12 }}>
|
|
118
146
|
<View style={{ width, height, overflow: "hidden" }} importantForAccessibility="no-hide-descendants" accessibilityElementsHidden>
|
|
119
147
|
<View style={{ position: "absolute", inset: 0, opacity: 0.6 }}>{layer(LINE, styles.c.foregroundMuted)}</View>
|
|
120
148
|
{previous ? scenery(previous, fadeOut) : null}
|
|
121
149
|
{scenery(scene, fade)}
|
|
150
|
+
{shore ? (
|
|
151
|
+
<Animated.View style={[{ position: "absolute", inset: 0 }, shoreIn]}>{layer(SHORES[shore], styles.c.foregroundMuted)}</Animated.View>
|
|
152
|
+
) : null}
|
|
122
153
|
</View>
|
|
123
|
-
<
|
|
124
|
-
|
|
154
|
+
<View accessible style={{ alignItems: "center", gap: 12 }}>
|
|
155
|
+
<Text style={{ color: styles.c.foreground, fontSize: 17, fontWeight: "600", marginTop: 6, textAlign: "center" }}>{title}</Text>
|
|
156
|
+
<Text style={[styles.muted, { fontSize: 13, textAlign: "center" }]}>{line}</Text>
|
|
157
|
+
</View>
|
|
158
|
+
{way ? <WayOn way={way} color={styles.action} /> : null}
|
|
125
159
|
</View>
|
|
126
160
|
<View style={{ flex: 3 }} />
|
|
127
161
|
</View>
|
|
128
162
|
);
|
|
129
163
|
}
|
|
164
|
+
|
|
165
|
+
function WayOn({ way, color }: { way: Way; color: string }): ReactNode {
|
|
166
|
+
if (!way.link) return <View style={{ marginTop: 8 }}><Button label={way.label} icon="settings" onPress={way.onPress} /></View>;
|
|
167
|
+
return (
|
|
168
|
+
<Pressable accessibilityRole="link" onPress={way.onPress} hitSlop={8} style={{ marginTop: 8 }}>
|
|
169
|
+
<Text style={{ color, fontSize: 13 }}>{way.label} ›</Text>
|
|
170
|
+
</Pressable>
|
|
171
|
+
);
|
|
172
|
+
}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrioid/paseo-attention-span",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
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": {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"docs/screenshots/desktop-dark-doing-wrap-dirty.png",
|
|
30
30
|
"docs/screenshots/desktop-dark-doing-wrap-multi.png",
|
|
31
31
|
"docs/screenshots/desktop-dark-doing-clear.png",
|
|
32
|
+
"docs/screenshots/desktop-dark-next-up-setup.png",
|
|
32
33
|
"docs/screenshots/desktop-dark-doing-acknowledge.png",
|
|
33
34
|
"docs/screenshots/desktop-dark-doing-issue-sheet.png",
|
|
34
35
|
"docs/screenshots/desktop-dark-doing-reviewers.png",
|
package/requirements.yaml
CHANGED
|
@@ -101,11 +101,13 @@ functional:
|
|
|
101
101
|
NXT-10: see on each issue its repository, its projects with their status, and its priority, effort and scope at a glance, each a pill whose icon says what it is, named in words when I point at it and in the sheet, with status and priority softly in the color GitHub has for them (none for gray, and the top two priorities warm and accent where the org colored none), and whether an open pull request already closes it and by whom; so that I can judge whether to pick it up without opening it.
|
|
102
102
|
NXT-11: close an issue from Next up as completed or not planned, with an optional comment, and undo it; so that work that's done or won't be done stops being suggested.
|
|
103
103
|
NXT-12: see which open GitHub projects my Next up issues are on, and where on each board, once my gh login may read projects, with Settings saying the one command that allows it until then; so that I know whether work is planned or just an idea, without Next up breaking for anyone who hasn't allowed it.
|
|
104
|
+
NXT-13: see a calm scene in Next up when it has nothing at all to show, pointing me to Settings, plainly when it has nowhere to look and quietly when it found nothing to pick up, the latter only once a refresh has confirmed it; so that an empty Next up says how to fill it rather than looking broken.
|
|
104
105
|
waiting:
|
|
105
106
|
As a developer, I can:
|
|
106
107
|
WAI-01: see my work that is waiting on others, grouped by who it waits on with whoever blocks the most first, bots after people, and work no person holds up last, each group with work that has an active session first, and each card saying why it waits and for how long, including my pull requests in Doing that wait on whom I asked, where a pull request waits for review only once someone has been asked, and a thread only once my last words ask a question; so that I know that work is tracked and who is blocking me most.
|
|
107
108
|
WAI-02: see who my waiting work waits on: reviewers I asked, reviewers who asked for changes and people I tagged in my unanswered question, and nobody where none of those apply; so that I know whom to nudge without guessing.
|
|
108
109
|
WAI-03: copy the list of my work waiting on one person or team, oldest first, each line a Markdown link led by why and for how long, like "Review 2h: [title](link)"; so that nudging them is one paste they can skim.
|
|
110
|
+
WAI-04: see a calm scene in Waiting when nothing waits on anyone, only once a refresh has confirmed it; so that being blocked by nobody feels like rest rather than a blank page.
|
|
109
111
|
history:
|
|
110
112
|
As a developer, I can:
|
|
111
113
|
HIS-01: see the issues and pull requests I finished, grouped by week; so that I can tell others what I got done.
|
|
@@ -115,6 +117,7 @@ functional:
|
|
|
115
117
|
HIS-05: see who merged a PR of mine when it wasn't me, as "merged 2h ago by dave", with its copied line unchanged; so that I know when someone else shipped my work.
|
|
116
118
|
HIS-06: see each week's work that left my hands under Changed by others when that is shown, out of the week's copy, even once its new owner merges it, and keep it there when the work comes back to me after I've cleared it; so that my report doesn't claim work that wasn't mine.
|
|
117
119
|
HIS-07: see at the top of History, unread, when someone else merged or closed my pull request, closed an issue assigned to me, reopened a pull request I had seen closed, took over or handed on my work, or unassigned me, with a dot on the tab while any is unread and Got it or Mark all as read to clear them; so that I learn when others move my work without it changing what I have to do.
|
|
120
|
+
HIS-08: see a calm scene in History when I've finished nothing in its weeks and nothing is unread, only once a refresh has confirmed it; so that an empty History reads as a start rather than a blank page.
|
|
118
121
|
feedback:
|
|
119
122
|
As a developer, I can:
|
|
120
123
|
FB-01: tell the Attention Span project what to improve from the bottom of any tab, picking a problem, an idea or that I like it, with an agent that asks until it's clear, checks it against what's planned and already reported, and files it as an issue or a discussion, saying which and why, only once I approve the draft; so that feedback costs a minute and lands where it can be acted on or talked through.
|
package/server/fixture.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
1
3
|
import type { AgentSummary, GithubColor, ItemDetails, Reviewer, ReviewerChoices, Target } from "../shared/attention";
|
|
2
4
|
import type { OthersChange } from "../shared/changes";
|
|
3
5
|
import type { SessionKind } from "../shared/config";
|
|
4
6
|
import type { IssueField } from "../shared/setup";
|
|
5
7
|
import type { Actor, Comment, Details, IssueNode, MentionNode, PickableNode, PullRequestNode, SearchResult } from "./github-types";
|
|
8
|
+
import { DIR } from "./store";
|
|
6
9
|
|
|
7
10
|
// Made-up GitHub data for tests and for previews without GitHub (PASEO_ATTENTION_SPAN_FIXTURE=1).
|
|
8
11
|
|
|
@@ -324,6 +327,18 @@ export function fixture(now: Date): { data: SearchResult; details: Details } {
|
|
|
324
327
|
};
|
|
325
328
|
}
|
|
326
329
|
|
|
330
|
+
// A quiet day: GitHub has nothing for me, so the preview can show the empty tabs' scenes [ATT-18, HIS-08, WAI-04, NXT-13].
|
|
331
|
+
// On while this file exists in the plugin's folder; the shooter creates it last.
|
|
332
|
+
export const quiet = () => existsSync(join(DIR, "fixture-quiet"));
|
|
333
|
+
|
|
334
|
+
// The fixture, or nothing in it on a quiet day.
|
|
335
|
+
export function fixtureNow(now: Date): ReturnType<typeof fixture> {
|
|
336
|
+
const { data, details } = fixture(now);
|
|
337
|
+
if (!quiet()) return { data, details };
|
|
338
|
+
const empty = Object.fromEntries(Object.entries(data).map(([key, value]) => [key, key === "viewer" ? value : { nodes: [] }]));
|
|
339
|
+
return { data: empty as unknown as SearchResult, details };
|
|
340
|
+
}
|
|
341
|
+
|
|
327
342
|
// What others did to my work, one of each kind, as the ledger keeps them [HIS-07, HIS-06]. #179 was handed over, then merged
|
|
328
343
|
// by its new owner, so History doesn't count it as mine.
|
|
329
344
|
export function fixtureChanges(now: Date): OthersChange[] {
|
package/server/service.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { acknowledge, changeCandidates, ownClosed, nextLedger, type Lookups, typ
|
|
|
9
9
|
import { classify, classifyHistory, issueBoardIds } from "./classify";
|
|
10
10
|
import { probeAnswer, projectsFailure, projectsWarning, searchWithProjects } from "./projects";
|
|
11
11
|
import { FIXTURE, graphql, graphqlResult } from "./gh";
|
|
12
|
-
import {
|
|
12
|
+
import { FIXTURE_AGENTS, FIXTURE_ISSUE_FIELDS, fixtureChanges, fixtureGotIt, fixtureNow, quiet } from "./fixture";
|
|
13
13
|
import type { AssignmentSubject, Details, HistoryResult, LinkedIssue, LiveResult, MergeStateStatus, PullRequestNode, ReopenSubject } from "./github-types";
|
|
14
14
|
import {
|
|
15
15
|
ASSIGNMENT_BATCH,
|
|
@@ -337,7 +337,7 @@ export class AttentionService {
|
|
|
337
337
|
const projectRepos = FIXTURE ? [] : await this.projectRepos();
|
|
338
338
|
const login = FIXTURE ? "me" : this.config.nextUp.mine ? await this.login() : null;
|
|
339
339
|
const unclaimed = unclaimedSearches(this.config, projectRepos, login);
|
|
340
|
-
const { data, details } = FIXTURE ?
|
|
340
|
+
const { data, details } = FIXTURE ? fixtureNow(now) : await this.searchLive(now, unclaimed.searches);
|
|
341
341
|
await this.trackChanges(data, now);
|
|
342
342
|
const own = FIXTURE ? [] : ownClosed(data, data.viewer.login);
|
|
343
343
|
return { ...classify({ data, details, config: this.config, now }), unclaimedFrom: unclaimed.from, ...(own.length ? { ownClosed: own } : {}) };
|
|
@@ -349,7 +349,7 @@ export class AttentionService {
|
|
|
349
349
|
const ledger = this.state.changes;
|
|
350
350
|
if (FIXTURE) {
|
|
351
351
|
// Previews start each layout with a refresh, which brings the notes back: Got it would otherwise outlive a layout.
|
|
352
|
-
this.state.changes = { ...ledger, events: fixtureChanges(now), gotIt: fixtureGotIt(now) };
|
|
352
|
+
this.state.changes = { ...ledger, events: quiet() ? [] : fixtureChanges(now), gotIt: fixtureGotIt(now) };
|
|
353
353
|
return;
|
|
354
354
|
}
|
|
355
355
|
const me = data.viewer.login;
|
|
@@ -417,7 +417,7 @@ export class AttentionService {
|
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
private async fetchHistory(now: Date): Promise<Item[]> {
|
|
420
|
-
if (FIXTURE) return classifyHistory(
|
|
420
|
+
if (FIXTURE) return classifyHistory(fixtureNow(now).data);
|
|
421
421
|
return classifyHistory(await graphql<HistoryResult>(searchQuery(HISTORY_SEARCHES, true), this.variables(HISTORY_SEARCHES, now)));
|
|
422
422
|
}
|
|
423
423
|
|
package/shared/still.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { AttentionView } from "./attention";
|
|
1
|
+
import type { AttentionView, FeedStatus } from "./attention";
|
|
2
|
+
import { historyWeeks } from "./history-report";
|
|
2
3
|
|
|
3
|
-
// The empty
|
|
4
|
+
// The empty tabs: a horizon that follows the device's clock [ATT-18, HIS-08, WAI-04, NXT-13].
|
|
4
5
|
export type Scene = "morning" | "midday" | "evening" | "night";
|
|
5
6
|
|
|
6
7
|
// Fixed local hours, the same every day: morning 5–11, midday 11–16, evening 16–21, night 21–5.
|
|
@@ -12,10 +13,30 @@ export function sceneAt(date: Date): Scene {
|
|
|
12
13
|
return "night";
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
// Calm only when it's true:
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
// Calm only when it's true: a refresh of the tab's feed worked. Loading, a failed refresh or none yet show plainly.
|
|
17
|
+
const refreshed = (feed: FeedStatus, failed: boolean) => !!feed.fetchedAt && !feed.error && !failed;
|
|
18
|
+
|
|
19
|
+
// Doing is empty. Dismissed items don't count; they're not on me until something new happens [ATT-08].
|
|
20
|
+
// Wrap up's rows do: the horizon waits for them [ATT-18, ATT-22].
|
|
18
21
|
export function isClear(view: Pick<AttentionView, "doing" | "feeds">, failed = false, wrap = 0): boolean {
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
return view.doing.length === 0 && wrap === 0 && refreshed(view.feeds.live, failed);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Nothing waits on anyone [WAI-04].
|
|
26
|
+
export function waitingClear(view: Pick<AttentionView, "waiting" | "feeds">, failed = false): boolean {
|
|
27
|
+
return view.waiting.length === 0 && refreshed(view.feeds.live, failed);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Nothing finished in History's weeks and no unread notes above them. A filter hiding everything isn't rest:
|
|
31
|
+
// that week still holds something, so it shows plainly [HIS-08].
|
|
32
|
+
export function historyClear(view: Pick<AttentionView, "history" | "feeds">, notes: number, failed = false): boolean {
|
|
33
|
+
return notes === 0 && !historyWeeks(view.history, []).anything && refreshed(view.feeds.history, failed);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Next up with nothing in it at all, not even behind a filter [NXT-13]. Nowhere to look is a setting, so it shows
|
|
37
|
+
// straight away; nothing to pick up waits for a refresh that worked.
|
|
38
|
+
export function nextUpClear(view: Pick<AttentionView, "assigned" | "unclaimed" | "unclaimedFrom" | "feeds">, failed = false): "setup" | "clear" | null {
|
|
39
|
+
if (view.assigned.length > 0 || view.unclaimed.length > 0) return null;
|
|
40
|
+
if (view.unclaimedFrom === "none") return "setup";
|
|
41
|
+
return refreshed(view.feeds.live, failed) ? "clear" : null;
|
|
21
42
|
}
|