fix(web): trigger lineup next-page fetch before user scrolls past skeletons#14351
Open
raymondjacobson wants to merge 1 commit into
Open
fix(web): trigger lineup next-page fetch before user scrolls past skeletons#14351raymondjacobson wants to merge 1 commit into
raymondjacobson wants to merge 1 commit into
Conversation
…letons Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14351.audius.workers.dev Unique preview for this PR (deployed from this branch). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The web Feed (and any other
TrackLineup-driven page: Trending, Profile Tracks/Reposts, Search, Listening History, Remixes, Contest Submissions) felt like pagination was lagging: as you scroll down you'd see skeletons appear at the bottom, but the next-page request didn't actually fire until you scrolled further past them.Root cause: regressed in apps#14286. The bottom-of-list skeletons were changed from being gated on
isFetchingto being gated onhasNextPage, which means they render persistently any time there's more to load — not just during an in-flight fetch. With~15skeletons at~184pxeach, they pad the<InfiniteScroll>'s content height by~2viewports.react-infinite-scrollermeasures distance to the bottom of all rendered content, so the threshold (also2 * viewport) only fires after you've scrolled through both the loaded tiles and the skeleton padding. The skeletons read as "loading" but no fetch had been kicked off yet.This PR:
isFetching || isLoadMoreTriggered), matching the empty-state branch a few lines above. The bottom of the InfiniteScroll content is now the bottom of the loaded tiles, so the existing 2-viewport threshold actually fires ~2 viewports before the last tile.APPROX_TILE_HEIGHT_LARGEfrom124→184(the desktop tile is 144 body + 24mb='l'+ 16 parentgap='m') so the in-flight skeleton count actually fills the threshold area as the comment claims.Test plan
feedcalls), with skeletons appearing only after the request is in flight.useWindowpath) at a phone-sized viewport — fetch still triggers smoothly, no persistent skeleton padding.ResizeObserver(no regression to existing behavior).🤖 Generated with Claude Code