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>
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>
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>
When groupByDate was enabled the gallery re-sorted unconditionally
newest-first, discarding the album.order that immich.ts had already
applied. Branch the grouping sort on share.album.order so 'asc' sorts
ascending, keeping the descending default for individual shares and
albums with no order set.
Fixes#271