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
+8
View File
@@ -274,6 +274,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Home — Most Played no longer jumps the page when loading more
**By [@Psychotoxical](https://github.com/Psychotoxical), reported by zunoz on Discord, PR [#1053](https://github.com/Psychotoxical/psysonic/pull/1053)**
* Clicking the arrow to load more albums in the **Most Played** rail sometimes snapped the page up to an earlier section. Loading more now keeps the viewport in place.
## [1.47.0] ## [1.47.0]
> **🙏 Thank you to our amazing Discord community.** This release would not have been possible without your tireless support, quality checks, bug reports and all-round collaboration. Every report, every repro and every bit of feedback shaped what shipped here — thank you. Come join us: [discord.gg/AMnDRErm4u](https://discord.gg/AMnDRErm4u) > **🙏 Thank you to our amazing Discord community.** This release would not have been possible without your tireless support, quality checks, bug reports and all-round collaboration. Every report, every repro and every bit of feedback shaped what shipped here — thank you. Come join us: [discord.gg/AMnDRErm4u](https://discord.gg/AMnDRErm4u)
+7 -1
View File
@@ -519,7 +519,13 @@ export default function BecauseYouLikeRail({
})(); })();
return () => { cancelled = true; }; 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( useLibraryCoverPrefetch(
disableArtwork || recs.length === 0 ? [] : [{ albums: recs, priority: 'high' }], disableArtwork || recs.length === 0 ? [] : [{ albums: recs, priority: 'high' }],