mirror of
https://github.com/rommapp/romm.git
synced 2026-12-04 12:52:19 +01:00
Switching from per-card to per-window fetching dropped the departure cancellation the per-card path had: scrolling through a large library started a request per 72-item window encountered and left every departed window downloading and applying in the background, the wasted network / backend / render work this change set out to avoid on low-power devices. Add store.syncVisibleWindows(positions): it starts the windows covering the visible positions (deduped in fetchWindowAt) and aborts any in-flight or retry-pending window that no longer covers one. The shell's debounced viewport sync now delegates to it. Also abort in-flight windows when the gallery unmounts (onBeforeRouteLeave doesn't reset the store), keeping the loaded cache so returning is still instant. Drops the shell's dead visiblePositions bookkeeping. Generated-By: PostHog Code Task-Id: 6690877a-9c32-4c91-a78b-3d6fd3851fb7