mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2026-09-03 05:10:16 +03:00
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.