@jsenv/navi 0.29.433 → 0.29.434

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.
@@ -183,9 +183,10 @@ start when unsure which export solves a problem.
183
183
  hand-writing an offset to clear a `FixedBar`.
184
184
  - `scroll.md` — where scrolling happens: `header`/`body`/`footer`, a `List`'s
185
185
  `scroller`, where a list opens (a position handed back whole, `visibleCount`
186
- included), a popup that scrolls, many rows (`<List.Items>`, the render window
187
- and its first picture, `findText`), many sections (`<Box mount="after-paint">`
188
- and what it leaves out of reach), hover while scrolling. Before writing CSS to
186
+ included), a list that comes back (its `id` names one list of the app), a
187
+ popup that scrolls, many rows (`<List.Items>`, the render window and its first
188
+ picture, `findText`), many sections (`<Box mount="after-paint">` and what it
189
+ leaves out of reach), hover while scrolling. Before writing CSS to
189
190
  make something scroll, before rendering a collection as `<List.Item>`
190
191
  children, and before deferring part of a page.
191
192
  - `z_index.md` — DOM order first; a `z-index` without `isolation: isolate`
@@ -467,6 +467,10 @@ What that means for a page and for the application around it:
467
467
  - **The focus it holds goes where its removal would have sent it** — to no element
468
468
  — when it is hidden: a hidden element keeps the focus otherwise, and would
469
469
  receive the keys pressed during the movement.
470
+ - **Its lists are mounted beside the page arriving's.** A list remembering where
471
+ it was (`<List id>`) under the same `id` as a list of the page arriving is the
472
+ same list to navi, and the two overwrite each other's position (see
473
+ [scroll.md](./scroll.md#a-list-that-comes-back-one-id-one-list)).
470
474
  - **Never while a modal dialog is open.** An open modal keeps everything but
471
475
  itself out of reach — the page arriving could not even take the focus — and one
472
476
  in a page kept while leaving would stay open for the whole movement. The page is
package/docs/scroll.md CHANGED
@@ -122,11 +122,44 @@ by MEASURING it: it lands where it was even if rows were inserted before it,
122
122
  whatever the screen it was saved on. "Reopen a thread where I left it" is
123
123
  already provided; keep the position whole, its `visibleCount` sizes the first
124
124
  paint. A list with an `id` also **comes back where it was** when its screen is
125
- left and come back to, the way the page does; **`scrollResetOnNavigation`**
126
- opts out. A list scrolling the document that opens on a row places the
127
- document itself: the offset the page kept for its url is not put back over it
128
- — the rows held off screen are fillers of an estimated height, and the same
129
- pixels now fall on other rows.
125
+ left and come back to, the way the page does (its `id` must name one list of the
126
+ app, see [below](#a-list-that-comes-back-one-id-one-list));
127
+ **`scrollResetOnNavigation`** opts out. A list scrolling the document that
128
+ opens on a row places the document itself: the offset the page kept for its url
129
+ is not put back over it — the rows held off screen are fillers of an estimated
130
+ height, and the same pixels now fall on other rows.
131
+
132
+ ### A list that comes back: one `id`, one list
133
+
134
+ The position a list comes back to is kept under its `id` and the page's url, so
135
+ the `id` names **one list of the app**, not one list of the page. Two lists
136
+ mounted at the same time under the same `id` are one entry: each writes over the
137
+ other's position, and the one that goes takes the other's with it. The list
138
+ arriving then opens where the other one was, or comes back at its top after a
139
+ back.
140
+
141
+ Lists are mounted together more often than the screen shows:
142
+
143
+ - a list in a popup and a list in the page under it;
144
+ - a list in a bar or a sidebar kept by every page, and a list in one of the
145
+ pages;
146
+ - the two pages of a **route transition**: the page being left stays mounted,
147
+ hidden, until the movement is over (see
148
+ [route_transitions.md](./route_transitions.md#the-page-being-left-stays-until-its-movement-is-over)),
149
+ its lists with it.
150
+
151
+ So:
152
+
153
+ - **Name the list for what it lists** — `players_list`, `thread_messages`, never
154
+ `list`, `results` or `items`.
155
+ - **A component that draws a list on several pages takes the `id` from the page
156
+ using it** (a prop), rather than writing one of its own.
157
+ - **A list with no use for coming back** says `scrollResetOnNavigation`: it keeps
158
+ nothing, and its `id` no longer matters for this.
159
+
160
+ Not a clash: a page rendered by the same element on both sides — one route whose
161
+ params change (`/threads/1` to `/threads/2`), two routes with one `element` — is
162
+ carried over, and its list is one list moving from one url to the next.
130
163
 
131
164
  ### A search moves the list, and gives it back
132
165
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.29.433",
3
+ "version": "0.29.434",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {