[Mobile] Smooth out lineup infinite-scroll on Trending and Feed#14272
Merged
dylanjeffers merged 1 commit intomainfrom May 7, 2026
Merged
[Mobile] Smooth out lineup infinite-scroll on Trending and Feed#14272dylanjeffers merged 1 commit intomainfrom
dylanjeffers merged 1 commit intomainfrom
Conversation
The mobile `TrackLineup` previously triggered `loadNextPage` through a 100ms debounce, then deferred skeleton rendering until the parent's tanquery `isFetching` propagated back — so scrolling to the bottom looked frozen for a beat before any feedback appeared. Bumps `onEndReachedThreshold` from 0.5 to a full viewport ahead, drops the debounce and the duplicate `onScroll` handler, and adds a synchronous local "load triggered" flag so skeletons flip on in the same tick the scroll handler fires. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: a407633 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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 mobile
TrackLineupinfinite-scroll on Trending and Feed felt rough: scrolling to the bottom looked frozen for a beat, then late skeletons appeared, then tracks loaded. Three things were stacked on top of each other:loadNextPage(useDebouncedCallback(..., 100)) — every load trigger waited a full debounce window before dispatching.isFetching— they only rendered afterloadNextPage()ran, RTK Query started the request, andisFetchingpropagated back through the parent. That's a multi-tick round-trip after the user already hit the bottom.onScrollandonEndReachedcalled the same debounced load.This PR makes the scroll feedback synchronous:
onEndReachedThresholdfrom0.5to1so the next page request fires when one full viewport of content remains below.onScrollhandler —onEndReachedalready fires at the same threshold.isLoadMoreTriggeredflag set the same tick the scroll handler fires, so skeletons render on the very next frame instead of waiting for the parent's tanqueryisFetchingto flip. Cleared once new entries arrive or the parent finishes fetching.Single load-more entry point now:
Skeleton count consults both the parent state and the local trigger:
Test plan
TrackLineupconsumers still paginate correctly (Profile Tracks/Reposts, Search Tracks, Track remixes, Listening History, Contest Submissions).🤖 Generated with Claude Code