Skip to content

fix(web): trigger lineup next-page fetch before user scrolls past skeletons#14351

Open
raymondjacobson wants to merge 1 commit into
mainfrom
claude/eloquent-hellman-7dc064
Open

fix(web): trigger lineup next-page fetch before user scrolls past skeletons#14351
raymondjacobson wants to merge 1 commit into
mainfrom
claude/eloquent-hellman-7dc064

Conversation

@raymondjacobson
Copy link
Copy Markdown
Member

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 isFetching to being gated on hasNextPage, which means they render persistently any time there's more to load — not just during an in-flight fetch. With ~15 skeletons at ~184px each, they pad the <InfiniteScroll>'s content height by ~2 viewports. react-infinite-scroller measures distance to the bottom of all rendered content, so the threshold (also 2 * 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:

  • Restores the original "skeletons only while a page is in flight" condition (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.
  • Corrects APPROX_TILE_HEIGHT_LARGE from 124184 (the desktop tile is 144 body + 24 mb='l' + 16 parent gap='m') so the in-flight skeleton count actually fills the threshold area as the comment claims.

Test plan

  • Open the Feed on web, scroll down — the next-page request fires while the bottom of the loaded tiles is still ~2 viewports below your viewport (check Network panel for feed calls), with skeletons appearing only after the request is in flight.
  • Same on Trending (Week / Month / All-Time).
  • Same on Profile Tracks / Reposts, Search Tracks, Listening History, Track Remixes, Contest Submissions.
  • Mobile-web (useWindow path) at a phone-sized viewport — fetch still triggers smoothly, no persistent skeleton padding.
  • Empty state still renders when a tab has no tracks.
  • Resizing the browser between pages still updates the threshold via ResizeObserver (no regression to existing behavior).

🤖 Generated with Claude Code

…letons

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 18, 2026

⚠️ No Changeset found

Latest commit: 92ece4e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

🌐 Web preview ready

Preview URL: https://audius-web-preview-pr-14351.audius.workers.dev

Unique preview for this PR (deployed from this branch).
Workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant