cursedbelt 6.31.0 → 6.32.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/dist/react/Toast.js +1 -1
- package/dist/react/Toast.js.map +1 -1
- package/dist/react/components/BuildFreshness.d.ts +3 -3
- package/dist/react/components/DataTable/ColumnChecklist.d.ts +1 -1
- package/dist/react/components/DataTable/ColumnChecklist.js +1 -1
- package/dist/react/components/DataTable/DataTable.d.ts +2 -2
- package/dist/react/components/DataTable/TableFilterBuilder.d.ts +1 -1
- package/dist/react/components/DataTable/TableFilterBuilder.js +1 -1
- package/dist/react/components/DataTable/filterQuery.d.ts +1 -1
- package/dist/react/components/DataTable/filterQuery.js +1 -1
- package/dist/react/components/DataTable/useTableViewMode.d.ts +1 -1
- package/dist/react/components/DataTable/useTableViewMode.js +1 -1
- package/dist/react/components/ElsewhereNotice.d.ts +3 -3
- package/dist/react/components/FileDropZone.d.ts +1 -1
- package/dist/react/components/FileDropZone.js +1 -1
- package/dist/react/components/NativeSelect.d.ts +1 -1
- package/dist/react/deep-link/links.js +1 -1
- package/dist/react/engagement/beaconClient.d.ts +1 -1
- package/dist/react/engagement/beaconClient.js +1 -1
- package/dist/react/file-tree/FileTree.d.ts +3 -3
- package/dist/react/file-tree/FileTree.js +2 -2
- package/dist/react/folder-tree/FolderTreeRail.js +1 -1
- package/dist/react/folder-tree/FolderTreeRail.js.map +1 -1
- package/dist/react/folder-tree/NewFolderControl.js +1 -1
- package/dist/react/master-lock/MasterLockDialog.js +3 -3
- package/dist/react/media/DenseGalleryShell.d.ts +1 -1
- package/dist/react/media/FrameGrabber.d.ts +2 -2
- package/dist/react/media/FrameGrabber.js +3 -3
- package/dist/react/media/PlayerStrip.js +2 -2
- package/dist/react/media/VideoCutEditor.d.ts +4 -4
- package/dist/react/media/VideoPlayer.d.ts +4 -4
- package/dist/react/media/VideoPlayer.d.ts.map +1 -1
- package/dist/react/media/VideoPlayer.js +15 -15
- package/dist/react/media/VideoPlayer.js.map +1 -1
- package/dist/react/media/VideoTurner.js +2 -2
- package/dist/react/media/cutTimelineMath.js +1 -1
- package/dist/react/media/pictureEdit.d.ts +1 -1
- package/dist/react/media/sourceFault.d.ts +1 -1
- package/dist/react/media/sourceFault.js +5 -5
- package/dist/react/media/surfaceGesture.d.ts +1 -1
- package/dist/react/media/surfaceGesture.js +1 -1
- package/dist/react/media/videoRegion.d.ts +1 -1
- package/dist/react/media/videoRegion.js +1 -1
- package/dist/react/media-gallery/GalleryTable.d.ts +3 -3
- package/dist/react/media-gallery/MediaGallery.d.ts +4 -4
- package/dist/react/media-gallery/MediaGallery.js +10 -10
- package/dist/react/media-gallery/MediaGallery.js.map +1 -1
- package/dist/react/media-gallery/galleryDeepLink.js +1 -1
- package/dist/react/media-gallery/galleryItemMedia.d.ts +1 -1
- package/dist/react/media-gallery/galleryItemMedia.js +1 -1
- package/dist/react/media-gallery/mediaMeta.d.ts +1 -1
- package/dist/react/media-gallery/playbackPreferences.d.ts +6 -6
- package/dist/react/media-gallery/playbackPreferences.js +1 -1
- package/dist/react/notifications/IssueViews.d.ts +2 -2
- package/dist/react/notifications/IssueViews.js +2 -2
- package/dist/react/notifications/IssuesPage.d.ts +3 -3
- package/dist/react/notifications/IssuesPage.d.ts.map +1 -1
- package/dist/react/notifications/IssuesPage.js +3 -3
- package/dist/react/notifications/IssuesPage.js.map +1 -1
- package/dist/react/notifications/issueCapture.js +1 -1
- package/dist/react/notifications/issueCapture.js.map +1 -1
- package/dist/react/notifications/issues.d.ts +9 -9
- package/dist/react/notifications/issues.d.ts.map +1 -1
- package/dist/react/notifications/issues.js +6 -6
- package/dist/react/notifications/issues.js.map +1 -1
- package/dist/react/usePagedList.d.ts +14 -0
- package/dist/react/usePagedList.d.ts.map +1 -1
- package/dist/react/usePagedList.js +12 -0
- package/dist/react/usePagedList.js.map +1 -1
- package/dist/react/workspace-shell/notificationSource.js +1 -1
- package/dist/react/workspace-shell/notificationSource.js.map +1 -1
- package/dist/testing/designAudit.js +1 -1
- package/dist/testing/designAudit.js.map +1 -1
- package/package.json +3 -3
- package/scripts/guardrailsEnforce.ts +4 -4
- package/scripts/paths.ts +1 -1
- package/scripts/safari.ts +1 -1
- package/src/react/Toast.tsx +1 -1
- package/src/react/components/BuildFreshness.spec.tsx +1 -1
- package/src/react/components/BuildFreshness.tsx +3 -3
- package/src/react/components/DataTable/ColumnChecklist.tsx +1 -1
- package/src/react/components/DataTable/DataTable.tsx +2 -2
- package/src/react/components/DataTable/TableFilterBuilder.tsx +1 -1
- package/src/react/components/DataTable/filterQuery.ts +1 -1
- package/src/react/components/DataTable/useTableViewMode.ts +1 -1
- package/src/react/components/ElsewhereNotice.tsx +3 -3
- package/src/react/components/FileDropZone.tsx +1 -1
- package/src/react/components/NativeSelect.tsx +1 -1
- package/src/react/deep-link/links.ts +1 -1
- package/src/react/engagement/beaconClient.ts +1 -1
- package/src/react/file-tree/FileTree.spec.tsx +2 -2
- package/src/react/file-tree/FileTree.tsx +6 -6
- package/src/react/file-tree/fileTreeGeometry.spec.ts +2 -2
- package/src/react/folder-tree/FolderTreeRail.tsx +1 -1
- package/src/react/folder-tree/NewFolderControl.tsx +1 -1
- package/src/react/master-lock/MasterLockDialog.tsx +3 -3
- package/src/react/master-lock/MasterLockProvider.spec.tsx +2 -2
- package/src/react/media/DenseGalleryShell.tsx +1 -1
- package/src/react/media/FrameGrabber.spec.tsx +1 -1
- package/src/react/media/FrameGrabber.tsx +3 -3
- package/src/react/media/PlayerStrip.tsx +2 -2
- package/src/react/media/VideoCutEditor.spec.tsx +1 -1
- package/src/react/media/VideoCutEditor.tsx +4 -4
- package/src/react/media/VideoPlayer.spec.tsx +5 -5
- package/src/react/media/VideoPlayer.tsx +16 -16
- package/src/react/media/VideoTurner.tsx +2 -2
- package/src/react/media/cutTimelineMath.ts +1 -1
- package/src/react/media/pictureEdit.ts +1 -1
- package/src/react/media/playerStrip.spec.tsx +1 -1
- package/src/react/media/sourceFault.tsx +5 -5
- package/src/react/media/surfaceGesture.spec.ts +1 -1
- package/src/react/media/surfaceGesture.ts +1 -1
- package/src/react/media/videoRegion.ts +1 -1
- package/src/react/media-gallery/GalleryTable.tsx +3 -3
- package/src/react/media-gallery/MediaGallery.spec.tsx +10 -10
- package/src/react/media-gallery/MediaGallery.tsx +16 -16
- package/src/react/media-gallery/galleryDeepLink.ts +1 -1
- package/src/react/media-gallery/galleryItemMedia.tsx +1 -1
- package/src/react/media-gallery/mediaMeta.ts +1 -1
- package/src/react/media-gallery/playbackPreferences.spec.ts +7 -7
- package/src/react/media-gallery/playbackPreferences.ts +6 -6
- package/src/react/notifications/IssueViews.spec.tsx +2 -2
- package/src/react/notifications/IssueViews.tsx +3 -3
- package/src/react/notifications/IssuesPage.tsx +4 -4
- package/src/react/notifications/issueCapture.ts +1 -1
- package/src/react/notifications/issues.spec.ts +1 -1
- package/src/react/notifications/issues.ts +12 -12
- package/src/react/usePagedList.spec.tsx +49 -0
- package/src/react/usePagedList.ts +22 -0
- package/src/react/workspace-shell/notificationSource.ts +1 -1
- package/src/testing/designAudit.ts +1 -1
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from './playbackPreferences.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* 🔴 The volume
|
|
12
|
+
* 🔴 The volume the owner set stays set for the PAGE — and is gone on the next one.
|
|
13
13
|
*
|
|
14
14
|
* Owner, `ideas/collections-09-14.md`: *"Keep the media player volume where I set it after
|
|
15
15
|
* changing it during a session except if I refresh or first log in then continue starting it
|
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
* "neither web store is touched". 🔴 That is the load-bearing assertion in this file:
|
|
24
24
|
* `sessionStorage` sounds like the right home and is not, because it is cleared when the
|
|
25
25
|
* TAB closes rather than when the page loads (measured in this repo's own Chromium:
|
|
26
|
-
* write, reload, the value is still there). Moving this onto either store brings
|
|
27
|
-
* volume back loud across exactly the gesture
|
|
26
|
+
* write, reload, the value is still there). Moving this onto either store brings the owner's
|
|
27
|
+
* volume back loud across exactly the gesture they asked to return to silence, and nothing
|
|
28
28
|
* else in the suite would see it.
|
|
29
29
|
*
|
|
30
30
|
* The starting values the player derives from these live in `media/VideoPlayer.tsx`
|
|
@@ -38,8 +38,8 @@ import {
|
|
|
38
38
|
|
|
39
39
|
describe('the session volume', () => {
|
|
40
40
|
test('🔴 a surface nobody has touched has nothing set — so it starts at mute', () => {
|
|
41
|
-
// `null`, NOT the default value: the player has to be able to tell "
|
|
42
|
-
// it" from "
|
|
41
|
+
// `null`, NOT the default value: the player has to be able to tell "the owner has not touched
|
|
42
|
+
// it" from "the owner set it to 1.0 unmuted", or every click-to-play consumer in the fleet gets
|
|
43
43
|
// silently muted on upgrade. See `readSessionVolume`.
|
|
44
44
|
expect(readSessionVolume('test:untouched')).toBeNull();
|
|
45
45
|
// And the fallback the player uses in that case is silent.
|
|
@@ -54,7 +54,7 @@ describe('the session volume', () => {
|
|
|
54
54
|
|
|
55
55
|
test('🔴 muting keeps the level underneath, so unmuting is not a jump to full', () => {
|
|
56
56
|
// *"if I unmute it, keep that value"* — a mute stored as `volume: 0` would satisfy every
|
|
57
|
-
// other test here and return
|
|
57
|
+
// other test here and return the owner to silence on the press that asks for sound.
|
|
58
58
|
writeSessionVolume('test:muted-level', { volume: 0.4, muted: false });
|
|
59
59
|
writeSessionVolume('test:muted-level', { volume: 0.4, muted: true });
|
|
60
60
|
expect(readSessionVolume('test:muted-level')).toEqual({ volume: 0.4, muted: true });
|
|
@@ -91,7 +91,7 @@ describe('the session volume', () => {
|
|
|
91
91
|
*
|
|
92
92
|
* `localStorage` is the obvious wrong home and `sessionStorage` is the subtle one: it is
|
|
93
93
|
* cleared when the tab closes, NOT when the page reloads, so a "session" volume put there
|
|
94
|
-
* survives the F5
|
|
94
|
+
* survives the F5 the owner asked to return them to mute. Both are asserted, because the point of a
|
|
95
95
|
* check is to red on the change a later reader would consider an improvement.
|
|
96
96
|
*/
|
|
97
97
|
describe('a refresh forgets it, by construction', () => {
|
|
@@ -278,8 +278,8 @@ export function writeViewMode(mode: GalleryViewMode): void {
|
|
|
278
278
|
* Three rules, and the middle one is the whole design:
|
|
279
279
|
*
|
|
280
280
|
* | fresh page load / first sign-in | muted, exactly as it is today |
|
|
281
|
-
* |
|
|
282
|
-
* |
|
|
281
|
+
* | the owner changes it, then opens another clip | that level, for the rest of the session |
|
|
282
|
+
* | the owner refreshes | muted again |
|
|
283
283
|
*
|
|
284
284
|
* ── 🔴 It is kept IN MEMORY. Not `localStorage`, and not `sessionStorage` either ────────
|
|
285
285
|
* The neighbors above are `localStorage` because they are ways of WORKING — how a folder
|
|
@@ -291,8 +291,8 @@ export function writeViewMode(mode: GalleryViewMode): void {
|
|
|
291
291
|
* when the TAB closes, not when the page loads — MDN, in as many words: *"the data survives
|
|
292
292
|
* page reloads and restores"*. Measured here 2026-09-16 in the repo's own Chromium (write,
|
|
293
293
|
* `page.reload()`, read: the value is still there), because the difference is invisible in a
|
|
294
|
-
* unit test and is precisely the row of the table above that
|
|
295
|
-
* there comes back LOUD on the one gesture
|
|
294
|
+
* unit test and is precisely the row of the table above that the owner called out. A volume put
|
|
295
|
+
* there comes back LOUD on the one gesture the owner named as the one that must return to silence.
|
|
296
296
|
*
|
|
297
297
|
* A module-level `Map` dies with the document, which is what a person means by "this
|
|
298
298
|
* session". It is also why nothing here needs the `try` wrapping every reader above carries:
|
|
@@ -306,7 +306,7 @@ export function writeViewMode(mode: GalleryViewMode): void {
|
|
|
306
306
|
*
|
|
307
307
|
* ── 🔴 Muted and the level are TWO facts ────────────────────────────────────────────────
|
|
308
308
|
* *"if I unmute it, keep that value"* — so a mute may not be stored as `volume: 0`. Pressing
|
|
309
|
-
* mute and pressing unmute has to leave the level where
|
|
309
|
+
* mute and pressing unmute has to leave the level where the owner put it, which it only does if the
|
|
310
310
|
* level survives the mute independently. Every media element already models these two
|
|
311
311
|
* separately; collapsing them here is what would break it.
|
|
312
312
|
*/
|
|
@@ -340,7 +340,7 @@ export const STAGE_VOLUME_KEY = 'cbmg:stage-volume';
|
|
|
340
340
|
const sessionVolumes = new Map<string, SessionVolume>();
|
|
341
341
|
|
|
342
342
|
/**
|
|
343
|
-
* What
|
|
343
|
+
* What the owner set this session, or `null` for "the owner has not touched it".
|
|
344
344
|
*
|
|
345
345
|
* 🔴 `null` rather than {@link DEFAULT_SESSION_VOLUME}, and the distinction is load-bearing:
|
|
346
346
|
* a player that was never going to make a sound anyway (`autoPlay={false}`, which mutes
|
|
@@ -82,8 +82,8 @@ describe('BannerLane hint', () => {
|
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
-
describe('🔴 IssueBell — a red count of what
|
|
86
|
-
test('counts unseen; an active problem
|
|
85
|
+
describe('🔴 IssueBell — a red count of what the owner has not read', () => {
|
|
86
|
+
test('counts unseen; an active problem the owner has seen keeps a dot', () => {
|
|
87
87
|
const view = render(<IssueBell onOpen={() => {}} />);
|
|
88
88
|
const bell = () => view.container.querySelector('[data-cb-issue-bell]') as HTMLElement;
|
|
89
89
|
expect(bell().getAttribute('aria-label')).toBe('Notifications');
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* (NAV-10), not a toast: the owner asked for it *"right on screen for me to easily notice without
|
|
9
9
|
* covering too much of the page, so not a toast"*, there *"at the time of the issue occurring"*
|
|
10
10
|
* and leaving *"when the issue is over"* (forge task 4262).
|
|
11
|
-
* · {@link IssueBell} — a red count of what
|
|
11
|
+
* · {@link IssueBell} — a red count of what the owner has not read, in the top bar.
|
|
12
12
|
* · `IssuesPage` — the detail: what failed, what to expect, the facts and the requests and
|
|
13
13
|
* errors around it, with "Copy report".
|
|
14
14
|
*/
|
|
@@ -42,7 +42,7 @@ export interface IssueBannerProps extends Omit<HTMLAttributes<HTMLElement>, 'chi
|
|
|
42
42
|
/**
|
|
43
43
|
* Put connection trouble (offline, a server that does not answer) on the lane too. Default off:
|
|
44
44
|
* the {@link ConnectionDot} in the bar says it, and a ribbon that comes and goes with every
|
|
45
|
-
* blip of the router moves the page under
|
|
45
|
+
* blip of the router moves the page under the owner's hand.
|
|
46
46
|
*/
|
|
47
47
|
includeConnection?: boolean;
|
|
48
48
|
className?: string;
|
|
@@ -113,7 +113,7 @@ export interface IssueBellProps extends Omit<ButtonHTMLAttributes<HTMLButtonElem
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
|
-
* A bell with a red count of the problems
|
|
116
|
+
* A bell with a red count of the problems the owner has not looked at. Something still happening that the owner
|
|
117
117
|
* HAS seen keeps a small dot, so the bell never reads "all clear" while a problem lasts.
|
|
118
118
|
*/
|
|
119
119
|
export function IssueBell({ onOpen, className, current = false, size, ...rest }: IssueBellProps) {
|
|
@@ -94,7 +94,7 @@ interface CardContext {
|
|
|
94
94
|
now: number;
|
|
95
95
|
app?: string;
|
|
96
96
|
muted: boolean;
|
|
97
|
-
/** How many of its starts were new when
|
|
97
|
+
/** How many of its starts were new when the owner opened the page — read before opening marks them seen. */
|
|
98
98
|
fresh: number;
|
|
99
99
|
onNavigate?: (href: string, event: MouseEvent<HTMLAnchorElement>) => void;
|
|
100
100
|
}
|
|
@@ -186,7 +186,7 @@ function IssueCard({ issue, now, app, muted, fresh, onNavigate }: { issue: Issue
|
|
|
186
186
|
|
|
187
187
|
type MuteChoice = 'on' | 'hour' | 'tomorrow' | 'week' | 'forever' | 'current';
|
|
188
188
|
|
|
189
|
-
/** The end of a mute
|
|
189
|
+
/** The end of a mute the owner picks — "until tomorrow" is 8 in the morning, as Slack's is. */
|
|
190
190
|
export function muteUntil(choice: 'hour' | 'tomorrow' | 'week', now: number = Date.now()): number {
|
|
191
191
|
if (choice === 'hour') return now + 3_600_000;
|
|
192
192
|
if (choice === 'week') return now + 7 * 86_400_000;
|
|
@@ -248,9 +248,9 @@ export interface IssuesPageProps extends Omit<HTMLAttributes<HTMLDivElement>, 'c
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
/**
|
|
251
|
-
* The notifications page's body: what is happening now, what happened earlier, which kinds
|
|
251
|
+
* The notifications page's body: what is happening now, what happened earlier, which kinds the owner has
|
|
252
252
|
* silenced, and the page's own recent requests and errors. Opening it marks everything seen, and so
|
|
253
|
-
* does anything that arrives while it is open —
|
|
253
|
+
* does anything that arrives while it is open — the owner is looking at it — but each row keeps its "3 new"
|
|
254
254
|
* for as long as the page stays open.
|
|
255
255
|
*/
|
|
256
256
|
export function IssuesPage({ app, onNavigate, className, ...rest }: IssuesPageProps) {
|
|
@@ -190,7 +190,7 @@ export function installIssueCapture(options: IssueCaptureOptions = {}): () => vo
|
|
|
190
190
|
raiseIssue({
|
|
191
191
|
id: `slow:${host}`,
|
|
192
192
|
tone: 'warning',
|
|
193
|
-
// Its own kind, so
|
|
193
|
+
// Its own kind, so the owner can silence "slow" without silencing "can't reach" (BUILT_IN_NOTICE_TYPES).
|
|
194
194
|
area: 'slow',
|
|
195
195
|
title: `Waiting on ${nameOf(url as URL)} — it is slower than usual`,
|
|
196
196
|
outlook: 'Nothing has failed yet; this clears as soon as the answer arrives.',
|
|
@@ -75,7 +75,7 @@ describe('an issue is a state with a start and an end', () => {
|
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
describe('🔴 the bell counts what
|
|
78
|
+
describe('🔴 the bell counts what the owner has not looked at', () => {
|
|
79
79
|
test('a new issue is unseen; looking clears the count', () => {
|
|
80
80
|
raiseIssue(busy);
|
|
81
81
|
expect(issueSnapshot().unseen).toBe(1);
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* *"My first attempt to load a video is still spinning and never started playing over 5 minutes
|
|
6
6
|
* later. There has been no notification to tell me what is wrong."* The media server had lost its
|
|
7
7
|
* storage for 77 minutes after a reboot, every surface knew a request had failed, and the only
|
|
8
|
-
* thing on screen was a spinner.
|
|
8
|
+
* thing on screen was a spinner. The owner asked for three things, and this module is the one place
|
|
9
9
|
* all three read from:
|
|
10
10
|
*
|
|
11
11
|
* · a line ON the page while a problem lasts, gone when it ends — {@link IssueBanner};
|
|
12
|
-
* · a red count, so
|
|
12
|
+
* · a red count, so the owner knows there is something to read — {@link IssueBell};
|
|
13
13
|
* · a page with the detail: what failed, whether it will clear by itself or needs a code fix,
|
|
14
14
|
* and the console errors and requests involved, to copy into a report — {@link IssuesPage}.
|
|
15
15
|
*
|
|
@@ -32,7 +32,7 @@ import { useSyncExternalStore } from 'react';
|
|
|
32
32
|
*/
|
|
33
33
|
export type IssueTone = 'info' | 'success' | 'warning' | 'error';
|
|
34
34
|
|
|
35
|
-
/** Where a notification sends
|
|
35
|
+
/** Where a notification sends the owner — `View the 3 new failed jobs` → `/admin?tab=ai`. */
|
|
36
36
|
export interface IssueLink {
|
|
37
37
|
label: string;
|
|
38
38
|
href: string;
|
|
@@ -75,7 +75,7 @@ export interface Issue {
|
|
|
75
75
|
resolution?: string;
|
|
76
76
|
/** How many times this id has started, ever. */
|
|
77
77
|
occurrences: number;
|
|
78
|
-
/** How many of those happened since
|
|
78
|
+
/** How many of those happened since the owner last looked — the "3 new" on a batched row. */
|
|
79
79
|
sinceSeen?: number;
|
|
80
80
|
/** When this id FIRST started — kept across every later start, so a batch says how long it has recurred. */
|
|
81
81
|
firstAt?: number;
|
|
@@ -85,7 +85,7 @@ export interface Issue {
|
|
|
85
85
|
link?: IssueLink;
|
|
86
86
|
/** The ONE thing the banner offers instead of "Details": `reload` for a tab a deploy left behind. */
|
|
87
87
|
action?: 'reload';
|
|
88
|
-
/**
|
|
88
|
+
/** The owner has looked at it since it last started or got worse. */
|
|
89
89
|
seen: boolean;
|
|
90
90
|
/** Put away in the Notifications place's Archived tab; starting again or getting worse brings it back. */
|
|
91
91
|
archived?: boolean;
|
|
@@ -109,7 +109,7 @@ export interface IssueInput {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
|
-
* A kind of notification
|
|
112
|
+
* A kind of notification the owner can silence — keyed by {@link Issue.area}. The built-in kinds are what
|
|
113
113
|
* `installIssueCapture` and `toast.error` raise; an app names its own with {@link defineNoticeTypes}.
|
|
114
114
|
*/
|
|
115
115
|
export interface NoticeType {
|
|
@@ -122,7 +122,7 @@ export interface NoticeType {
|
|
|
122
122
|
|
|
123
123
|
/** A {@link NoticeType} as the settings list shows it: muted until when, if at all. */
|
|
124
124
|
export interface NoticeTypeState extends NoticeType {
|
|
125
|
-
/** Epoch ms the mute ends, `'forever'` until
|
|
125
|
+
/** Epoch ms the mute ends, `'forever'` until the owner turns it back on, absent when it is on. */
|
|
126
126
|
mutedUntil?: number | 'forever';
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -160,7 +160,7 @@ let snapshot: IssueSnapshot | null = null;
|
|
|
160
160
|
let reporter: IssueReporter | null = null;
|
|
161
161
|
let saveTimer: ReturnType<typeof setTimeout> | null = null;
|
|
162
162
|
const listeners = new Set<() => void>();
|
|
163
|
-
/** area → epoch ms the mute ends, or 0 for until
|
|
163
|
+
/** area → epoch ms the mute ends, or 0 for until the owner turns it back on. */
|
|
164
164
|
let mutes: Record<string, number> | null = null;
|
|
165
165
|
let muteTimer: ReturnType<typeof setTimeout> | null = null;
|
|
166
166
|
const defined = new Map<string, NoticeType>();
|
|
@@ -170,7 +170,7 @@ export interface IssueSnapshot {
|
|
|
170
170
|
active: readonly Issue[];
|
|
171
171
|
/** Ended, newest first. */
|
|
172
172
|
history: readonly Issue[];
|
|
173
|
-
/** Notifications
|
|
173
|
+
/** Notifications the owner has not looked at yet, muted kinds left out — the bell's number. */
|
|
174
174
|
unseen: number;
|
|
175
175
|
/** How many of {@link unseen} are problems (warning, error) — when any is, the bell's count is red. */
|
|
176
176
|
unseenProblems: number;
|
|
@@ -304,7 +304,7 @@ function shape(input: IssueInput): Omit<Issue, 'startedAt' | 'updatedAt' | 'occu
|
|
|
304
304
|
*
|
|
305
305
|
* 🔴 The same id again is the SAME row, counted: *"batch recurring notifications for any repeating
|
|
306
306
|
* source … into a single notification with a count instead of many separate notifications"* (the
|
|
307
|
-
* owner, 2026-11-05). The row moves to the top, says "3 new" since
|
|
307
|
+
* owner, 2026-11-05). The row moves to the top, says "3 new" since the owner last looked and how many in
|
|
308
308
|
* all, and the bell counts it once. `count` adds that many at once — one poll that found seven new
|
|
309
309
|
* failures reads "7 new", not "1 new".
|
|
310
310
|
*/
|
|
@@ -381,7 +381,7 @@ export function forgetIssue(id: string): void {
|
|
|
381
381
|
changed(null, null);
|
|
382
382
|
}
|
|
383
383
|
|
|
384
|
-
/**
|
|
384
|
+
/** The owner has looked: the bell's count goes to zero. */
|
|
385
385
|
export function markIssuesSeen(): void {
|
|
386
386
|
if (!all().some((i) => !i.seen)) return;
|
|
387
387
|
issues = all().map((i) => (i.seen ? i : { ...i, seen: true, sinceSeen: 0 }));
|
|
@@ -444,7 +444,7 @@ function scheduleMuteExpiry(now: number): void {
|
|
|
444
444
|
}
|
|
445
445
|
|
|
446
446
|
/**
|
|
447
|
-
* Silence a kind until `until` (epoch ms), or `'forever'` — until
|
|
447
|
+
* Silence a kind until `until` (epoch ms), or `'forever'` — until the owner turns it back on. A muted kind is
|
|
448
448
|
* still RECORDED on the page, marked muted; it only stops counting on the bell and showing on the
|
|
449
449
|
* banner, the way Slack's "pause notifications" and Linear's per-kind switches do.
|
|
450
450
|
*/
|
|
@@ -132,4 +132,53 @@ describe('usePagedList', () => {
|
|
|
132
132
|
act(() => release());
|
|
133
133
|
await waitFor(() => expect(result.current.items).toEqual(['b1']));
|
|
134
134
|
});
|
|
135
|
+
test('a first load that fails is isLoadingError, with nothing held', async () => {
|
|
136
|
+
const fetchPage = (_cursor: string | undefined): Promise<PagedPage<string>> =>
|
|
137
|
+
Promise.reject(new Error('offline'));
|
|
138
|
+
const { result } = renderHook(() => usePagedList({ queryKey: ['err-first'], fetchPage }), {
|
|
139
|
+
wrapper: makeWrapper(),
|
|
140
|
+
});
|
|
141
|
+
await waitFor(() => expect(result.current.isError).toBe(true));
|
|
142
|
+
expect(result.current.isLoadingError).toBe(true);
|
|
143
|
+
expect(result.current.isRefetchError).toBe(false);
|
|
144
|
+
expect(result.current.isLoadMoreError).toBe(false);
|
|
145
|
+
expect(result.current.items).toEqual([]);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
test('a refresh that fails while rows are held is isRefetchError, and the rows stay', async () => {
|
|
149
|
+
let offline = false;
|
|
150
|
+
const pages = pagedFetcher({ '@first': { items: ['a', 'b'] } });
|
|
151
|
+
const fetchPage = (cursor: string | undefined) =>
|
|
152
|
+
offline ? Promise.reject(new Error('offline')) : pages(cursor);
|
|
153
|
+
const { result } = renderHook(() => usePagedList({ queryKey: ['err-refetch'], fetchPage }), {
|
|
154
|
+
wrapper: makeWrapper(),
|
|
155
|
+
});
|
|
156
|
+
await waitFor(() => expect(result.current.items).toEqual(['a', 'b']));
|
|
157
|
+
expect(result.current.isError).toBe(false);
|
|
158
|
+
|
|
159
|
+
offline = true;
|
|
160
|
+
act(() => result.current.refetch());
|
|
161
|
+
await waitFor(() => expect(result.current.isError).toBe(true));
|
|
162
|
+
expect(result.current.isRefetchError).toBe(true);
|
|
163
|
+
expect(result.current.isLoadingError).toBe(false);
|
|
164
|
+
expect(result.current.isLoadMoreError).toBe(false);
|
|
165
|
+
expect(result.current.items).toEqual(['a', 'b']);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
test('a Load more that fails keeps the earlier pages: isRefetchError and isLoadMoreError', async () => {
|
|
169
|
+
const pages = pagedFetcher({ '@first': { items: ['a'], nextCursor: 'c1' } });
|
|
170
|
+
const fetchPage = (cursor: string | undefined) =>
|
|
171
|
+
cursor === 'c1' ? Promise.reject(new Error('offline')) : pages(cursor);
|
|
172
|
+
const { result } = renderHook(() => usePagedList({ queryKey: ['err-more'], fetchPage }), {
|
|
173
|
+
wrapper: makeWrapper(),
|
|
174
|
+
});
|
|
175
|
+
await waitFor(() => expect(result.current.items).toEqual(['a']));
|
|
176
|
+
|
|
177
|
+
act(() => result.current.loadMore());
|
|
178
|
+
await waitFor(() => expect(result.current.isError).toBe(true));
|
|
179
|
+
expect(result.current.isLoadMoreError).toBe(true);
|
|
180
|
+
expect(result.current.isRefetchError).toBe(true);
|
|
181
|
+
expect(result.current.isLoadingError).toBe(false);
|
|
182
|
+
expect(result.current.items).toEqual(['a']);
|
|
183
|
+
});
|
|
135
184
|
});
|
|
@@ -61,7 +61,17 @@ export interface PagedList<T> {
|
|
|
61
61
|
isLoading: boolean;
|
|
62
62
|
/** Any fetch in flight (first load, Load more, background refetch, or poll). */
|
|
63
63
|
isFetching: boolean;
|
|
64
|
+
/** Any fetch failed — ALSO true when rows are still held, so never pick a view off it
|
|
65
|
+
* (guardrail `no-query-error-hides-data`). Ask one of the three below instead. */
|
|
64
66
|
isError: boolean;
|
|
67
|
+
/** Failed with no page held: nothing to show, so draw the error state in the list's place. */
|
|
68
|
+
isLoadingError: boolean;
|
|
69
|
+
/** Failed with rows still held (a refresh, a poll or a Load more): keep the rows on screen and
|
|
70
|
+
* draw cursedbelt's `StaleNote` over them. */
|
|
71
|
+
isRefetchError: boolean;
|
|
72
|
+
/** The failure was a Load more — a narrower `isRefetchError`, for a "Couldn't load more · Retry"
|
|
73
|
+
* in the button's place. */
|
|
74
|
+
isLoadMoreError: boolean;
|
|
65
75
|
error: unknown;
|
|
66
76
|
/** Another page is available. */
|
|
67
77
|
hasMore: boolean;
|
|
@@ -85,6 +95,10 @@ export interface PagedList<T> {
|
|
|
85
95
|
* `gcTime`), in its first render — which is what lets `useScrollMemory` put the viewer back
|
|
86
96
|
* 30,000px down instead of at the end of page one. Give it a `staleTime` too, or the return
|
|
87
97
|
* trip refetches every page it holds in the background.
|
|
98
|
+
*
|
|
99
|
+
* **Pick the view by which failure it is, never by `isError`:**
|
|
100
|
+
* `isLoadingError ? <ErrorState/> : <>{isRefetchError && <StaleNote/>}{rows}</>` — a refresh that
|
|
101
|
+
* fails while rows are held keeps them.
|
|
88
102
|
*/
|
|
89
103
|
export function usePagedList<T>({
|
|
90
104
|
queryKey,
|
|
@@ -122,12 +136,20 @@ export function usePagedList<T>({
|
|
|
122
136
|
// changed — flattening per render handed every consumer a new array and defeated its memos.
|
|
123
137
|
const items = useMemo(() => (pages ?? []).flatMap((p) => p.items), [pages]);
|
|
124
138
|
const total = useMemo(() => pages?.findLast((p) => p.total !== undefined)?.total, [pages]);
|
|
139
|
+
// Which kind of failure is decided by whether a page is HELD, not by TanStack's flags: its
|
|
140
|
+
// `isRefetchError` excludes a failed Load more, which still leaves every earlier row on screen.
|
|
141
|
+
// A failed fetch never shows `keepPreviousItems`' placeholder (TanStack drops it outside
|
|
142
|
+
// `pending`), so `pages` is exactly what the reader has.
|
|
143
|
+
const held = pages !== undefined;
|
|
125
144
|
|
|
126
145
|
return {
|
|
127
146
|
items,
|
|
128
147
|
isLoading: query.isLoading,
|
|
129
148
|
isFetching: query.isFetching,
|
|
130
149
|
isError: query.isError,
|
|
150
|
+
isLoadingError: query.isError && !held,
|
|
151
|
+
isRefetchError: query.isError && held,
|
|
152
|
+
isLoadMoreError: query.isFetchNextPageError,
|
|
131
153
|
error: query.error,
|
|
132
154
|
hasMore: !!query.hasNextPage,
|
|
133
155
|
total,
|
|
@@ -85,7 +85,7 @@ const rowOf = (issue: Issue, muted: ReadonlySet<string>): ShellNotification => (
|
|
|
85
85
|
title: issue.title,
|
|
86
86
|
...(issue.outlook || issue.resolution ? { body: issue.resolution ?? issue.outlook } : {}),
|
|
87
87
|
at: issue.updatedAt,
|
|
88
|
-
// A kind
|
|
88
|
+
// A kind the owner silenced is never counted, as the bell never counted it.
|
|
89
89
|
read: issue.seen || muted.has(issue.area),
|
|
90
90
|
archived: !!issue.archived,
|
|
91
91
|
tone: issue.tone,
|
|
@@ -368,7 +368,7 @@ export function designProbe({ rules, allowProse, specimens }: ProbeArgs): Design
|
|
|
368
368
|
// The owner, 2026-11-07 (forge task 2026-11-07-22:29): *"The tables need to be condensed with good
|
|
369
369
|
// ux for mobile, hiding some columns potentially to avoid the mobile views needing a horizontal
|
|
370
370
|
// scrollbar."* LAY-10 sees only the PAGE; a table inside its own `overflow-x: auto` box scrolls
|
|
371
|
-
// sideways while the page stays put, which is exactly the phone table
|
|
371
|
+
// sideways while the page stays put, which is exactly the phone table the owner meant. Below 600px, any
|
|
372
372
|
// table (a real one, or a `role=table|grid`) whose nearest sideways-scrolling box is wider inside
|
|
373
373
|
// than out is red: drop its low-priority columns (`ColDef.priority`) into the row instead.
|
|
374
374
|
if (on.has('DAT-19') && window.innerWidth < 600) {
|