@jsenv/navi 0.29.462 → 0.29.464

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.
@@ -500,25 +500,41 @@ a stand-in — a pending screen, a `<Loading>` fallback, a list of three skeleto
500
500
  clamped to it, and the reader lands at the top of a page that arrives a moment
501
501
  later.
502
502
 
503
- **After a reload, navi waits for the route actions** that the first render had
504
- nothing to draw for: the page's code arriving on its own
503
+ **After a reload or a back/forward, navi waits for the route actions** that the
504
+ page has nothing to draw for: its code arriving on its own
505
505
  ([dynamic_import.md](./dynamic_import.md)), a read the previous document did not
506
506
  keep ([`keepPageOnScreen`](./resource.md#keeppageonscreen-the-page-on-screen-drawn-again-by-the-next-document) draws a kept one at once, and that one
507
- is not waited for). The position is put back once they have answered and the
508
- page has rendered. When one of them fails, nothing is written: the screen saying
509
- so is not the page the position was taken on, and the position stays for the
510
- reload that brings it back. What it costs: a slow read that every page asks for
511
- delays the position of every page, since nothing tells navi which reads set the
512
- height.
513
-
514
- A route action that starts asking only after that render is waited for too: one
515
- gated on app state the first render did not have yet (`when`, or params that
516
- read an app-wide read such as the signed-in user), or one whose params are
517
- another's answer. Before it asks, nothing tells "not yet" from "never", so the
518
- position is written into what the page shows. When the document is too short to
519
- hold it, the position is not spent: the next route action that starts without an
520
- answer is waited for the same way, and the position is put back again once it
521
- is drawn.
507
+ is not waited for), a read reset since the page was left. The position is put
508
+ back once they have answered and the page has rendered. When one of them fails,
509
+ nothing is written: the screen saying so is not the page the position was taken
510
+ on, and the position stays for the visit that brings it back. What it costs: a
511
+ slow read that every page asks for delays the position of every page, since
512
+ nothing tells navi which reads set the height.
513
+
514
+ A route action that starts asking later is waited for when it says what it
515
+ waits for: its `when`, a condition on app state the page did not have yet (the
516
+ signed-in user, an age gate). The position is written into what the page shows
517
+ and stays pending while a `when` of the page says no; the action that starts
518
+ once it holds is waited for the same way, and the position is put back again
519
+ once it is drawn. Params that say no are not waited for: they read the address,
520
+ and this one asks nothing of the action — when it asks later (a search typed),
521
+ the page has changed under the reader, and writing the old position would undo
522
+ whatever they or the app did meanwhile. So a gate on app state goes in `when`,
523
+ and the params keep what depends on the page:
524
+
525
+ ```js
526
+ const BOOK_ACTION = routeAction(
527
+ BOOK_ROUTE,
528
+ BOOK.GET,
529
+ () => ({ slug: bookSlugSignal.value }),
530
+ { when: () => catalogOpenSignal.value },
531
+ );
532
+ ```
533
+
534
+ A `when` that never holds on this page (a reader who is not an admin) keeps the
535
+ position pending until the reader takes over. An action whose params are
536
+ another's answer needs nothing: the position is read again once that answer is
537
+ drawn, and the action asking by then is waited for.
522
538
 
523
539
  **What navi cannot see, the page says**: a read it starts itself
524
540
  (`useAsyncData(…, { run: true })`), content whose height arrives late. While
@@ -535,8 +551,8 @@ as above. A row of tabs is not held: it gives a tab its position as it travels,
535
551
  and measures right after (see [below](#a-row-of-tabs-where-a-replace-is-an-arrival)).
536
552
 
537
553
  **The reader taking over cancels it.** A finger, a click, a wheel or a key
538
- before the position is written, and it is not written: moved afterwards, they
539
- would lose whatever they had started on. Going elsewhere cancels it too.
554
+ while the position is pending, and it is not written again: moved afterwards,
555
+ they would lose whatever they had started on. Going elsewhere cancels it too.
540
556
 
541
557
  A `<List>` that opens on an item is the opposite case, and needs nothing: it
542
558
  places the document itself, by measuring the item, and the url's offset is not
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.29.462",
3
+ "version": "0.29.464",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {