@jsenv/navi 0.29.449 → 0.29.450

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.
@@ -92,7 +92,8 @@ start when unsure which export solves a problem.
92
92
  `loading: true` never suspends; a skeleton is told whether it is loading.
93
93
  Before drawing a skeleton on `!data` or hiding content because `error` is set.
94
94
  - `list_refresh.md` — what a write sends back and what stays on screen meanwhile;
95
- `rerunOn` and its defaults; coming back to a list. Before adding verbs to
95
+ `rerunOn` and its defaults; coming back to a list (Back keeps its
96
+ composition, a reload only under `keepPageOnScreen`). Before adding verbs to
96
97
  `rerunOn` or remounting a list to refresh it.
97
98
  - `list_action.md` — where the `action` lives decides who waits; a row whose
98
99
  button works is `readOnly`, not `loading`; `parallelGuard`. Before
@@ -187,13 +188,14 @@ start when unsure which export solves a problem.
187
188
  `scroller`, where a list opens (a position handed back whole, `visibleCount`
188
189
  included), a list that comes back (its `id` names one list of the app), a
189
190
  popup that scrolls, many rows (`<List.Items>`, the render window and its first
190
- picture, skeletons at the size of their item, `itemSize`, `findText`, how far
191
+ picture, what a run knows when it opens — `count`, a composition kept, Back
192
+ versus a reload —, skeletons at the size of their item, `itemSize`, `findText`, how far
191
193
  ahead its images load and `loading` before `src`), many
192
194
  sections (`<Box mount="after-paint">` and what it leaves out of reach), hover
193
195
  while scrolling. Before writing CSS to make something scroll, before
194
196
  rendering a collection as `<List.Item>` children, before writing a
195
- `renderSkeleton`, before putting images in a run, and before deferring part
196
- of a page.
197
+ `renderSkeleton`, before deciding whether to give a run its `count`, before
198
+ putting images in a run, and before deferring part of a page.
197
199
  - `z_index.md` — DOM order first; a `z-index` without `isolation: isolate`
198
200
  competes with the page; navi's bands. Before writing a `z-index`.
199
201
  - `typography.md` — text is a component; `maxLines` is the one truncation; one
@@ -127,10 +127,16 @@ A composition is about the **values** its params hold, not the reader instance:
127
127
  writes the same one. A verb in `rerunOn.GET_RANGE`, or `reader.invalidate()`,
128
128
  drops the compositions — they stand for an order that is gone — and
129
129
  `memoryBudget` (1000 ranks by default) trims the ranks far from any window,
130
- which are asked for again if the user goes back to them. A composition read by a
131
- list on screen also outlives the document when the page is kept
132
- ([`keepPageOnScreen`](./resource.md#keeppageonscreen-the-page-on-screen-drawn-again-by-the-next-document)): the ranks around the window it draws are written with
133
- their rows, and a reload is the same return after a longer absence.
130
+ which are asked for again if the user goes back to them.
131
+
132
+ A composition lives as long as the document. **Back keeps it; a reload keeps it
133
+ only under `keepPageOnScreen`.** Coming back within the same document finds it
134
+ on its own. A reload, a link opened in another tab, a tab the system discarded
135
+ open a new document, where the list gets back its position (kept under its
136
+ `id`) and nothing to draw there: skeletons, and a first load. A page kept with
137
+ [`keepPageOnScreen`](./resource.md#keeppageonscreen-the-page-on-screen-drawn-again-by-the-next-document)
138
+ writes the ranks around the window each list on screen draws, with their rows,
139
+ and a reload is then the same return after a longer absence.
134
140
 
135
141
  ### Who decides the re-read — and who does not
136
142
 
package/docs/scroll.md CHANGED
@@ -124,9 +124,11 @@ already provided; keep the position whole, its `visibleCount` sizes the first
124
124
  paint. A `defaultScrolled` that changes before anyone has moved the list is
125
125
  followed — a place read from an answer that refreshes (yesterday's "today", then
126
126
  today's) — and it is compared by value, so it can be computed at every render. A list with an `id` also **comes back where it was** when its screen is
127
- left and come back to, the way the page does (its `id` must name one list of the
128
- app, see [below](#a-list-that-comes-back-one-id-one-list));
129
- **`scrollResetOnNavigation`** opts out. A list scrolling the document that
127
+ left and come back to, or the page reloaded, the way the page does (its `id`
128
+ must name one list of the app, see [below](#a-list-that-comes-back-one-id-one-list));
129
+ **`scrollResetOnNavigation`** opts out. What it draws there before its source
130
+ answers is another matter
131
+ ([What a run knows when it opens](#what-a-run-knows-when-it-opens)). A list scrolling the document that
130
132
  opens on a row places the document itself: the offset the page kept for its url
131
133
  is not put back over it — the rows held off screen are fillers of an estimated
132
134
  height, and the same pixels now fall on other rows.
@@ -199,7 +201,8 @@ whole list. `<List.Items count>` says "I know how many rows are coming": the
199
201
  rows not held yet are skeletons in their own place, at their own size (see
200
202
  [What the list knows, and what it guesses](#what-the-list-knows-and-what-it-guesses)),
201
203
  asked for as they enter the render window — a list that knows its count has no
202
- use for the first one.
204
+ use for the first one. A run that does not know it learns it from its first
205
+ answer ([What a run knows when it opens](#what-a-run-knows-when-it-opens)).
203
206
 
204
207
  Reference: `src/control/list/list.jsx` (JSDoc on `List` and `List.Items`).
205
208
 
@@ -352,6 +355,35 @@ keeps the items it does not draw (`--navi-select` reaches them by id), and a
352
355
  group keeps the keys of named controls that are not there
353
356
  ([control_object.md](./control_object.md#a-control-that-is-not-there)).
354
357
 
358
+ ### What a run knows when it opens
359
+
360
+ A run reading a source (`itemsAction`) asks for what its window misses. What it
361
+ can draw before the first answer, and how many asks it takes to stand where the
362
+ list opens, follow from what it knows when it mounts:
363
+
364
+ | When it mounts, the run knows | Before the first answer | It asks for |
365
+ | ----------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
366
+ | nothing | skeletons where the list opens, the scrollbar a guess (up to there and a page past it) | the window, naming the item it opens on — and again if the answer ends the collection inside it |
367
+ | how many items there are (`count`) | skeletons where the list opens, the scrollbar right | the window |
368
+ | the composition it left (Back; a reload under `keepPageOnScreen`) | the rows from before, `refreshing` | the window, read again |
369
+
370
+ So `count` is worth giving when the app already has it: a total shown
371
+ elsewhere, a profile saying how many games there are. It is not worth a request
372
+ of its own, since the first answer gives it anyway. Without it, a list opening
373
+ near the end of its collection asks twice: the first answer is the one that
374
+ says where the end is.
375
+
376
+ A reload is a new document. A list with an `id` gets its position back, but the
377
+ composition is gone with the document that read it: skeletons and a first load,
378
+ unless the page is kept
379
+ ([list_refresh.md](./list_refresh.md#leaving-the-screen-and-coming-back)).
380
+
381
+ A list coming back to a remembered position draws first the items that were on
382
+ screen, and sizes its whole window once the browser has painted them (see
383
+ `renderBudget`'s `initial`). Its first ask is a page around what was on screen;
384
+ the edge of the window past that page, below the screen, comes with the next
385
+ one.
386
+
355
387
  ### What the list knows, and what it guesses
356
388
 
357
389
  A virtualized list has one aim: draw as few items as it can, and never show a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.29.449",
3
+ "version": "0.29.450",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {