@jsenv/navi 0.29.445 → 0.29.447
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/dev/jsenv_navi.js +34 -8
- package/dist/dev/jsenv_navi.js.map +3 -3
- package/dist/jsenv_navi.js +34 -8
- package/dist/jsenv_navi.js.map +3 -3
- package/docs/AI_INSTRUCTIONS.md +4 -2
- package/docs/scroll.md +38 -0
- package/package.json +1 -1
package/docs/AI_INSTRUCTIONS.md
CHANGED
|
@@ -186,11 +186,13 @@ start when unsure which export solves a problem.
|
|
|
186
186
|
`scroller`, where a list opens (a position handed back whole, `visibleCount`
|
|
187
187
|
included), a list that comes back (its `id` names one list of the app), a
|
|
188
188
|
popup that scrolls, many rows (`<List.Items>`, the render window and its first
|
|
189
|
-
picture, skeletons at the size of their item, `itemSize`, `findText
|
|
189
|
+
picture, skeletons at the size of their item, `itemSize`, `findText`, how far
|
|
190
|
+
ahead its images load and `loading` before `src`), many
|
|
190
191
|
sections (`<Box mount="after-paint">` and what it leaves out of reach), hover
|
|
191
192
|
while scrolling. Before writing CSS to make something scroll, before
|
|
192
193
|
rendering a collection as `<List.Item>` children, before writing a
|
|
193
|
-
`renderSkeleton`, and before deferring part
|
|
194
|
+
`renderSkeleton`, before putting images in a run, and before deferring part
|
|
195
|
+
of a page.
|
|
194
196
|
- `z_index.md` — DOM order first; a `z-index` without `isolation: isolate`
|
|
195
197
|
competes with the page; navi's bands. Before writing a `z-index`.
|
|
196
198
|
- `typography.md` — text is a component; `maxLines` is the one truncation; one
|
package/docs/scroll.md
CHANGED
|
@@ -482,6 +482,44 @@ is never revealed. navi's own does.
|
|
|
482
482
|
|
|
483
483
|
Reference: `src/control/demos/19_list_find_in_page_demo.html`.
|
|
484
484
|
|
|
485
|
+
### Images in a run
|
|
486
|
+
|
|
487
|
+
An `<img>` asks for its file once it is in the DOM, and an item outside the
|
|
488
|
+
render window is not. So in a run, two things decide how far ahead of the screen
|
|
489
|
+
images load, the window and the browser, and the nearer one wins:
|
|
490
|
+
|
|
491
|
+
- **Without `loading="lazy"`**, the window decides. Every item it draws loads
|
|
492
|
+
its images, so the lookahead that keeps a fling covered (three quarters of
|
|
493
|
+
what the screen leaves of `renderBudget`, which is dozens of items with the
|
|
494
|
+
default) is downloaded when the list opens, and again each time the window
|
|
495
|
+
slides.
|
|
496
|
+
- **With `loading="lazy"`**, the browser decides inside the window, and each
|
|
497
|
+
engine decides differently. Measured in October 2026, this is how far below
|
|
498
|
+
the screen an image's top is when its request starts:
|
|
499
|
+
|
|
500
|
+
| engine | distance |
|
|
501
|
+
| ----------------------------- | ------------------ |
|
|
502
|
+
| Chromium | ~3000 px |
|
|
503
|
+
| WebKit (every browser on iOS) | ~1 viewport height |
|
|
504
|
+
| Firefox | ~600 px |
|
|
505
|
+
|
|
506
|
+
Chromium keeps the same distance on 3G and on 4G. When the window's lookahead
|
|
507
|
+
is shorter than the engine's distance, the window decides again.
|
|
508
|
+
|
|
509
|
+
It is a trade between bytes and images that are ready. Lazy images follow the
|
|
510
|
+
screen, and nothing the user never reaches is downloaded. Eager ones are
|
|
511
|
+
already there when a fling arrives, at the cost of a whole window of downloads.
|
|
512
|
+
How far ahead is enough depends on how fast the screen is crossed and how fast
|
|
513
|
+
a file arrives. Like the window's own lookahead, it is measured on the slowest
|
|
514
|
+
device and connection the list serves. Whichever you choose, give each image
|
|
515
|
+
its dimensions (see
|
|
516
|
+
[What the list knows, and what it guesses](#what-the-list-knows-and-what-it-guesses)).
|
|
517
|
+
|
|
518
|
+
`loading` only holds if it is set before `src`. `Image` does this whatever the
|
|
519
|
+
order of its props. A plain `<img>` written in JSX must put `loading` first:
|
|
520
|
+
WebKit decides when `src` is set, and an image whose `src` came first loads
|
|
521
|
+
whatever `loading` says afterwards.
|
|
522
|
+
|
|
485
523
|
### Doing it well
|
|
486
524
|
|
|
487
525
|
- **Skeletons at the size of their item**, and `itemSize` when the items above
|