Files
Stirling-PDF/frontend/editor
Reece 218a8400ca perf(files): big file lists render only what changed and only what shows
Three compounding costs made a full folder feel sticky:

- Every card and row re-rendered on ANY page state change, because item
  components weren't memoized and got fresh closures each render. Items
  now take a single stable actions dispatcher (latest-ref backed, so
  behavior stays current while identity stays fixed) and are React.memo —
  a selection click re-renders the two cards whose selection changed, not
  all 500. Selection-aware behavior (drag payloads, multi-move) moved
  into the dispatcher so items no longer hold the selection Set, whose
  identity changes on every click.
- Each lazily generated thumbnail updated the shared stub immediately,
  re-rendering every file-list consumer once per thumbnail — hundreds of
  times as a folder fills in. Updates now flush in windows; the card
  itself paints instantly from local state.
- Offscreen cards still paid layout and paint. content-visibility lets
  the browser skip them; the intrinsic size keeps the scrollbar honest.
2026-09-01 16:14:54 +01:00
..
2026-08-24 20:45:54 +00:00