fix(home): stop Most Played load-more from snapping the page upward (#1053)

* fix(home): stop Most Played load-more from snapping the page upward

Loading more Most Played albums rebuilds the Because-You-Like anchor pool
(it is seeded from mostPlayed), and that rail's fetch effect keyed on the
pool array ref — so it re-ran on every append, swapping the row's cards and
producing a height blip that scroll anchoring turned into an upward viewport
jump. Gate the effect on poolKey (the stable top-anchor identity) instead,
matching the sibling reserve effect, so it only re-runs on a real seed change.

* docs(changelog): add #1053 Most Played load-more scroll fix
This commit is contained in:
Psychotoxical
2026-06-09 22:39:12 +02:00
committed by GitHub
parent 98bdf310d6
commit 36a0615dcb
2 changed files with 15 additions and 1 deletions
+7 -1
View File
@@ -519,7 +519,13 @@ export default function BecauseYouLikeRail({
})();
return () => { cancelled = true; };
}, [pool, activeServerId, musicLibraryFilterVersion, disableArtwork, poolKey]);
// Gate on poolKey (the stable top-anchor identity), not the `pool` array ref.
// `pool` is rebuilt whenever Home's mostPlayed changes, so loading more Most
// Played albums (which feeds this pool) would otherwise re-run this effect and
// swap the cards — a height blip above the row that scroll anchoring turns into
// an upward viewport jump. The sibling reserve effect already keys on poolKey.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [poolKey, activeServerId, musicLibraryFilterVersion, disableArtwork]);
useLibraryCoverPrefetch(
disableArtwork || recs.length === 0 ? [] : [{ albums: recs, priority: 'high' }],