@andrioid/paseo-attention-span 0.4.9 → 0.4.11
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 +164 -49
- package/client/card.tsx +25 -9
- package/client/coverage-settings.tsx +36 -1
- package/client/entity.tsx +118 -0
- package/client/feedback.tsx +2 -2
- package/client/icons.ts +5 -0
- package/client/next-up.tsx +148 -76
- package/client/session-menu.ts +2 -1
- package/client/sheet.tsx +141 -23
- package/client/ui.tsx +104 -6
- package/docs/architecture.md +17 -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.png +0 -0
- package/docs/screenshots/desktop-dark-history-reviewed.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-light-next-up-filtered.png +0 -0
- package/index.server.ts +2 -0
- package/package.json +1 -1
- package/requirements.yaml +4 -2
- package/server/classify.ts +56 -12
- package/server/details.ts +3 -2
- package/server/fixture.ts +50 -10
- package/server/gh.ts +29 -12
- package/server/github-types.ts +19 -2
- package/server/projects.ts +47 -0
- package/server/queries.ts +41 -6
- package/server/service.ts +138 -22
- package/server/store.ts +2 -0
- package/server/view.ts +2 -0
- package/shared/attention.ts +57 -0
- package/shared/checks.ts +66 -0
- package/shared/rpc.ts +5 -1
package/client/sheet.tsx
CHANGED
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
import { openExternalUrl } from "@getpaseo/plugin/client";
|
|
2
2
|
import { Modal } from "@getpaseo/plugin/client/ui";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
4
|
+
import { type ReactNode, useEffect, useRef } from "react";
|
|
5
|
+
import { Animated, Platform, Pressable, Text, View } from "react-native";
|
|
6
|
+
import { type Chip, type ItemDetails, ownStack, type Target } from "../shared/attention";
|
|
6
7
|
import type { IconName } from "./icons";
|
|
7
|
-
import { Button, HintArea, KeepStyles,
|
|
8
|
+
import { Button, Hint, HintArea, KeepStyles, LINE_HEIGHT, REST_MS, Signal, Skeleton, TablerIcon, toneColor, useCopy, useHover, useStyles } from "./ui";
|
|
8
9
|
|
|
9
|
-
//
|
|
10
|
-
|
|
10
|
+
// Every dialog and sheet in the plugin is Paseo's Modal.
|
|
11
|
+
export { Modal };
|
|
12
|
+
|
|
13
|
+
// Tapping a card opens its sheet at once: what the card knows, every action saying what it will do, then what's fetched.
|
|
14
|
+
// Fetched details go last, so the actions don't move when they arrive. A bottom sheet on phones, a dialog on desktop [ATT-06].
|
|
11
15
|
|
|
12
16
|
export interface SheetEntry {
|
|
13
17
|
key: string;
|
|
14
18
|
icon: IconName;
|
|
15
19
|
label: string;
|
|
16
20
|
detail?: string;
|
|
21
|
+
// In place of `detail`, a line drawn in parts, like Rerun's count, checks and history [PRS-09].
|
|
22
|
+
detailNode?: ReactNode;
|
|
23
|
+
// Said on hover, and to screen readers, for a line that can't show everything [ATT-19].
|
|
24
|
+
hint?: string;
|
|
25
|
+
// A line that changes while the sheet is open, so screen readers say it when it does.
|
|
26
|
+
live?: boolean;
|
|
17
27
|
disabled?: boolean;
|
|
18
28
|
onPress: () => void;
|
|
19
29
|
// A copy icon at the end of the line, so copying adds no line to the sheet [ATT-15].
|
|
@@ -22,19 +32,22 @@ export interface SheetEntry {
|
|
|
22
32
|
badge?: Chip;
|
|
23
33
|
// Muted, for a line that's there on purpose but rarely wanted, like starting another session.
|
|
24
34
|
quiet?: boolean;
|
|
35
|
+
// Taking the item off my list or giving it up (Dismiss, Unclaim, Close): kept apart below the work, icons quiet.
|
|
36
|
+
housekeeping?: boolean;
|
|
25
37
|
}
|
|
26
38
|
|
|
27
39
|
export function ActionSheet({ title, top, entries, bottom, onClose }: { title: string; top: ReactNode; entries: SheetEntry[]; bottom: ReactNode; onClose: () => void }) {
|
|
28
40
|
const styles = useStyles();
|
|
41
|
+
const work = entries.filter((entry) => !entry.housekeeping);
|
|
42
|
+
const housekeeping = entries.filter((entry) => entry.housekeeping);
|
|
29
43
|
return (
|
|
30
44
|
<Modal title={title} open onOpenChange={(open) => (open ? null : onClose())}>
|
|
31
45
|
<Modal.Content>
|
|
32
46
|
<KeepStyles styles={styles}>
|
|
33
47
|
<HintArea style={{ gap: 10 }}>{top}</HintArea>
|
|
34
|
-
<View style={
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
))}
|
|
48
|
+
<View style={{ gap: 10 }}>
|
|
49
|
+
<EntryGroup entries={work} />
|
|
50
|
+
<EntryGroup entries={housekeeping} />
|
|
38
51
|
</View>
|
|
39
52
|
<View style={{ gap: 10 }}>{bottom}</View>
|
|
40
53
|
</KeepStyles>
|
|
@@ -43,31 +56,67 @@ export function ActionSheet({ title, top, entries, bottom, onClose }: { title: s
|
|
|
43
56
|
);
|
|
44
57
|
}
|
|
45
58
|
|
|
46
|
-
|
|
59
|
+
// One block of lines. It doesn't clip, so a line's hint can float over the lines above it; each line rounds its own corners.
|
|
60
|
+
function EntryGroup({ entries }: { entries: SheetEntry[] }) {
|
|
61
|
+
const styles = useStyles();
|
|
62
|
+
if (entries.length === 0) return null;
|
|
63
|
+
return (
|
|
64
|
+
<HintArea style={[styles.card, { backgroundColor: styles.c.surface2, overflow: "visible" }]}>
|
|
65
|
+
{entries.map((entry, index) => (
|
|
66
|
+
<Entry key={entry.key} entry={entry} first={index === 0} last={index === entries.length - 1} />
|
|
67
|
+
))}
|
|
68
|
+
</HintArea>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const INNER_RADIUS = 11;
|
|
73
|
+
|
|
74
|
+
function Entry({ entry, first, last }: { entry: SheetEntry; first: boolean; last: boolean }) {
|
|
47
75
|
const styles = useStyles();
|
|
48
76
|
const { hovered, hover } = useHover();
|
|
49
77
|
const copy = useCopy();
|
|
50
78
|
const muted = styles.c.foregroundMuted;
|
|
51
79
|
const dim = entry.disabled || entry.quiet;
|
|
80
|
+
// The pressed and hovered fill follows the block's rounded corners; the copy icon has its own at the right.
|
|
81
|
+
const corners = {
|
|
82
|
+
borderTopLeftRadius: first ? INNER_RADIUS : 0,
|
|
83
|
+
borderBottomLeftRadius: last ? INNER_RADIUS : 0,
|
|
84
|
+
borderTopRightRadius: first && !entry.copy ? INNER_RADIUS : 0,
|
|
85
|
+
borderBottomRightRadius: last && !entry.copy ? INNER_RADIUS : 0,
|
|
86
|
+
};
|
|
87
|
+
const detail = entry.detailNode ?? (entry.detail ? <Text style={styles.muted}>{entry.detail}</Text> : null);
|
|
52
88
|
return (
|
|
53
89
|
<View style={[styles.row, { gap: 0, alignItems: "stretch" }, first ? null : { borderTopWidth: 1, borderTopColor: styles.c.surface1 }]}>
|
|
54
90
|
<Pressable
|
|
55
91
|
accessibilityRole="button"
|
|
56
|
-
|
|
92
|
+
// The button's name is all a screen reader says of it, so a hint goes in it too.
|
|
93
|
+
accessibilityLabel={entry.hint ? `${entry.label}. ${entry.hint}` : entry.label}
|
|
94
|
+
accessibilityState={{ disabled: !!entry.disabled }}
|
|
57
95
|
disabled={entry.disabled}
|
|
58
96
|
onPress={entry.onPress}
|
|
59
97
|
{...hover}
|
|
60
98
|
style={({ pressed }) => [
|
|
61
99
|
styles.row,
|
|
100
|
+
corners,
|
|
62
101
|
{ flex: 1, alignItems: "flex-start", paddingVertical: 10, paddingHorizontal: 12, backgroundColor: pressed || hovered ? styles.c.border : "transparent" },
|
|
63
102
|
]}
|
|
64
103
|
>
|
|
65
104
|
<View style={{ paddingTop: 1 }}>
|
|
66
|
-
<TablerIcon name={entry.icon} size={16} color={dim ? muted : styles.action} />
|
|
105
|
+
<TablerIcon name={entry.icon} size={16} color={dim || entry.housekeeping ? muted : styles.action} />
|
|
67
106
|
</View>
|
|
68
|
-
<View style={{ flex: 1, gap: 2 }}>
|
|
107
|
+
<View style={{ flex: 1, gap: 2, minWidth: 0 }}>
|
|
69
108
|
<Text style={{ color: dim ? muted : styles.c.foreground, fontSize: 14, fontWeight: entry.quiet ? "500" : "600" }}>{entry.label}</Text>
|
|
70
|
-
{
|
|
109
|
+
{detail ? (
|
|
110
|
+
<View accessibilityLiveRegion={entry.live ? "polite" : undefined}>
|
|
111
|
+
{entry.hint ? (
|
|
112
|
+
<Hint text={entry.hint} inline>
|
|
113
|
+
{detail}
|
|
114
|
+
</Hint>
|
|
115
|
+
) : (
|
|
116
|
+
detail
|
|
117
|
+
)}
|
|
118
|
+
</View>
|
|
119
|
+
) : null}
|
|
71
120
|
</View>
|
|
72
121
|
{entry.badge ? <Badge {...entry.badge} /> : null}
|
|
73
122
|
</Pressable>
|
|
@@ -91,22 +140,91 @@ function Badge(chip: Chip) {
|
|
|
91
140
|
);
|
|
92
141
|
}
|
|
93
142
|
|
|
94
|
-
//
|
|
95
|
-
export
|
|
143
|
+
// What a sheet fetches when it opens; the card and its sheet share it, so what the card fetched the sheet reuses.
|
|
144
|
+
export interface DetailsQuery {
|
|
145
|
+
queryKey: readonly unknown[];
|
|
146
|
+
queryFn: () => Promise<ItemDetails>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Details keyed by everything the fetch reads: the item, the PR its actions apply to, and with `checks` the PRs of my stack,
|
|
150
|
+
// so the same issue in Doing (acting on its PR) and in Next up (no PR) don't share what each fetched [ATT-06].
|
|
151
|
+
export function detailsKey(subject: { kind: "pr" | "issue"; repo: string; number: number }, target: Target | undefined, checks: boolean): readonly unknown[] {
|
|
152
|
+
const pr = target?.kind === "pr" ? `${target.repo}#${target.number}` : null;
|
|
153
|
+
return ["attention-span", "details", subject.kind, `${subject.repo}#${subject.number}`, pr, checks, checks && target ? ownStack(target).map((p) => p.number) : []];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Fetched details stay fresh this long, so a sheet opened again, or after its card was pointed at, is complete at once.
|
|
157
|
+
export const DETAILS_STALE_MS = 60_000;
|
|
158
|
+
|
|
159
|
+
// Resting the pointer on a card fetches its sheet's details ahead, best effort, so on desktop most sheets open complete.
|
|
160
|
+
// Tapping opens the sheet at once either way; what isn't in yet fills in [ATT-06, GH-01].
|
|
161
|
+
export function usePrefetchOnRest(query: DetailsQuery) {
|
|
162
|
+
const client = useQueryClient();
|
|
163
|
+
const rest = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
|
|
164
|
+
useEffect(() => () => clearTimeout(rest.current), []);
|
|
165
|
+
return {
|
|
166
|
+
onHoverIn: () => {
|
|
167
|
+
clearTimeout(rest.current);
|
|
168
|
+
rest.current = setTimeout(() => void client.prefetchQuery({ ...query, staleTime: DETAILS_STALE_MS }), REST_MS);
|
|
169
|
+
},
|
|
170
|
+
onHoverOut: () => clearTimeout(rest.current),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Whether something that was loading while it showed has just come in, rather than being there from the start.
|
|
175
|
+
export function useArrived(loading: boolean): boolean {
|
|
176
|
+
const waited = useRef(loading);
|
|
177
|
+
if (loading) waited.current = true;
|
|
178
|
+
return waited.current && !loading;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Lines that came in while the sheet was open fade in, rather than popping over their placeholders.
|
|
182
|
+
export function FadeIn({ active, children }: { active: boolean; children: ReactNode }) {
|
|
183
|
+
const opacity = useRef(new Animated.Value(active ? 0 : 1)).current;
|
|
184
|
+
useEffect(() => {
|
|
185
|
+
if (active) Animated.timing(opacity, { toValue: 1, duration: 180, useNativeDriver: Platform.OS !== "web" }).start();
|
|
186
|
+
}, [active, opacity]);
|
|
187
|
+
return <Animated.View style={{ opacity, gap: 10 }}>{children}</Animated.View>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Skeletons show only once loading has taken this long, so a quick answer doesn't flash them; their room is held from the start.
|
|
191
|
+
const SKELETON_DELAY_MS = 150;
|
|
192
|
+
|
|
193
|
+
// The PR's size and the linked issues or PRs, once fetched. Until then skeleton lines hold the room of the lines the card
|
|
194
|
+
// expects (`expected`: a PR's size, the PRs it knows close an issue), so the sheet doesn't jump when they arrive [ATT-06].
|
|
195
|
+
// `sizeOf` names the PR the size is of, where the sheet is an issue's.
|
|
196
|
+
export function DetailLines({
|
|
197
|
+
details,
|
|
198
|
+
loading,
|
|
199
|
+
error,
|
|
200
|
+
linkedLabel,
|
|
201
|
+
expected,
|
|
202
|
+
sizeOf,
|
|
203
|
+
}: {
|
|
204
|
+
details?: ItemDetails;
|
|
205
|
+
loading: boolean;
|
|
206
|
+
error: unknown;
|
|
207
|
+
linkedLabel: string;
|
|
208
|
+
expected: number;
|
|
209
|
+
sizeOf?: number;
|
|
210
|
+
}) {
|
|
96
211
|
const styles = useStyles();
|
|
97
|
-
|
|
98
|
-
|
|
212
|
+
const arrived = useArrived(loading);
|
|
213
|
+
const line = [styles.muted, { lineHeight: LINE_HEIGHT }];
|
|
214
|
+
if (loading) return <Skeleton lines={expected} label="Loading details" delayMs={SKELETON_DELAY_MS} />;
|
|
215
|
+
if (!details) return error ? <Text style={line}>Couldn't load details: {(error as Error).message}</Text> : null;
|
|
216
|
+
const size = sizeText(details.size);
|
|
99
217
|
return (
|
|
100
|
-
|
|
101
|
-
{
|
|
218
|
+
<FadeIn active={arrived}>
|
|
219
|
+
{size ? <Text style={line}>{sizeOf ? `PR #${sizeOf} · ${size}` : size}</Text> : null}
|
|
102
220
|
{details.linked.map((link) => (
|
|
103
221
|
<Pressable key={link.url} accessibilityRole="link" onPress={() => void openExternalUrl(link.url)}>
|
|
104
|
-
<Text style={
|
|
222
|
+
<Text style={line} numberOfLines={1}>
|
|
105
223
|
{linkedLabel} #{link.number} {link.title} · {link.state.toLowerCase()}
|
|
106
224
|
</Text>
|
|
107
225
|
</Pressable>
|
|
108
226
|
))}
|
|
109
|
-
|
|
227
|
+
</FadeIn>
|
|
110
228
|
);
|
|
111
229
|
}
|
|
112
230
|
|
package/client/ui.tsx
CHANGED
|
@@ -16,6 +16,8 @@ export function makeStyles(theme: Theme, compact: boolean) {
|
|
|
16
16
|
return {
|
|
17
17
|
c,
|
|
18
18
|
compact,
|
|
19
|
+
// Themes don't say whether they're dark; their base surface does. Picks the shade of a color that reads on it.
|
|
20
|
+
dark: (luminance(c.surface0) ?? 0) < 0.5,
|
|
19
21
|
// Action text and icons. The accent is a fill: as text on a dark theme it's 2.5:1; this green is 5–6:1 on every surface.
|
|
20
22
|
action: c.statusSuccess,
|
|
21
23
|
screen: { flex: 1, backgroundColor: c.surface0 },
|
|
@@ -37,6 +39,52 @@ export function makeStyles(theme: Theme, compact: boolean) {
|
|
|
37
39
|
}
|
|
38
40
|
export type Styles = ReturnType<typeof makeStyles>;
|
|
39
41
|
|
|
42
|
+
// "#rgb", "#rrggbb" or "rgb(…)" as 0–255 channels; null for anything else.
|
|
43
|
+
function channels(color: string): [number, number, number] | null {
|
|
44
|
+
const hex = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(color.trim())?.[1];
|
|
45
|
+
if (hex) {
|
|
46
|
+
const full = hex.length === 3 ? [...hex].map((ch) => ch + ch).join("") : hex;
|
|
47
|
+
return [0, 2, 4].map((at) => parseInt(full.slice(at, at + 2), 16)) as [number, number, number];
|
|
48
|
+
}
|
|
49
|
+
const rgb = /^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/i.exec(color.trim());
|
|
50
|
+
return rgb ? [Number(rgb[1]), Number(rgb[2]), Number(rgb[3])] : null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function luminance(color: string): number | null {
|
|
54
|
+
const rgb = channels(color);
|
|
55
|
+
return rgb ? (0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]) / 255 : null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// `a` with `share` of it kept and the rest `b`; just `a` when either isn't a color this can read.
|
|
59
|
+
export function mix(a: string, b: string, share: number): string {
|
|
60
|
+
const [x, y] = [channels(a), channels(b)];
|
|
61
|
+
if (!x || !y) return a;
|
|
62
|
+
return `#${x.map((value, i) => Math.round(value * share + y[i] * (1 - share)).toString(16).padStart(2, "0")).join("")}`;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// A fact as an icon half and a value half: the icon, with an optional label, says what the value is, in words on hover and
|
|
66
|
+
// to screen readers. A color softly fills the value half. What goes in one is up to entity.tsx.
|
|
67
|
+
export function Pill({ icon, label, value, color, hint }: { icon: IconName; label?: string; value?: string; color?: string; hint: string }) {
|
|
68
|
+
const styles = useStyles();
|
|
69
|
+
const text = { fontSize: 11, lineHeight: 16 };
|
|
70
|
+
return (
|
|
71
|
+
<Hint text={hint} inline>
|
|
72
|
+
<View accessibilityLabel={hint} style={{ flexDirection: "row", alignItems: "stretch", borderWidth: 1, borderColor: styles.c.border, borderRadius: 999, overflow: "hidden" }}>
|
|
73
|
+
<View style={[styles.row, { gap: 4, paddingLeft: 7, paddingRight: label ? 7 : 6 }]}>
|
|
74
|
+
<TablerIcon name={icon} size={12} />
|
|
75
|
+
{label ? <Text style={[text, { color: styles.c.foregroundMuted }]}>{label}</Text> : null}
|
|
76
|
+
</View>
|
|
77
|
+
{value ? (
|
|
78
|
+
<View style={{ borderLeftWidth: 1, borderLeftColor: styles.c.border, paddingHorizontal: 7, justifyContent: "center" }}>
|
|
79
|
+
{color ? <View style={{ position: "absolute", top: 0, left: 0, right: 0, bottom: 0, backgroundColor: color, opacity: 0.08 }} /> : null}
|
|
80
|
+
<Text style={[text, { color: color ? mix(color, styles.c.foreground, 0.75) : mix(styles.c.foreground, styles.c.foregroundMuted, 0.8) }]}>{value}</Text>
|
|
81
|
+
</View>
|
|
82
|
+
) : null}
|
|
83
|
+
</View>
|
|
84
|
+
</Hint>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
40
88
|
const StylesContext = createContext<Styles | null>(null);
|
|
41
89
|
export const useStyles = () => useContext(StylesContext)!;
|
|
42
90
|
|
|
@@ -72,6 +120,41 @@ export function SpinningIcon({ name, size = 16, color, spinning }: { name: IconN
|
|
|
72
120
|
);
|
|
73
121
|
}
|
|
74
122
|
|
|
123
|
+
// Lines of quiet text that may arrive later keep this height, so a Skeleton can hold their place exactly.
|
|
124
|
+
export const LINE_HEIGHT = 16;
|
|
125
|
+
|
|
126
|
+
// Where lines of text will be once they've loaded: quiet bars, gently pulsing, each the height of the line it stands in for,
|
|
127
|
+
// so nothing moves when the text replaces them. Widths vary so they read as text, not boxes. With `delayMs` the bars show only
|
|
128
|
+
// after that long, holding their room meanwhile, so a quick answer doesn't flash them.
|
|
129
|
+
export function Skeleton({ lines, label, delayMs = 0 }: { lines: number; label: string; delayMs?: number }) {
|
|
130
|
+
const styles = useStyles();
|
|
131
|
+
const pulse = useRef(new Animated.Value(0)).current;
|
|
132
|
+
const [shown, setShown] = useState(delayMs <= 0);
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
if (delayMs <= 0) return;
|
|
135
|
+
const timer = setTimeout(() => setShown(true), delayMs);
|
|
136
|
+
return () => clearTimeout(timer);
|
|
137
|
+
}, [delayMs]);
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
const native = Platform.OS !== "web";
|
|
140
|
+
const half = (toValue: number) => Animated.timing(pulse, { toValue, duration: 700, easing: Easing.inOut(Easing.ease), useNativeDriver: native });
|
|
141
|
+
const loop = Animated.loop(Animated.sequence([half(1), half(0)]));
|
|
142
|
+
loop.start();
|
|
143
|
+
return () => loop.stop();
|
|
144
|
+
}, [pulse]);
|
|
145
|
+
if (lines <= 0) return null;
|
|
146
|
+
const opacity = pulse.interpolate({ inputRange: [0, 1], outputRange: [0.5, 1] });
|
|
147
|
+
return (
|
|
148
|
+
<View accessibilityLabel={label} style={{ gap: 10, opacity: shown ? 1 : 0 }}>
|
|
149
|
+
{Array.from({ length: lines }, (_, index) => (
|
|
150
|
+
<View key={index} style={{ height: LINE_HEIGHT, justifyContent: "center" }}>
|
|
151
|
+
<Animated.View style={{ height: 10, borderRadius: 5, width: `${[42, 68, 55][index % 3]}%`, backgroundColor: styles.c.surface2, opacity }} />
|
|
152
|
+
</View>
|
|
153
|
+
))}
|
|
154
|
+
</View>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
75
158
|
// What's loading, with a spinner so it doesn't read as stuck.
|
|
76
159
|
export function Loading({ text }: { text: string }) {
|
|
77
160
|
const styles = useStyles();
|
|
@@ -120,8 +203,9 @@ export function HintArea({ style, children }: { style?: StyleProp<ViewStyle>; ch
|
|
|
120
203
|
);
|
|
121
204
|
}
|
|
122
205
|
|
|
123
|
-
// Resting the pointer this long shows a hint; passing over
|
|
124
|
-
const
|
|
206
|
+
// Resting the pointer this long shows a hint, or fetches a card's details ahead; passing over does neither.
|
|
207
|
+
export const REST_MS = 300;
|
|
208
|
+
const HINT_DELAY_MS = REST_MS;
|
|
125
209
|
|
|
126
210
|
// What something means, in words: on hover after a moment, and always to screen readers. It floats over the layout rather
|
|
127
211
|
// than in it, so showing it moves nothing, and it's sized to the room left in its HintArea: beside the content, wrapping
|
|
@@ -164,15 +248,28 @@ export function Hint({ text, inline, children }: { text: string; inline?: boolea
|
|
|
164
248
|
);
|
|
165
249
|
}
|
|
166
250
|
|
|
167
|
-
//
|
|
168
|
-
export function
|
|
251
|
+
// Quiet text that stands out a little within it, like an item's number among its facts.
|
|
252
|
+
export function useStrongText() {
|
|
253
|
+
const styles = useStyles();
|
|
254
|
+
return { color: mix(styles.c.foreground, styles.c.foregroundMuted, 0.85), fontWeight: "500" as const };
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// The line under a title: what leads it (which item it is, as text), then facts as quiet text joined by "·", then
|
|
258
|
+
// signals [ATT-05].
|
|
259
|
+
export function Meta({ lead, facts, chips }: { lead?: ReactNode; facts: string[]; chips: Chip[] }) {
|
|
169
260
|
const styles = useStyles();
|
|
170
261
|
const quiet = (chip: Chip) => chip.tone === "neutral" && !chip.icon && !chip.hint;
|
|
171
262
|
const text = [...facts, ...chips.filter(quiet).map((chip) => chip.text)];
|
|
172
263
|
const signals = chips.filter((chip) => !quiet(chip));
|
|
173
264
|
return (
|
|
174
265
|
<View style={[styles.wrap, { columnGap: 10, rowGap: 4 }]}>
|
|
175
|
-
{text.length ?
|
|
266
|
+
{lead || text.length ? (
|
|
267
|
+
<Text style={styles.muted}>
|
|
268
|
+
{lead}
|
|
269
|
+
{lead && text.length ? " · " : null}
|
|
270
|
+
{text.join(" · ")}
|
|
271
|
+
</Text>
|
|
272
|
+
) : null}
|
|
176
273
|
{signals.map((chip) => (
|
|
177
274
|
<Signal key={chip.text} {...chip} />
|
|
178
275
|
))}
|
|
@@ -268,7 +365,8 @@ export function useCopy() {
|
|
|
268
365
|
);
|
|
269
366
|
}
|
|
270
367
|
|
|
271
|
-
// Choice chips for options and filters:
|
|
368
|
+
// Choice chips for options and filters: tappable, filled when chosen. Next up's fact pills (Pill) aren't tappable, and lead
|
|
369
|
+
// with an icon half instead.
|
|
272
370
|
export function Toggle({ label, active, onPress }: { label: string; active: boolean; onPress: () => void }) {
|
|
273
371
|
const { c } = useStyles();
|
|
274
372
|
return (
|
package/docs/architecture.md
CHANGED
|
@@ -27,7 +27,7 @@ flowchart LR
|
|
|
27
27
|
- Client: one screen and a sidebar header item. 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
|
-
- **GitHub access** goes through the host's existing `gh` login. The plugin stores no token [SEC-01].
|
|
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].
|
|
31
31
|
- **Setup checklist** [SET-01]: when a refresh fails, the screen asks the server what setup needs (`gh api user` for whether `gh` is there and who it's signed in as, and whether `config.json` parses). If `gh` is missing or signed out, or the file is broken, a checklist takes the tabs' place. Each line says how to fix it, and Check again refreshes. It also lists what's covered, the Paseo projects with a GitHub remote, and which profile sessions will use. Other failures, like a network error, stay a red line above the tabs.
|
|
32
32
|
- **Settings screen** [SRC-02], under Settings → Plugins → Attention Span and the gear next to ⟳: orgs and repos, one per row. Each is checked with `gh api users/<org>` (it must be an organization, since searches use `org:`) or `gh api repos/<owner>/<name>` before it's saved, and GitHub's exact name is kept. Saving rewrites only `orgs` and `repos` in `config.json`, refuses a file that doesn't parse, and refreshes the lists. A Replies section has one switch, Follow threads I've commented on, which writes only `followThreads` [ATT-17].
|
|
33
33
|
- **Local files** live in `~/.config/paseo-attention-span/`:
|
|
@@ -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], the scopes and
|
|
43
|
+
- `state.json`: dismissals [ATT-08], 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].
|
|
44
44
|
|
|
45
45
|
## Tabs
|
|
46
46
|
|
|
@@ -53,7 +53,9 @@ The tabs tell the story of my work, left to right: what I finished, what needs m
|
|
|
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
|
|
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`).
|
|
57
|
+
|
|
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].
|
|
57
59
|
|
|
58
60
|
Something whose meaning isn't obvious, like a face on a card or an amber age, explains itself with `Hint` in `client/ui.tsx` [ATT-19, ATT-11]: its text is the screen-reader label, and on desktop it shows after a 300 ms rest of the pointer. It floats over the layout rather than in it, so showing it moves nothing, and it's sized to the room left in the nearest `HintArea` (a card's text column, a sheet's top), beside its content and wrapping upward, or above it where there's too little room beside. A chip takes one through `hint`.
|
|
59
61
|
|
|
@@ -100,15 +102,19 @@ Top to bottom. Each item appears once, under its most urgent reason [ATT-02]. `s
|
|
|
100
102
|
|
|
101
103
|
## Next up
|
|
102
104
|
|
|
103
|
-
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. Issues without a value go last. Each card shows the
|
|
105
|
+
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.
|
|
106
|
+
|
|
107
|
+
**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.
|
|
108
|
+
|
|
109
|
+
Projects are extra, so they never cost the searches they ride on (`server/projects.ts`). They need `read:project`, and without it GitHub fails the whole search, so the server first asks a one-line probe (`viewer { projectsV2(first: 1) }`), at most hourly and for 10 s at most, and adds the `projects` fragment to Next up's two searches only when the probe actually lists projects. Whatever then goes wrong with a search that reads them (GitHub failing it, answering without its results, whatever the words, or taking over 20 s), it's sent again without, and Settings says why. The boards' statuses get 20 s per batch of 50 boards too, so nothing about projects can hold up the refresh. Settings › Next up fields has a **Projects** row, asked again each time Settings opens: On; with a `gh` login missing the scope, the `gh auth refresh -s read:project` command with Copy command; with a token from `GH_TOKEN` or `GITHUB_TOKEN`, which `gh` reads first, the permission to give it (`read:project` classic, *Projects: read* fine-grained) and a daemon restart; otherwise GitHub's own words. While on, what went wrong reading them on the last refresh, like boards an org's SSO hides, shows as "On, but GitHub said: …" until a refresh reads them cleanly. Doing, Waiting and History never read projects: the pills are about picking work up. **Claim & start** assigns me with `gh issue edit --add-assignee @me`, then starts a "start" session on a new branch [NXT-05]. Each row's sheet shows the issue's PRs, and offers **Claim** without starting, or **Unclaim** (`--remove-assignee @me`) on issues assigned to me; each is the other's Undo [NXT-07].
|
|
104
110
|
|
|
105
111
|
## Actions
|
|
106
112
|
|
|
107
113
|
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 Waiting and History cards where it's only Open PR (or issue) on GitHub, the card shows that action instead of ›; 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:
|
|
108
114
|
|
|
109
|
-
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].
|
|
110
|
-
2. **Every action,** each with a line saying what it will do, in one list with
|
|
111
|
-
3. **What's fetched when it opens,** in one GraphQL request, so the refresh stays as light as before [GH-01]: the PR's size and the linked issue or PRs, leaving out PRs the stack already shows. It comes last so the actions don't move when it arrives. The description isn't shown; making sense of it takes GitHub anyway.
|
|
115
|
+
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].
|
|
116
|
+
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], 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].
|
|
117
|
+
3. **What's fetched when it opens,** in one GraphQL request, so the refresh stays as light as before [GH-01]: the PR's size, led by its number on an issue's sheet ("PR #103 · +149 −15 · 5 files"), and the linked issue or PRs, leaving out PRs the stack already shows. It comes last so the actions don't move when it arrives. The description isn't shown; making sense of it takes GitHub anyway.
|
|
112
118
|
|
|
113
119
|
An agent icon (Tabler's `message-ai`, a speech bubble with "AI") marks every action that starts or continues an agent session, marked *(agent)* below; the rest change GitHub right away [ATT-13]. GitHub actions don't ask first, apart from Merge and Close. Instead an Undo row appears, where GitHub can take it back, until I switch tabs [ATT-14].
|
|
114
120
|
|
|
@@ -118,7 +124,7 @@ An agent icon (Tabler's `message-ai`, a speech bubble with "AI") marks every act
|
|
|
118
124
|
| Acknowledge | Mention waiting | Lists every waiting comment in full, rendered as Markdown with Paseo's renderer (cut after whole blocks, up to about 4,000 characters), all ticked; 👍 on the ones I keep ticked (`addReaction`), which clears them [MEN-07]. Undo removes them. |
|
|
119
125
|
| Review *(agent)* | Review requested | Session in a PR checkout using the review profile [SES-01]. For a stack, "Review stack": one session in a checkout of the stack's top, whose prompt lists every branch and asks for a review of only the PRs requesting mine, each against its own base, with their descriptions and recent comments as context [ATT-04] |
|
|
120
126
|
| Fix CI / Address comments *(agent)* | CI failing / changes requested | Session with the failing log or unresolved threads in the prompt [SES-04] |
|
|
121
|
-
| Rerun failed jobs | CI failing, in the sheet | `gh run rerun --failed` for each failing GitHub Actions run of the PR, or of every PR of mine in its stack.
|
|
127
|
+
| Rerun failed jobs | CI failing, in the sheet | `gh run rerun --failed` for each failing GitHub Actions run of the PR, or of every PR of mine in its stack. Its line, fetched when the sheet opens, says in one line how many failed, which (a matrix's jobs as one, "e2e ×3"; a job alone by its full name), and whether they were rerun before (`gh api …/runs/<id>`), in amber once they were, a hint they may not be flaky: "7 failed · lint, e2e ×3, unit ×2 · ↻ rerun once". Hovering it lists every check by full name; on phones it wraps to two lines instead. Other status checks can't be rerun from here, so they're dimmer. It can be pressed before the checks are in: the sheet closes, and it reruns once they are (`shared/checks.ts`) [PRS-09]. |
|
|
122
128
|
| Update branch | Behind with no conflicts, not stacked | `updatePullRequestBranch` (rebase) [UPS-03] |
|
|
123
129
|
| Rebase / Refresh *(agent)* | Conflicts, any stacked PR, stale draft | Agent rebases the PR, or my PRs in the stack with `git rebase --update-refs`; others' branches in it are never pushed [UPS-04]. A clean rebase is pushed with `--force-with-lease` [UPS-06]. After resolving conflicts it stops and explains, and pushes only when I reply "push" in its session [UPS-05]. |
|
|
124
130
|
| Ready for review | My draft with CI not failing, no conflicts, not stale | `markPullRequestReadyForReview` on the bottom PR, then the reviewer picker below; Skip leaves it in *Needs a reviewer*. Undo converts it back to a draft [PRS-11] |
|
|
@@ -130,7 +136,7 @@ An agent icon (Tabler's `message-ai`, a speech bubble with "AI") marks every act
|
|
|
130
136
|
|
|
131
137
|
A tap starts with defaults. An existing workspace for the branch or PR is resumed instead of creating a new one.
|
|
132
138
|
|
|
133
|
-
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].
|
|
139
|
+
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].
|
|
134
140
|
|
|
135
141
|
## Sessions
|
|
136
142
|
|
|
@@ -180,9 +186,9 @@ One GraphQL request per search, sent in parallel. GitHub runs the searches in on
|
|
|
180
186
|
- `is:issue is:open assignee:@me`
|
|
181
187
|
- `is:open involves:@me updated:>=<30 days ago> sort:updated-desc`, 100 at most, issues and PRs with their last 10 conversation comments, as for mentions (for Answered and fresh questions) [ATT-16]
|
|
182
188
|
- `is:issue is:open author:@me commenter:@me sort:updated-desc`, 50 at most, no date limit, the same fields (questions on my own issues nobody answered, however old) [ATT-11]
|
|
183
|
-
- `is:issue is:open no:assignee` (Next up, with issue type and field values; one request per source [NXT-09], skipped when there's nowhere to look [NXT-08]). "My repos" needs my login, taken from the last fetch or asked once with `viewer { login }`
|
|
189
|
+
- `is:issue is:open no:assignee` (Next up, with issue type and field values, and projects when the login may read them [NXT-12]; one request per source [NXT-09], skipped when there's nowhere to look [NXT-08]). "My repos" needs my login, taken from the last fetch or asked once with `viewer { login }`
|
|
184
190
|
|
|
185
|
-
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 of org issue fields when Next up needs
|
|
191
|
+
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.
|
|
186
192
|
|
|
187
193
|
A live refresh is 8 requests and about 85 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.
|
|
188
194
|
|
|
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.server.ts
CHANGED
|
@@ -53,6 +53,8 @@ export default function contribute(server: PluginServerContext) {
|
|
|
53
53
|
server.handle(rpc.myOrgs, async () => ({ orgs: await myOrgs() }));
|
|
54
54
|
server.handle(rpc.setScopes, ({ scopes }) => ready(() => attention.setScopes(scopes)).then(() => ({ ok: true as const })));
|
|
55
55
|
server.handle(rpc.setSources, ({ sources }) => ready(() => attention.setSources(sources)).then(() => ({ ok: true as const })));
|
|
56
|
+
server.handle(rpc.setProjectFilter, ({ projects }) => ready(() => attention.setProjectFilter(projects)).then(() => ({ ok: true as const })));
|
|
57
|
+
server.handle(rpc.projectsAccess, () => ready(() => attention.projectsAccess(true)));
|
|
56
58
|
server.handle(rpc.updateBranch, ({ key, target }) => act(key, () => updateBranch(target), chip("updating")));
|
|
57
59
|
server.handle(rpc.mergePullRequest, ({ key, target }) => act(key, () => mergePullRequest(target), { kind: "finished" }));
|
|
58
60
|
server.handle(rpc.closePullRequest, ({ key, target, comment }) => act(key, () => closePullRequest(target, comment), { kind: "gone" }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrioid/paseo-attention-span",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.11",
|
|
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/requirements.yaml
CHANGED
|
@@ -36,6 +36,7 @@ functional:
|
|
|
36
36
|
ATT-17: choose to follow threads I've commented on, so recent replies after mine there show without a tag, off by default; so that surfacing other people's threads is my choice, and the list stays signal, not noise.
|
|
37
37
|
ATT-18: see a calm, restful scene in Doing when nothing needs me, only once a refresh has confirmed it; so that a clear list feels like rest rather than a blank page, and calm never stands in for a check that failed or hasn't run.
|
|
38
38
|
ATT-19: tell at a glance what each person shown on an item is to it: someone I'm waiting on, who opened it, or whose comments are left to address, with an icon by their picture and the meaning in words when I point at it; so that a face and a time never leave me guessing.
|
|
39
|
+
ATT-20: tell which item a card is on every tab by its number first, then its repository with the repository's name standing out from its owner, which my own repositories leave out; so that cards from several repositories scan without reading each one in full.
|
|
39
40
|
mentions:
|
|
40
41
|
As a developer, I can:
|
|
41
42
|
MEN-01: see open threads where a person mentioned me and is still waiting for my response; so that I only hear about mentions when someone is waiting for me.
|
|
@@ -89,15 +90,16 @@ functional:
|
|
|
89
90
|
As a developer, I can:
|
|
90
91
|
NXT-01: see open issues nobody is assigned to, apart from the work that needs me; so that I can get an idea of what to do next.
|
|
91
92
|
NXT-02: see unclaimed issues ordered by priority, then effort, then age; so that the most important quick wins come first.
|
|
92
|
-
NXT-03: filter unclaimed issues by scope, and have my choice remembered; so that I only see work I'd pick up.
|
|
93
|
+
NXT-03: filter unclaimed issues by scope, and by project and its statuses, each project's statuses listed under it in the board's order, with issues on no project or without a status as choices of their own, and have my choice remembered; so that I only see work I'd pick up.
|
|
93
94
|
NXT-04: choose in the app where unclaimed issues come from (my own repositories, organizations I belong to, or single repositories) and choose which issue fields the list uses, with fields named Priority, Effort and Scope used until I do; so that the plugin can be used elsewhere without editing files.
|
|
94
95
|
NXT-05: claim an issue and start a session on it in one step; so that teammates see it's taken and I can start right away.
|
|
95
96
|
NXT-06: see issues assigned to me before unclaimed ones; so that I finish what I've taken before picking more.
|
|
96
97
|
NXT-07: claim an issue without starting a session, and give back one assigned to me; so that what I've taken matches what I'll do.
|
|
97
98
|
NXT-08: see unclaimed issues from the repositories of my Paseo projects when I haven't chosen any; so that Next up is useful without setup and never fills with strangers' issues.
|
|
98
99
|
NXT-09: filter unclaimed issues by where they came from, and have my choice remembered; so that I can focus on one source at a time.
|
|
99
|
-
NXT-10: see on each issue its repository, priority, effort and scope at a glance, 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.
|
|
100
|
+
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.
|
|
100
101
|
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.
|
|
102
|
+
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.
|
|
101
103
|
waiting:
|
|
102
104
|
As a developer, I can:
|
|
103
105
|
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.
|