From 36a0615dcb4ef67f8680c34de81dc122298183cb Mon Sep 17 00:00:00 2001 From: Psychotoxical <171614930+Psychotoxical@users.noreply.github.com> Date: Tue, 9 Jun 2026 22:39:12 +0200 Subject: [PATCH] fix(home): stop Most Played load-more from snapping the page upward (#1053) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- CHANGELOG.md | 8 ++++++++ src/components/BecauseYouLikeRail.tsx | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 848c30b0..b156057f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] > **🙏 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) diff --git a/src/components/BecauseYouLikeRail.tsx b/src/components/BecauseYouLikeRail.tsx index 23c20225..610cad38 100644 --- a/src/components/BecauseYouLikeRail.tsx +++ b/src/components/BecauseYouLikeRail.tsx @@ -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' }],