cursedbelt 6.28.0 → 6.29.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/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/media/DenseGalleryShell.d.ts +7 -1
- package/dist/react/media/DenseGalleryShell.d.ts.map +1 -1
- package/dist/react/media/DenseGalleryShell.js +2 -2
- package/dist/react/media/DenseGalleryShell.js.map +1 -1
- package/dist/react/media-gallery/GalleryTable.d.ts +12 -1
- package/dist/react/media-gallery/GalleryTable.d.ts.map +1 -1
- package/dist/react/media-gallery/GalleryTable.js +37 -6
- package/dist/react/media-gallery/GalleryTable.js.map +1 -1
- package/dist/react/media-gallery/MediaGallery.d.ts +39 -3
- package/dist/react/media-gallery/MediaGallery.d.ts.map +1 -1
- package/dist/react/media-gallery/MediaGallery.js +122 -12
- package/dist/react/media-gallery/MediaGallery.js.map +1 -1
- package/dist/react/media-gallery/index.d.ts +1 -1
- package/dist/react/media-gallery/index.d.ts.map +1 -1
- package/dist/react/media-gallery/index.js.map +1 -1
- package/dist/react/media-gallery/mediaGallery.css +16 -0
- package/dist/react/usePrefixList.d.ts +82 -0
- package/dist/react/usePrefixList.d.ts.map +1 -0
- package/dist/react/usePrefixList.js +139 -0
- package/dist/react/usePrefixList.js.map +1 -0
- package/dist/testing/shell.d.ts +1 -0
- package/dist/testing/shell.d.ts.map +1 -1
- package/dist/testing/shell.js +2 -0
- package/dist/testing/shell.js.map +1 -1
- package/package.json +1 -1
- package/scripts/styleAreas.ts +2 -0
- package/src/react/index.ts +6 -0
- package/src/react/media/DenseGalleryShell.tsx +8 -0
- package/src/react/media-gallery/GalleryTable.tsx +54 -6
- package/src/react/media-gallery/MediaGallery.spec.tsx +61 -0
- package/src/react/media-gallery/MediaGallery.tsx +170 -12
- package/src/react/media-gallery/index.ts +1 -0
- package/src/react/media-gallery/mediaGallery.css +16 -0
- package/src/react/usePrefixList.spec.tsx +156 -0
- package/src/react/usePrefixList.ts +229 -0
- package/src/testing/shell.ts +2 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { useQueries, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* How many pages the prefix asks for: enough to hold `need` items, at least one, never past the set's last page once
|
|
5
|
+
* its size is known.
|
|
6
|
+
*/
|
|
7
|
+
export function prefixPageCount(need, pageSize, total) {
|
|
8
|
+
const wanted = Math.max(1, Math.ceil(Math.max(0, need) / pageSize));
|
|
9
|
+
if (total === undefined)
|
|
10
|
+
return wanted;
|
|
11
|
+
return Math.max(1, Math.min(wanted, Math.ceil(total / pageSize)));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Which pages may fetch now: every page before the first one missing, and `inFlight` from it on — so a reach to item
|
|
15
|
+
* 4,000 fills the prefix four requests at a time rather than opening twenty at once.
|
|
16
|
+
*/
|
|
17
|
+
export function prefixEnabledThrough(loaded, inFlight) {
|
|
18
|
+
const missing = loaded.indexOf(false);
|
|
19
|
+
return missing < 0 ? loaded.length : missing + Math.max(1, inFlight);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The loaded pages from page 0, flattened, up to the first one not loaded — and the set's size.
|
|
23
|
+
*
|
|
24
|
+
* 🔴 The size is read off the LAST joined page as "how many come after it": `page.total - (offset + page.items.length)`.
|
|
25
|
+
* An optimistic delete takes a row out of one page and that page's `total` down by one, so each page's own `total`
|
|
26
|
+
* stops agreeing with the others; what lies past a page is the one number such an edit leaves alone, and the rows the
|
|
27
|
+
* edit removed are already out of `items.length`.
|
|
28
|
+
*/
|
|
29
|
+
export function joinPrefix(pages, pageSize, idOf) {
|
|
30
|
+
const items = [];
|
|
31
|
+
const seen = idOf ? new Set() : null;
|
|
32
|
+
let after;
|
|
33
|
+
for (let p = 0; p < pages.length; p++) {
|
|
34
|
+
const page = pages[p];
|
|
35
|
+
if (!page)
|
|
36
|
+
break;
|
|
37
|
+
for (const item of page.items) {
|
|
38
|
+
if (seen) {
|
|
39
|
+
const id = idOf?.(item);
|
|
40
|
+
if (seen.has(id))
|
|
41
|
+
continue;
|
|
42
|
+
seen.add(id);
|
|
43
|
+
}
|
|
44
|
+
items.push(item);
|
|
45
|
+
}
|
|
46
|
+
after = Math.max(0, page.total - (p * pageSize + page.items.length));
|
|
47
|
+
}
|
|
48
|
+
return { items, total: after === undefined ? undefined : items.length + after };
|
|
49
|
+
}
|
|
50
|
+
/** Where each listing's prefix reached when it was left — a return draws that much from the cache in its first frame. */
|
|
51
|
+
const remembered = new Map();
|
|
52
|
+
const REMEMBERED_MAX = 50;
|
|
53
|
+
function remember(key, need) {
|
|
54
|
+
remembered.delete(key);
|
|
55
|
+
remembered.set(key, need);
|
|
56
|
+
if (remembered.size > REMEMBERED_MAX)
|
|
57
|
+
remembered.delete(remembered.keys().next().value);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* An offset-paged list as a prefix that grows to wherever the reader reaches. Point it at `fetchRange(offset, limit)`
|
|
61
|
+
* and a `queryKey` that encodes the filters; render `items`, and hand `serverWindow` to `MediaGallery`.
|
|
62
|
+
*
|
|
63
|
+
* Requires `@tanstack/react-query` wrapped in a `QueryClientProvider`.
|
|
64
|
+
*/
|
|
65
|
+
export function usePrefixList({ queryKey, pageKey, fetchRange, pageSize = 200, inFlight = 4, idOf, enabled = true, staleTime, gcTime, }) {
|
|
66
|
+
const keyHash = JSON.stringify(queryKey);
|
|
67
|
+
const [state, setState] = useState(() => ({ key: keyHash, need: remembered.get(keyHash) ?? pageSize }));
|
|
68
|
+
// A new listing starts where it was last left, or at one page — in THIS render, so no frame asks for the old reach.
|
|
69
|
+
const need = state.key === keyHash ? state.need : (remembered.get(keyHash) ?? pageSize);
|
|
70
|
+
if (state.key !== keyHash)
|
|
71
|
+
setState({ key: keyHash, need });
|
|
72
|
+
const fetchRef = useRef(fetchRange);
|
|
73
|
+
fetchRef.current = fetchRange;
|
|
74
|
+
const keyOf = (offset, limit) => (pageKey ? pageKey(offset, limit) : [...queryKey, 'prefix', limit, offset]);
|
|
75
|
+
// The set's size, as last known for THIS listing: what caps the pages asked for.
|
|
76
|
+
const knownTotal = useRef(null);
|
|
77
|
+
const capTotal = knownTotal.current?.key === keyHash ? knownTotal.current.total : undefined;
|
|
78
|
+
const count = prefixPageCount(need, pageSize, capTotal);
|
|
79
|
+
// Which pages are in hand, read off the cache itself — a page cached from an earlier visit counts at once, so a
|
|
80
|
+
// return to a long prefix opens the next requests in the same render instead of waiting for one to land.
|
|
81
|
+
const client = useQueryClient();
|
|
82
|
+
const through = prefixEnabledThrough(Array.from({ length: count }, (_, p) => client.getQueryState(keyOf(p * pageSize, pageSize))?.data !== undefined), inFlight);
|
|
83
|
+
const results = useQueries({
|
|
84
|
+
queries: Array.from({ length: count }, (_, p) => ({
|
|
85
|
+
queryKey: keyOf(p * pageSize, pageSize),
|
|
86
|
+
queryFn: () => fetchRef.current(p * pageSize, pageSize),
|
|
87
|
+
enabled: enabled && p < through,
|
|
88
|
+
staleTime,
|
|
89
|
+
gcTime,
|
|
90
|
+
})),
|
|
91
|
+
});
|
|
92
|
+
const pages = results.map((r) => r.data);
|
|
93
|
+
// Kept while every page is the same object — TanStack keeps a page's data stable while it is unchanged — so `items`
|
|
94
|
+
// is the same array until a page changes, and safe as a consumer's memo dependency.
|
|
95
|
+
const joinedRef = useRef(null);
|
|
96
|
+
const kept = joinedRef.current;
|
|
97
|
+
const same = kept !== null && kept.pages.length === pages.length && kept.pages.every((page, i) => page === pages[i]);
|
|
98
|
+
const joined = same && kept ? kept.joined : joinPrefix(pages, pageSize, idOf);
|
|
99
|
+
if (!same)
|
|
100
|
+
joinedRef.current = { pages, joined };
|
|
101
|
+
const total = joined.total;
|
|
102
|
+
if (total !== undefined)
|
|
103
|
+
knownTotal.current = { key: keyHash, total: Math.max(total, ...pages.map((page) => page?.total ?? 0)) };
|
|
104
|
+
const live = useRef({ keyHash, need, results, total, loaded: joined.items.length });
|
|
105
|
+
live.current = { keyHash, need, results, total, loaded: joined.items.length };
|
|
106
|
+
const needThrough = useCallback((end) => {
|
|
107
|
+
const now = live.current;
|
|
108
|
+
const capped = now.total === undefined ? end : Math.min(end, now.total);
|
|
109
|
+
if (capped <= now.need) {
|
|
110
|
+
// Asked again for what is already wanted: a page that failed is fetched again; one in flight answers it.
|
|
111
|
+
if (capped > now.loaded)
|
|
112
|
+
for (const r of now.results)
|
|
113
|
+
if (r.isError && !r.isFetching)
|
|
114
|
+
void r.refetch();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
remember(now.keyHash, capped);
|
|
118
|
+
setState({ key: now.keyHash, need: capped });
|
|
119
|
+
}, []);
|
|
120
|
+
const serverWindow = useMemo(() => ({ total: total ?? 0, onNeedThrough: needThrough }), [total, needThrough]);
|
|
121
|
+
const firstError = results.find((r) => r.isError);
|
|
122
|
+
return {
|
|
123
|
+
items: joined.items,
|
|
124
|
+
total,
|
|
125
|
+
isLoading: total === undefined && results.some((r) => r.isLoading),
|
|
126
|
+
isFetching: results.some((r) => r.isFetching),
|
|
127
|
+
isLoadingError: results.some((r) => r.isLoadingError),
|
|
128
|
+
isRefetchError: results.some((r) => r.isRefetchError),
|
|
129
|
+
error: firstError?.error ?? null,
|
|
130
|
+
needThrough,
|
|
131
|
+
serverWindow,
|
|
132
|
+
refetch: () => {
|
|
133
|
+
for (const r of live.current.results)
|
|
134
|
+
if (r.data !== undefined || r.isError)
|
|
135
|
+
void r.refetch();
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=usePrefixList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePrefixList.js","sourceRoot":"","sources":["../../src/react/usePrefixList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,UAAU,EAAE,cAAc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AAU,EAAE,KAAK,IAAI,IAAI;QAChC,WAAW;QACX,YAAY;QACZ,OAAO,EAAE,GAAG,EAAE;YACZ,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO;gBAAE,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,OAAO;oBAAE,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;QAChG,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/testing/shell.d.ts
CHANGED
|
@@ -92,6 +92,7 @@ export declare const BELT: {
|
|
|
92
92
|
readonly tableScroll: "[data-cb-table-scroll]";
|
|
93
93
|
readonly fastScroller: "[data-cb-fast-scroller]";
|
|
94
94
|
readonly fastScrollBubble: "[data-cb-fast-scroll-bubble]";
|
|
95
|
+
readonly gridPlaceholder: "[data-cb-grid-placeholder]";
|
|
95
96
|
readonly tableList: "[data-cb-table-list]";
|
|
96
97
|
readonly tableListHeader: "[data-cb-table-list-header]";
|
|
97
98
|
readonly tableSelectAll: "[data-cb-table-select-all]";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/testing/shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;GAIG;AACH,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/testing/shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;GAIG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFP,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,IAAI,CAAC;AAEzC,4FAA4F;AAC5F,eAAO,MAAM,WAAW;;;;;IAKvB,0GAA0G;;;;IAI1G,4EAA4E;;;;CAInE,CAAC;AAEX,gHAAgH;AAChH,wBAAgB,MAAM,CAAC,IAAI,EAAE,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,MAAM,CAE9D;AAED,sGAAsG;AACtG,MAAM,WAAW,OAAO,CAAC,CAAC;IACzB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC;CAC7B;AAED,kEAAkE;AAClE,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,YAAY,CAAC;AAE1D;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAEvC,uBAAuB;;IAEvB,uDAAuD;;IAEvD,wDAAwD;;IAExD,2DAA2D;gBAC/C,MAAM;IAClB,mDAAmD;;IAEnD,+BAA+B;;IAE/B,gDAAgD;;IAEhD,gDAAgD;;IAEhD,gFAAgF;4BACxD,kBAAkB;IAC1C,+EAA+E;;IAE/E,6BAA6B;;IAE7B,4EAA4E;;;;IAI5E,oCAAoC;;IAEpC,wGAAwG;;;;;IAKxG,4BAA4B;;EAG7B"}
|
package/dist/testing/shell.js
CHANGED
|
@@ -99,6 +99,8 @@ export const BELT = {
|
|
|
99
99
|
// The fast scroller a finger drags through a long list (`FastScroller`); `data-shown` while it is up.
|
|
100
100
|
fastScroller: '[data-cb-fast-scroller]',
|
|
101
101
|
fastScrollBubble: '[data-cb-fast-scroll-bubble]',
|
|
102
|
+
// A card a server window has not loaded yet (`VirtualCardGrid` under `serverWindow`) — none once the window reaches it.
|
|
103
|
+
gridPlaceholder: '[data-cb-grid-placeholder]',
|
|
102
104
|
tableList: '[data-cb-table-list]',
|
|
103
105
|
tableListHeader: '[data-cb-table-list-header]',
|
|
104
106
|
tableSelectAll: '[data-cb-table-select-all]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/testing/shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IACnB,+CAA+C;IAC/C,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,sBAAsB;IACjC,QAAQ,EAAE,qBAAqB;IAC/B,aAAa,EAAE,0BAA0B;IACzC,KAAK,EAAE,iBAAiB;IACxB,YAAY,EAAE,yBAAyB;IACvC,WAAW,EAAE,wBAAwB;IACrC,GAAG,EAAE,eAAe;IACpB,WAAW,EAAE,wBAAwB;IACrC,SAAS,EAAE,sBAAsB;IACjC,YAAY,EAAE,yBAAyB;IACvC,SAAS,EAAE,sBAAsB;IACjC,aAAa,EAAE,0BAA0B;IACzC,SAAS,EAAE,sBAAsB;IACjC,kBAAkB,EAAE,+BAA+B;IACnD,QAAQ,EAAE,oBAAoB;IAC9B,aAAa,EAAE,0BAA0B;IACzC,cAAc,EAAE,2BAA2B;IAC3C,aAAa,EAAE,0BAA0B;IACzC,MAAM,EAAE,kBAAkB;IAC1B,OAAO,EAAE,oBAAoB;IAC7B,UAAU,EAAE,uBAAuB;IACnC,UAAU,EAAE,uBAAuB;IACnC,aAAa,EAAE,0BAA0B;IACzC,oBAAoB,EAAE,kCAAkC;IACxD,mBAAmB,EAAE,iCAAiC;IACtD,YAAY;IACZ,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,sBAAsB;IACjC,WAAW,EAAE,wBAAwB;IACrC,aAAa,EAAE,0BAA0B;IACzC,aAAa,EAAE,0BAA0B;IACzC,aAAa,EAAE,0BAA0B;IACzC,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,gBAAgB;IACtB,QAAQ,EAAE,qBAAqB;IAC/B,SAAS,EAAE,sBAAsB;IACjC,YAAY,EAAE,yBAAyB;IACvC,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6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cursedbelt",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.29.0",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "The React design system of the cursedbelt split — components, styles, theme. cursedbelt-core below it; server tier in cursedbelt-server.",
|
package/scripts/styleAreas.ts
CHANGED
|
@@ -127,6 +127,8 @@ export const AREAS: readonly Area[] = [
|
|
|
127
127
|
'usePagedList.ts',
|
|
128
128
|
// Draws nothing either: the window `VirtualCardGrid` and `DataTable` take as `serverWindow` (forge task 5691).
|
|
129
129
|
'useWindowedList.ts',
|
|
130
|
+
// Draws nothing: the prefix `MediaGallery` takes as `serverWindow` (forge task 5701).
|
|
131
|
+
'usePrefixList.ts',
|
|
130
132
|
'lazy',
|
|
131
133
|
'confirm.tsx',
|
|
132
134
|
'prompt.tsx',
|
package/src/react/index.ts
CHANGED
|
@@ -1020,6 +1020,12 @@ export {
|
|
|
1020
1020
|
type UsePagedListOptions,
|
|
1021
1021
|
usePagedList,
|
|
1022
1022
|
} from './usePagedList.js';
|
|
1023
|
+
export {
|
|
1024
|
+
type PrefixList,
|
|
1025
|
+
type PrefixListWindow,
|
|
1026
|
+
type UsePrefixListOptions,
|
|
1027
|
+
usePrefixList,
|
|
1028
|
+
} from './usePrefixList.js';
|
|
1023
1029
|
export {
|
|
1024
1030
|
type UseWindowedListOptions,
|
|
1025
1031
|
useWindowedList,
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
} from 'react';
|
|
16
16
|
import { VirtualMediaGrid } from './VirtualMediaGrid.js';
|
|
17
17
|
import type { FastScrollOptions } from '../components/FastScroller.js';
|
|
18
|
+
import type { CardGridServerWindow } from '../VirtualCardGrid.js';
|
|
18
19
|
import { Tooltip } from '../components/Tooltip.js';
|
|
19
20
|
import { MediaResizeBar, MediaResizeCorner, useMediaResize } from './MediaResize.js';
|
|
20
21
|
import { STAGE_HEIGHT_KEY } from './stageResize.js';
|
|
@@ -237,6 +238,11 @@ export interface DenseGalleryShellProps<O extends string = string> {
|
|
|
237
238
|
onNearEnd?: () => void;
|
|
238
239
|
/** The browse grid's fast scroller for a finger — {@link VirtualCardGridProps.fastScroll}. */
|
|
239
240
|
fastScroll?: boolean | FastScrollOptions;
|
|
241
|
+
/**
|
|
242
|
+
* The browse grid's tiles are a window of a longer set the server holds — {@link VirtualCardGridProps.serverWindow}.
|
|
243
|
+
* Not the `body`'s: a caller passing its own body windows it itself.
|
|
244
|
+
*/
|
|
245
|
+
serverWindow?: CardGridServerWindow;
|
|
240
246
|
loading?: boolean;
|
|
241
247
|
/** Shown when the grid is empty AND not loading. */
|
|
242
248
|
empty?: ReactNode;
|
|
@@ -283,6 +289,7 @@ export function DenseGalleryShell<O extends string = string>({
|
|
|
283
289
|
body,
|
|
284
290
|
onNearEnd,
|
|
285
291
|
fastScroll,
|
|
292
|
+
serverWindow,
|
|
286
293
|
loading,
|
|
287
294
|
empty,
|
|
288
295
|
emptyAction,
|
|
@@ -336,6 +343,7 @@ export function DenseGalleryShell<O extends string = string>({
|
|
|
336
343
|
rowExtraHeight={rowExtraHeight}
|
|
337
344
|
onNearEnd={onNearEnd}
|
|
338
345
|
fastScroll={fastScroll}
|
|
346
|
+
{...(serverWindow ? { serverWindow } : {})}
|
|
339
347
|
empty={
|
|
340
348
|
loading || !empty
|
|
341
349
|
? null
|
|
@@ -70,6 +70,11 @@ export const GALLERY_TABLE_ROW_HEIGHTS: Readonly<Record<CardSize, { fine: number
|
|
|
70
70
|
/** Rows rendered above and below the visible window, so a fast scroll does not flash blank. */
|
|
71
71
|
const OVERSCAN = 6;
|
|
72
72
|
|
|
73
|
+
/** How long a scroll wholly past a window's loaded rows must be still before the table asks for them — the card grid's. */
|
|
74
|
+
const WINDOW_SETTLE_MS = 120;
|
|
75
|
+
/** How often a screen of placeholder rows that has come to rest asks again. */
|
|
76
|
+
const WINDOW_RETRY_MS = 3000;
|
|
77
|
+
|
|
73
78
|
/**
|
|
74
79
|
* Which sort pair a column header drives, and which way its two directions read.
|
|
75
80
|
*
|
|
@@ -216,6 +221,14 @@ export interface GalleryTableProps {
|
|
|
216
221
|
onOrderChange: (order: MediaGalleryOrder) => void;
|
|
217
222
|
onOpen: (item: MediaGalleryItem) => void;
|
|
218
223
|
onNearEnd?: () => void;
|
|
224
|
+
/**
|
|
225
|
+
* The rows are the FIRST `items.length` of `total` the server holds, in its order (`MediaGallery`'s `serverWindow`,
|
|
226
|
+
* forge task 5701): the table lays out all `total`, a row not loaded draws as a placeholder, and the screen reaching
|
|
227
|
+
* past the loaded end asks `onNeedThrough` for the rows through it — at once near the edge, once a scroll RESTS when
|
|
228
|
+
* the screen is wholly past it, so a thumb dragged down the track asks once, where it lands. `onNearEnd` is not for a
|
|
229
|
+
* window.
|
|
230
|
+
*/
|
|
231
|
+
serverWindow?: { total: number; onNeedThrough: (end: number) => void };
|
|
219
232
|
/** A fast scroller on the table's own frame for a finger — {@link FastScrollOptions}. */
|
|
220
233
|
fastScroll?: boolean | FastScrollOptions;
|
|
221
234
|
loading?: boolean;
|
|
@@ -277,6 +290,7 @@ export function GalleryTable({
|
|
|
277
290
|
onOrderChange,
|
|
278
291
|
onOpen,
|
|
279
292
|
onNearEnd,
|
|
293
|
+
serverWindow,
|
|
280
294
|
fastScroll,
|
|
281
295
|
loading,
|
|
282
296
|
empty,
|
|
@@ -298,7 +312,9 @@ export function GalleryTable({
|
|
|
298
312
|
// 4px short per row, so a long table's scrollbar jumped as rows came and went on a phone.
|
|
299
313
|
const coarse = useMediaQuery('(pointer: coarse)');
|
|
300
314
|
const rowHeight = GALLERY_TABLE_ROW_HEIGHTS[rowSize][coarse ? 'coarse' : 'fine'];
|
|
301
|
-
|
|
315
|
+
/** Every row the table lays out: the whole set under a window, else what it was handed. */
|
|
316
|
+
const count = serverWindow ? Math.max(serverWindow.total, items.length) : items.length;
|
|
317
|
+
const { start, end } = visibleWindow(count, scrollTop, viewportHeight, rowHeight);
|
|
302
318
|
|
|
303
319
|
// 🔴 A column the width drops is NOT RENDERED, not merely `display: none` (forge task 4782).
|
|
304
320
|
// WebKit's `table-layout: fixed` still allots a track to a column whose cells are all
|
|
@@ -314,9 +330,28 @@ export function GalleryTable({
|
|
|
314
330
|
// Paging is the consumer's, and it fires on approach rather than on arrival so the next
|
|
315
331
|
// page is already in flight by the time the last row is on screen.
|
|
316
332
|
useEffect(() => {
|
|
317
|
-
if (!onNearEnd || items.length === 0) return;
|
|
333
|
+
if (serverWindow || !onNearEnd || items.length === 0) return;
|
|
318
334
|
if (end >= items.length - 3) onNearEnd();
|
|
319
|
-
}, [end, items.length, onNearEnd]);
|
|
335
|
+
}, [end, items.length, onNearEnd, serverWindow]);
|
|
336
|
+
|
|
337
|
+
// A window's asks — see `serverWindow`. The callback is read at FIRE time, as the card grid's are.
|
|
338
|
+
const needRef = useRef(serverWindow?.onNeedThrough);
|
|
339
|
+
needRef.current = serverWindow?.onNeedThrough;
|
|
340
|
+
const windowed = serverWindow !== undefined;
|
|
341
|
+
useEffect(() => {
|
|
342
|
+
if (!windowed || items.length >= count || end < items.length - 3) return;
|
|
343
|
+
if (start < items.length) {
|
|
344
|
+
needRef.current?.(Math.min(count, Math.max(end, items.length + 1)));
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
// …and while the screen stays wholly past the loaded rows, asked again every few seconds: a page that failed is
|
|
348
|
+
// fetched again on a repeat ask, and nothing else would repeat it under a still screen.
|
|
349
|
+
let timer = setTimeout(function ask() {
|
|
350
|
+
needRef.current?.(end);
|
|
351
|
+
timer = setTimeout(ask, WINDOW_RETRY_MS);
|
|
352
|
+
}, WINDOW_SETTLE_MS);
|
|
353
|
+
return () => clearTimeout(timer);
|
|
354
|
+
}, [windowed, start, end, items.length, count]);
|
|
320
355
|
|
|
321
356
|
const onScroll = useCallback((event: React.UIEvent<HTMLDivElement>) => {
|
|
322
357
|
setScrollTop(event.currentTarget.scrollTop);
|
|
@@ -327,7 +362,10 @@ export function GalleryTable({
|
|
|
327
362
|
// count of columns NOT rendered is a phantom track in WebKit (see `columns` above).
|
|
328
363
|
const columnCount = 2 + (selection ? 1 : 0) + Object.values(columns).filter(Boolean).length;
|
|
329
364
|
const above = start * rowHeight;
|
|
330
|
-
const below = Math.max(0, (
|
|
365
|
+
const below = Math.max(0, (count - end) * rowHeight);
|
|
366
|
+
/** The loaded rows on screen, and how many places past them are still on their way. */
|
|
367
|
+
const shownEnd = Math.min(end, items.length);
|
|
368
|
+
const waiting = Math.max(0, end - Math.max(start, items.length));
|
|
331
369
|
|
|
332
370
|
return (
|
|
333
371
|
<div
|
|
@@ -338,7 +376,7 @@ export function GalleryTable({
|
|
|
338
376
|
onScroll={onScroll}
|
|
339
377
|
data-cb-fast-scroll-root={fastScroll ? '' : undefined}
|
|
340
378
|
>
|
|
341
|
-
{listFastScroller(fastScroll,
|
|
379
|
+
{listFastScroller(fastScroll, count)}
|
|
342
380
|
{/*
|
|
343
381
|
* guardrails-ignore no-raw-data-table: cursedbelt's DataTable is the right answer
|
|
344
382
|
* almost everywhere and is the wrong one here, for two independent reasons. (1) This
|
|
@@ -418,7 +456,7 @@ export function GalleryTable({
|
|
|
418
456
|
* there. An empty cell is simply an empty cell.
|
|
419
457
|
*/}
|
|
420
458
|
{above > 0 ? <tr className='cbgt-spacer' style={{ height: above }}><td colSpan={columnCount} /></tr> : null}
|
|
421
|
-
{items.slice(start,
|
|
459
|
+
{items.slice(start, shownEnd).map((item) => (
|
|
422
460
|
<GalleryTableRow
|
|
423
461
|
key={item.id}
|
|
424
462
|
item={item}
|
|
@@ -432,6 +470,16 @@ export function GalleryTable({
|
|
|
432
470
|
{...(playing?.id === item.id ? { stageMark: playing.label } : {})}
|
|
433
471
|
/>
|
|
434
472
|
))}
|
|
473
|
+
{Array.from({ length: waiting }, (_, i) => {
|
|
474
|
+
const index = Math.max(start, items.length) + i;
|
|
475
|
+
return (
|
|
476
|
+
<tr key={`cbgt-wait-${index}`} className='cbgt-row cbgt-row--wait' data-cb-table-placeholder=''>
|
|
477
|
+
<td colSpan={columnCount}>
|
|
478
|
+
<span className='cbgt-wait-bar' />
|
|
479
|
+
</td>
|
|
480
|
+
</tr>
|
|
481
|
+
);
|
|
482
|
+
})}
|
|
435
483
|
{below > 0 ? <tr className='cbgt-spacer' style={{ height: below }}><td colSpan={columnCount} /></tr> : null}
|
|
436
484
|
</tbody>
|
|
437
485
|
</table>
|
|
@@ -3717,3 +3717,64 @@ describe('MediaGallery — Trim carries keyframes in and the mode out', () => {
|
|
|
3717
3717
|
expect(document.querySelector('.cbvc-sheet')?.textContent).not.toContain('Your cuts are exact.');
|
|
3718
3718
|
});
|
|
3719
3719
|
});
|
|
3720
|
+
|
|
3721
|
+
/**
|
|
3722
|
+
* A server window (`serverWindow`, forge task 5701): the items are the first n of `total` in the server's order. The
|
|
3723
|
+
* browser half — a thumb dragged to the bottom of 4,180 files — is `e2e/gallery-window.spec.ts`.
|
|
3724
|
+
*/
|
|
3725
|
+
describe('🔴 MediaGallery — a server window', () => {
|
|
3726
|
+
const many = (n: number): MediaGalleryItem[] =>
|
|
3727
|
+
Array.from({ length: n }, (_, i) => ({ id: `f${i}`, name: `file-${String(i).padStart(4, '0')}.jpg`, url: `/f/${i}`, createdAt: i }));
|
|
3728
|
+
const title = (c: HTMLElement) => c.querySelector('.cbgd-watch-title')?.textContent;
|
|
3729
|
+
|
|
3730
|
+
test('draws the server order as given — no client re-sort under a window', () => {
|
|
3731
|
+
// Newest-first would put file-0002 (createdAt 2) first; the server's order is kept.
|
|
3732
|
+
const asks: number[] = [];
|
|
3733
|
+
const { container } = render(
|
|
3734
|
+
<MediaGallery items={many(3)} order='recent' viewMode='table' serverWindow={{ total: 3, onNeedThrough: (end) => asks.push(end) }} />,
|
|
3735
|
+
);
|
|
3736
|
+
const names = Array.from(container.querySelectorAll('.cbgt-row')).map((r) => r.querySelector('.cbgt-cell--name')?.textContent ?? '');
|
|
3737
|
+
expect(names[0]).toContain('file-0000');
|
|
3738
|
+
expect(names[2]).toContain('file-0002');
|
|
3739
|
+
});
|
|
3740
|
+
|
|
3741
|
+
test('the table lays out the whole set, draws what is not loaded as placeholders, and asks for it', () => {
|
|
3742
|
+
const asks: number[] = [];
|
|
3743
|
+
const { container } = render(
|
|
3744
|
+
<MediaGallery items={many(3)} viewMode='table' serverWindow={{ total: 4180, onNeedThrough: (end) => asks.push(end) }} />,
|
|
3745
|
+
);
|
|
3746
|
+
expect(container.querySelectorAll('[data-cb-table-placeholder]').length).toBeGreaterThan(0);
|
|
3747
|
+
expect(asks.length).toBeGreaterThan(0);
|
|
3748
|
+
expect(Math.max(...asks)).toBeGreaterThan(3);
|
|
3749
|
+
});
|
|
3750
|
+
|
|
3751
|
+
test('Next on the last LOADED file asks for more and lands on the next one, not the first', () => {
|
|
3752
|
+
const asks: number[] = [];
|
|
3753
|
+
const window = { total: 10, onNeedThrough: (end: number) => asks.push(end) };
|
|
3754
|
+
const { container, getByRole, rerender } = render(<MediaGallery items={many(3)} serverWindow={window} />);
|
|
3755
|
+
fireEvent.click(getByRole('button', { name: 'Open file-0002.jpg' }));
|
|
3756
|
+
fireEvent.click(getByRole('button', { name: 'Next file' }));
|
|
3757
|
+
expect(title(container)).toBe('file-0002.jpg');
|
|
3758
|
+
expect(asks).toContain(4);
|
|
3759
|
+
rerender(<MediaGallery items={many(6)} serverWindow={window} />);
|
|
3760
|
+
expect(title(container)).toBe('file-0003.jpg');
|
|
3761
|
+
});
|
|
3762
|
+
|
|
3763
|
+
test('Select all says it ticks what is LOADED while only part of the set is in, and only then', () => {
|
|
3764
|
+
const window = { total: 4180, onNeedThrough: () => undefined };
|
|
3765
|
+
const view = render(<MediaGallery items={many(3)} selectable serverWindow={window} />);
|
|
3766
|
+
expect(view.getByText('Select loaded')).toBeDefined();
|
|
3767
|
+
fireEvent.click(view.getByText('Select loaded'));
|
|
3768
|
+
expect(view.getByText('All loaded selected')).toBeDefined();
|
|
3769
|
+
view.rerender(<MediaGallery items={many(3)} selectable serverWindow={{ ...window, total: 3 }} />);
|
|
3770
|
+
expect(view.getByText('All selected')).toBeDefined();
|
|
3771
|
+
});
|
|
3772
|
+
|
|
3773
|
+
test('a local search stands the window down: it filters what is loaded, and lays out no placeholders', () => {
|
|
3774
|
+
const { container } = render(
|
|
3775
|
+
<MediaGallery items={many(3)} viewMode='table' query='0001' serverWindow={{ total: 4180, onNeedThrough: () => undefined }} />,
|
|
3776
|
+
);
|
|
3777
|
+
expect(container.querySelectorAll('.cbgt-row:not(.cbgt-row--wait)').length).toBe(1);
|
|
3778
|
+
expect(container.querySelectorAll('[data-cb-table-placeholder]').length).toBe(0);
|
|
3779
|
+
});
|
|
3780
|
+
});
|