Commit Graph
3 Commits
Author SHA1 Message Date
Vignan PoshamandClaude Sonnet 5 9b85b4e748 Guard sticky-tile registration against stale image loads
If a tile is virtualised out before its in-flight thumbnail finishes, the
load event still fires on the detached <img>. Without a guard that callback
would add the index to state.stickyTiles, potentially pinning a later
replacement tile whose own <img> has not painted yet.

Only register the index while this <a> is still the live tile for it
(state.renderedTiles.get(index) === a).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-07 01:38:19 -04:00
Vignan PoshamandClaude Sonnet 5 ec199961ea 3.3.2
Bumps the release version so the cache-busted static asset path
(/share/static/<version>/js/client/init.js) changes and clients pick up the
rebuilt gallery bundle with the sticky-thumbnail fix instead of an
immutably-cached old one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-07 01:29:12 -04:00
Vignan PoshamandClaude Sonnet 5 06741b47bb Keep loaded gallery thumbnails mounted to stop scroll-back flicker
The gallery virtualiser removed a tile's <a>/<img> from the DOM whenever it
left the viewport ± 1 buffer and rebuilt it from scratch on re-entry, so
scrolling back up replayed the thumbhash placeholder and opacity fade on
thumbnails that were already loaded - even for small albums where no network
fetch happens.

Track tile indices whose <img> has fired `load` in a bounded, LRU-ordered
`stickyTiles` set. virtualize() keeps those tiles in the "needed" set so
syncRendered never unmounts them; not-yet-loaded tiles still get the normal
lazy create/remove + data-src treatment, so large albums keep lazy-loading
on first scroll-into-view.

The set is trimmed to STICKY_TILE_LIMIT (1500) each pass - currently visible
tiles are bumped to most-recently-used and the oldest off-screen overflow is
released back to normal virtualisation - so a very large album (100k+ photos)
cannot accumulate unbounded mounted DOM or retained image memory as the user
scrolls. Cleared on a layout recompute since tile geometry changes there.
Also adds a fast-path skip in loadVisibleTiles() for finished loads now that
the rendered-tile map can be larger.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-07 01:10:23 -04:00