@andrioid/paseo-attention-span 0.4.5 → 0.4.6
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 +26 -8
- package/client/still.tsx +129 -0
- package/docs/architecture.md +3 -1
- package/docs/screenshots/desktop-dark-doing-clear.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.png +0 -0
- package/docs/screenshots/phone-dark-doing.png +0 -0
- package/docs/screenshots/phone-light-next-up-filtered.png +0 -0
- package/package.json +2 -1
- package/requirements.yaml +1 -0
- package/shared/still.ts +20 -0
package/OVERVIEW.md
CHANGED
|
@@ -12,6 +12,10 @@ This is the one you'll live in. It's split by reason: someone's waiting for your
|
|
|
12
12
|
|
|
13
13
|
Each item shows up once, under whichever reason is most urgent. An issue and the PRs that close it count as one item, and so does a stack of PRs. A stack is one change wearing several PRs, so it shouldn't take up five rows.
|
|
14
14
|
|
|
15
|
+
When there's nothing in it, you get a quiet horizon that follows the time of day instead of a blank page. It only shows up once a refresh has actually checked, so it never says you're clear when it doesn't know.
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
|
|
15
19
|
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.
|
|
16
20
|
|
|
17
21
|
Every item has one main button that matches why it's there: Reply, Review, Fix CI, Merge. Open the item and you get 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.
|
|
@@ -7,6 +7,7 @@ import { Pressable, ScrollView, Text, View } from "react-native";
|
|
|
7
7
|
import { type ActionId, type AgentSummary, type AttentionView, type Chip, checkoutPr, type FailingChecks, type Item, itemSessions, liftActive, looseSessions, type NextUpIssue, ownStack, type Reviewer, type Section, type SectionId, SECTIONS, type SubRow, TAB_FEED, type TabId, type Target, type WaitingGroup, type WaitingOn } from "../shared/attention";
|
|
8
8
|
import { type AttentionConfig, nextUpSources, type SessionKind } from "../shared/config";
|
|
9
9
|
import { ago, linkList, repoLabel } from "../shared/format";
|
|
10
|
+
import { isClear } from "../shared/still";
|
|
10
11
|
import { workEmoji } from "../shared/work";
|
|
11
12
|
import { ACTION_SESSION, renderPrompt } from "../shared/prompts";
|
|
12
13
|
import * as rpc from "../shared/rpc";
|
|
@@ -16,6 +17,7 @@ import { useAttention } from "./data";
|
|
|
16
17
|
import { CardList, CardRow, type CardProps } from "./card";
|
|
17
18
|
import type { IconName } from "./icons";
|
|
18
19
|
import { NextUpList } from "./next-up";
|
|
20
|
+
import { Still } from "./still";
|
|
19
21
|
import { agentSignal, sessionEntry, startAnotherEntry } from "./session-menu";
|
|
20
22
|
import { ActionSheet, DetailLines, type SheetEntry } from "./sheet";
|
|
21
23
|
import { FeedbackAsk, FeedbackLine, type FeedbackScreen, FeedbackSheet } from "./feedback";
|
|
@@ -310,6 +312,8 @@ function AttentionList({
|
|
|
310
312
|
|
|
311
313
|
// Each tab shows how fresh its own feed is.
|
|
312
314
|
const feed = view.feeds[TAB_FEED[tab]];
|
|
315
|
+
// Calm only once a refresh that worked says Doing is empty [ATT-18].
|
|
316
|
+
const clear = isClear(view, !!attention.error);
|
|
313
317
|
const refreshing = feed.refreshing || attention.isFetching;
|
|
314
318
|
const counts: Record<TabId, number> = {
|
|
315
319
|
history: view.history.filter((item) => item.section === "done").length,
|
|
@@ -373,7 +377,8 @@ function AttentionList({
|
|
|
373
377
|
};
|
|
374
378
|
|
|
375
379
|
return (
|
|
376
|
-
|
|
380
|
+
// A clear Doing tab fills the screen, so its scene has room and the rest sits at the bottom [ATT-18].
|
|
381
|
+
<ScrollView style={styles.screen} contentContainerStyle={[styles.content, tab === "doing" && clear ? { flexGrow: 1 } : null]}>
|
|
377
382
|
<View style={[styles.row, { justifyContent: "space-between", flexWrap: "wrap" }]}>
|
|
378
383
|
<View style={styles.row}>
|
|
379
384
|
{TABS.map(({ id, label, icon }) => (
|
|
@@ -421,9 +426,13 @@ function AttentionList({
|
|
|
421
426
|
{tab === "history" ? <History items={view.history} actions={actions} /> : null}
|
|
422
427
|
{tab === "doing" ? (
|
|
423
428
|
<>
|
|
424
|
-
<Sections sections={view.doing} actions={actions}
|
|
429
|
+
{clear ? <Still /> : view.doing.length ? <Sections sections={view.doing} actions={actions} /> : !feed.fetchedAt && !feed.error ? <Loading text="Checking GitHub…" /> : null}
|
|
425
430
|
{view.dismissedCount > undoable.filter((row) => row.dismissal).length ? (
|
|
426
|
-
<Pressable
|
|
431
|
+
<Pressable
|
|
432
|
+
accessibilityRole="button"
|
|
433
|
+
style={clear ? { alignSelf: "center", opacity: 0.7 } : undefined}
|
|
434
|
+
onPress={() => void run("restore", "Restore", async () => (attention.setView(await restore({})), setUndoable([])))}
|
|
435
|
+
>
|
|
427
436
|
<Text style={styles.muted}>{view.dismissedCount} dismissed · show them again</Text>
|
|
428
437
|
</Pressable>
|
|
429
438
|
) : null}
|
|
@@ -493,6 +502,7 @@ function AttentionList({
|
|
|
493
502
|
function Tab({ icon, label, count, active, onPress }: { icon: IconName; label: string; count: number; active: boolean; onPress: () => void }) {
|
|
494
503
|
const styles = useStyles();
|
|
495
504
|
const color = active ? styles.c.foreground : styles.c.foregroundMuted;
|
|
505
|
+
// A soft round badge for the count, a shade brighter on the open tab; green marks only where I am.
|
|
496
506
|
return (
|
|
497
507
|
<Pressable
|
|
498
508
|
accessibilityRole="tab"
|
|
@@ -501,14 +511,24 @@ function Tab({ icon, label, count, active, onPress }: { icon: IconName; label: s
|
|
|
501
511
|
onPress={onPress}
|
|
502
512
|
style={[styles.row, { gap: 6, paddingVertical: 7, paddingHorizontal: styles.compact ? 9 : 12, borderRadius: 9, backgroundColor: active ? styles.c.surface2 : "transparent" }]}
|
|
503
513
|
>
|
|
504
|
-
<TablerIcon name={icon} size={16} color={color} />
|
|
514
|
+
<TablerIcon name={icon} size={16} color={active ? styles.action : color} />
|
|
505
515
|
{/* On phones only the active tab is labelled, so four tabs fit. */}
|
|
506
516
|
{active || !styles.compact ? <Text style={{ color, fontSize: 14, fontWeight: active ? "600" : "400" }}>{label}</Text> : null}
|
|
507
|
-
<
|
|
517
|
+
<View style={{ minWidth: 20, alignItems: "center", paddingHorizontal: 6, paddingVertical: 1, borderRadius: 9, backgroundColor: tint(styles.c.foreground, active ? 0.14 : 0.08) }}>
|
|
518
|
+
<Text style={{ color, fontSize: 11, fontWeight: "500" }}>{count}</Text>
|
|
519
|
+
</View>
|
|
508
520
|
</Pressable>
|
|
509
521
|
);
|
|
510
522
|
}
|
|
511
523
|
|
|
524
|
+
// A theme colour, see-through, so a badge reads on any surface; colours that aren't #rrggbb fall back to none.
|
|
525
|
+
function tint(color: string, alpha: number): string {
|
|
526
|
+
const hex = /^#([0-9a-f]{6})/i.exec(color)?.[1];
|
|
527
|
+
if (!hex) return "transparent";
|
|
528
|
+
const [r, g, b] = [0, 2, 4].map((at) => parseInt(hex.slice(at, at + 2), 16));
|
|
529
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
530
|
+
}
|
|
531
|
+
|
|
512
532
|
interface Actions {
|
|
513
533
|
agents: AgentSummary[];
|
|
514
534
|
startWithOptions: (spec: OptionsSpec) => void;
|
|
@@ -966,9 +986,7 @@ function WaitingOnLine({ people, expanded }: { people: WaitingOn[]; expanded: bo
|
|
|
966
986
|
);
|
|
967
987
|
}
|
|
968
988
|
|
|
969
|
-
function Sections({ sections, actions
|
|
970
|
-
const styles = useStyles();
|
|
971
|
-
if (sections.length === 0) return <Text style={styles.text}>{empty}</Text>;
|
|
989
|
+
function Sections({ sections, actions }: { sections: Section[]; actions: Actions }) {
|
|
972
990
|
return sections.map((section) => (
|
|
973
991
|
<View key={section.id}>
|
|
974
992
|
<SectionHeader icon={SECTION_ICONS[section.id]} title={section.title} count={section.items.length} />
|
package/client/still.tsx
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
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";
|
|
4
|
+
import { themeName } from "../shared/feedback";
|
|
5
|
+
import { type Scene, sceneAt } from "../shared/still";
|
|
6
|
+
import { useStyles } from "./ui";
|
|
7
|
+
|
|
8
|
+
// Doing with nothing in it: a horizon that follows the clock, and nothing that asks for anything [ATT-18].
|
|
9
|
+
// It settles in on every arrival, then stays still; the hour changing crossfades it.
|
|
10
|
+
|
|
11
|
+
// One tint per time of day, darker on light themes so it holds up on white.
|
|
12
|
+
const TINTS: Record<"dark" | "light", Record<Scene, string>> = {
|
|
13
|
+
dark: { morning: "#d4b47c", midday: "#8fbf9f", evening: "#d49a7e", night: "#a6a1cf" },
|
|
14
|
+
light: { morning: "#c49a4e", midday: "#5f9f76", evening: "#c97b5a", night: "#7f78b8" },
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// Drawn on a 240 × 110 canvas; the waterline is at y = 66. Each layer is its own SVG so it can move on its own.
|
|
18
|
+
const W = 240;
|
|
19
|
+
const H = 110;
|
|
20
|
+
const svg = (body: string) =>
|
|
21
|
+
`<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
|
+
const SKY: Record<Scene, string> = {
|
|
24
|
+
morning: svg(`<path d="M100 66a20 20 0 0 1 40 0"/>`),
|
|
25
|
+
midday: svg(`<circle cx="120" cy="30" r="16"/>`),
|
|
26
|
+
evening: svg(`<path d="M88 66a32 32 0 0 1 64 0"/>`),
|
|
27
|
+
night: svg(
|
|
28
|
+
`<path d="M126 18a16 16 0 1 0 14 22a12.5 12.5 0 0 1 -14 -22z"/>` +
|
|
29
|
+
[
|
|
30
|
+
[70, 24],
|
|
31
|
+
[168, 16],
|
|
32
|
+
[190, 40],
|
|
33
|
+
[52, 46],
|
|
34
|
+
]
|
|
35
|
+
.map(([x, y]) => `<circle cx="${x}" cy="${y}" r="1" fill="currentColor" stroke="none" opacity=".6"/>`)
|
|
36
|
+
.join(""),
|
|
37
|
+
),
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// The sun's light on the water, fading downwards; wider under a low sun.
|
|
41
|
+
const WIDTHS: Record<Scene, number[]> = { morning: [40, 26, 12], midday: [24, 16, 8], evening: [56, 40, 20], night: [30, 18, 8] };
|
|
42
|
+
const WATER: Record<Scene, string> = Object.fromEntries(
|
|
43
|
+
(Object.keys(WIDTHS) as Scene[]).map((scene) => [
|
|
44
|
+
scene,
|
|
45
|
+
svg(WIDTHS[scene].map((width, i) => `<path d="M${W / 2 - width / 2} ${76 + i * 8}h${width}" stroke-opacity="${[0.45, 0.28, 0.15][i]}"/>`).join("")),
|
|
46
|
+
]),
|
|
47
|
+
) as Record<Scene, string>;
|
|
48
|
+
|
|
49
|
+
const LINE = { svg: svg(`<path d="M20 66h200"/>`) };
|
|
50
|
+
|
|
51
|
+
const SETTLE_MS = 700;
|
|
52
|
+
const CROSSFADE_MS = 4000;
|
|
53
|
+
const native = Platform.OS !== "web";
|
|
54
|
+
|
|
55
|
+
export function Still() {
|
|
56
|
+
const styles = useStyles();
|
|
57
|
+
const theme = themeName(styles.c.surface0);
|
|
58
|
+
const width = styles.compact ? 200 : 240;
|
|
59
|
+
const height = Math.round((width * H) / W);
|
|
60
|
+
|
|
61
|
+
// Arrival: the sky drifts up as it fades in, then the reflections draw in; skipped for reduced motion.
|
|
62
|
+
const arrive = useRef(new Animated.Value(0)).current;
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
let cancelled = false;
|
|
65
|
+
const settle = Animated.timing(arrive, { toValue: 1, duration: SETTLE_MS, easing: Easing.out(Easing.cubic), useNativeDriver: native });
|
|
66
|
+
AccessibilityInfo.isReduceMotionEnabled()
|
|
67
|
+
.catch(() => false)
|
|
68
|
+
.then((reduce) => {
|
|
69
|
+
if (cancelled) return;
|
|
70
|
+
if (reduce) arrive.setValue(1);
|
|
71
|
+
else settle.start();
|
|
72
|
+
});
|
|
73
|
+
return () => {
|
|
74
|
+
cancelled = true;
|
|
75
|
+
settle.stop();
|
|
76
|
+
};
|
|
77
|
+
}, [arrive]);
|
|
78
|
+
|
|
79
|
+
// The clock: checked every minute, and a new hour crossfades in slowly.
|
|
80
|
+
const [scene, setScene] = useState<Scene>(() => sceneAt(new Date()));
|
|
81
|
+
const [previous, setPrevious] = useState<Scene | null>(null);
|
|
82
|
+
const shown = useRef(scene);
|
|
83
|
+
const fade = useRef(new Animated.Value(1)).current;
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
const timer = setInterval(() => {
|
|
86
|
+
const next = sceneAt(new Date());
|
|
87
|
+
if (next === shown.current) return;
|
|
88
|
+
setPrevious(shown.current);
|
|
89
|
+
setScene((shown.current = next));
|
|
90
|
+
fade.setValue(0);
|
|
91
|
+
Animated.timing(fade, { toValue: 1, duration: CROSSFADE_MS, easing: Easing.inOut(Easing.quad), useNativeDriver: native }).start(({ finished }) => finished && setPrevious(null));
|
|
92
|
+
}, 60_000);
|
|
93
|
+
return () => clearInterval(timer);
|
|
94
|
+
}, [fade]);
|
|
95
|
+
|
|
96
|
+
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
|
+
const waterIn = { opacity: arrive.interpolate({ inputRange: [0, 0.35, 1], outputRange: [0, 0, 1] }) };
|
|
98
|
+
const fadeOut = fade.interpolate({ inputRange: [0, 1], outputRange: [1, 0] });
|
|
99
|
+
|
|
100
|
+
// SvgXml draws a size × size square; the canvas sits in its middle, so crop the square to the canvas.
|
|
101
|
+
const layer = (icon: { svg: string }, color: string) => (
|
|
102
|
+
<View style={{ position: "absolute", left: 0, right: 0, top: -(width - height) / 2 }}>
|
|
103
|
+
<Icon icon={icon} size={width} color={color} />
|
|
104
|
+
</View>
|
|
105
|
+
);
|
|
106
|
+
const scenery = (shown: Scene, opacity: Animated.AnimatedInterpolation<number> | Animated.Value) => (
|
|
107
|
+
<Animated.View key={shown} style={{ position: "absolute", inset: 0, opacity }}>
|
|
108
|
+
<Animated.View style={[{ position: "absolute", inset: 0 }, skyIn]}>{layer({ svg: SKY[shown] }, TINTS[theme][shown])}</Animated.View>
|
|
109
|
+
<Animated.View style={[{ position: "absolute", inset: 0 }, waterIn]}>{layer({ svg: WATER[shown] }, TINTS[theme][shown])}</Animated.View>
|
|
110
|
+
</Animated.View>
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
// Upper two-fifths: a little above the middle, so it reads as a place, not a floating notice.
|
|
115
|
+
<View style={{ flex: 1, minHeight: styles.compact ? 300 : 360 }}>
|
|
116
|
+
<View style={{ flex: 2 }} />
|
|
117
|
+
<View accessible accessibilityLabel="Nothing needs you right now." style={{ alignItems: "center", gap: 12 }}>
|
|
118
|
+
<View style={{ width, height, overflow: "hidden" }} importantForAccessibility="no-hide-descendants" accessibilityElementsHidden>
|
|
119
|
+
<View style={{ position: "absolute", inset: 0, opacity: 0.6 }}>{layer(LINE, styles.c.foregroundMuted)}</View>
|
|
120
|
+
{previous ? scenery(previous, fadeOut) : null}
|
|
121
|
+
{scenery(scene, fade)}
|
|
122
|
+
</View>
|
|
123
|
+
<Text style={{ color: styles.c.foreground, fontSize: 17, fontWeight: "600", marginTop: 6 }}>Nothing's on you.</Text>
|
|
124
|
+
<Text style={[styles.muted, { fontSize: 13 }]}>Enjoy the quiet.</Text>
|
|
125
|
+
</View>
|
|
126
|
+
<View style={{ flex: 3 }} />
|
|
127
|
+
</View>
|
|
128
|
+
);
|
|
129
|
+
}
|
package/docs/architecture.md
CHANGED
|
@@ -44,7 +44,7 @@ flowchart LR
|
|
|
44
44
|
|
|
45
45
|
## Tabs
|
|
46
46
|
|
|
47
|
-
The tabs tell the story of my work, left to right: what I finished, what needs me, what waits on others, what's next. The screen opens on **Doing**, and the sidebar entry "Attention" shows Doing's count [ATT-09]. On phones only the active tab shows its label.
|
|
47
|
+
The tabs tell the story of my work, left to right: what I finished, what needs me, what waits on others, what's next. The screen opens on **Doing**, and the sidebar entry "Attention" shows Doing's count [ATT-09]. On phones only the active tab shows its label. Each tab's count sits in a soft badge, and only the open tab's icon is green.
|
|
48
48
|
|
|
49
49
|
| Tab | Shows |
|
|
50
50
|
|---|---|
|
|
@@ -78,6 +78,8 @@ Top to bottom. Each item appears once, under its most urgent reason [ATT-02]. `s
|
|
|
78
78
|
| Needs a reviewer | My PRs nobody has been asked to review, even while CI runs [PRS-12]. Only what GitHub records counts as asked: a pending request, an approval or requested changes. GitHub drops a reviewer's request once they review, so a review that only commented, by a person or a bot, leaves it here to re-request; the repo, not us, decides whose approval counts |
|
|
79
79
|
| My drafts | My drafts, with their own state tags [PRS-05, PRS-06] |
|
|
80
80
|
|
|
81
|
+
**Nothing in Doing** shows a horizon instead of a list (`client/still.tsx`) [ATT-18], with "Nothing's on you. Enjoy the quiet." It follows the device's clock at fixed hours: a low sun in the morning (5–11), a high sun at midday (11–16), a setting sun in the evening (16–21), and a moon with a few stars at night, each in its own soft tint. It settles in on every arrival on the tab (the sky drifts up as it fades in, then its reflections, 700 ms; not with reduced motion), then holds still; when the hour changes while it's open, it crossfades. It shows only after a refresh that worked: before the first one there's a spinner, and after a failed one just the error. Items that are all dismissed count as clear; the "show them again" line sits faintly at the bottom.
|
|
82
|
+
|
|
81
83
|
## Rules
|
|
82
84
|
|
|
83
85
|
- **One item per issue** [ATT-03]: PRs are grouped under the issue they work on, across repos. GitHub links (`closingIssuesReferences`) only PRs into the default branch, so a stack's upper PRs are read too. For a stack, strongest evidence first: what GitHub links on any of its PRs, bottom first; then a closing keyword ("Closes #N") in any PR's description; then the one issue the bottom PR's description mentions ("First of three for #N"), and none when it mentions several. Code, quotes and template comments don't count. References from descriptions are looked up in the details request, and only open issues count, so a reference to a PR doesn't group. A PR without an issue is its own item. History does the same per merged PR, against the closed issues it lists.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
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.6",
|
|
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": {
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"assets/",
|
|
25
25
|
"requirements.yaml",
|
|
26
26
|
"docs/architecture.md",
|
|
27
|
+
"docs/screenshots/desktop-dark-doing-clear.png",
|
|
27
28
|
"docs/screenshots/desktop-dark-doing-acknowledge.png",
|
|
28
29
|
"docs/screenshots/desktop-dark-doing-issue-sheet.png",
|
|
29
30
|
"docs/screenshots/desktop-dark-doing-reviewers.png",
|
package/requirements.yaml
CHANGED
|
@@ -34,6 +34,7 @@ functional:
|
|
|
34
34
|
ATT-15: copy any item's GitHub link; so that I can share it without opening GitHub.
|
|
35
35
|
ATT-16: see recent comments without a mention on issues and pull requests I opened, until I reply, react or dismiss them; so that answers to my questions don't get lost, while other people's threads stay out unless someone tags me.
|
|
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
|
+
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.
|
|
37
38
|
mentions:
|
|
38
39
|
As a developer, I can:
|
|
39
40
|
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.
|
package/shared/still.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AttentionView } from "./attention";
|
|
2
|
+
|
|
3
|
+
// The empty Doing tab: a horizon that follows the device's clock [ATT-18].
|
|
4
|
+
export type Scene = "morning" | "midday" | "evening" | "night";
|
|
5
|
+
|
|
6
|
+
// Fixed local hours, the same every day: morning 5–11, midday 11–16, evening 16–21, night 21–5.
|
|
7
|
+
export function sceneAt(date: Date): Scene {
|
|
8
|
+
const hour = date.getHours();
|
|
9
|
+
if (hour >= 5 && hour < 11) return "morning";
|
|
10
|
+
if (hour >= 11 && hour < 16) return "midday";
|
|
11
|
+
if (hour >= 16 && hour < 21) return "evening";
|
|
12
|
+
return "night";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Calm only when it's true: Doing is empty after a refresh that worked. Dismissed items don't count;
|
|
16
|
+
// they're not on me until something new happens [ATT-08]. Loading, a failed refresh or none yet show plainly.
|
|
17
|
+
export function isClear(view: Pick<AttentionView, "doing" | "feeds">, failed = false): boolean {
|
|
18
|
+
const live = view.feeds.live;
|
|
19
|
+
return view.doing.length === 0 && !!live.fetchedAt && !live.error && !failed;
|
|
20
|
+
}
|