Improve A-Z navigation performance#980
Open
skalthoff wants to merge 7 commits intoimprove-cold-start-performancefrom
Open
Improve A-Z navigation performance#980skalthoff wants to merge 7 commits intoimprove-cold-start-performancefrom
skalthoff wants to merge 7 commits intoimprove-cold-start-performancefrom
Conversation
77dded2 to
08feb62
Compare
src/constants/storage.ts
Outdated
|
|
||
| export const queryClientPersister = createAsyncStoragePersister({ | ||
| storage: clientStorage, | ||
| export const queryClientPersister = createSyncStoragePersister({ |
Member
There was a problem hiding this comment.
IIRC @riteshshukla04 and I moved this to async storage to save on memory - but maybe we can re-evaluate?
Collaborator
Author
There was a problem hiding this comment.
yep valid, it jsut feels SOOOOO buttery on devices that can handle it tho...
Collaborator
Author
There was a problem hiding this comment.
i've reverted this change tho
Add NameStartsWithOrGreater and NameLessThan parameters to: - fetchArtists - fetchAlbums - fetchTracks These parameters enable direct letter-based filtering without fetching all preceding items.
Export helper function for merging bidirectional query data with letter section headers.
Implement useLetterAnchoredArtists, useLetterAnchoredAlbums, and useLetterAnchoredTracks hooks that use dual infinite queries: - Forward query with NameStartsWithOrGreater for items from anchor - Backward query with NameLessThan for items before anchor This enables instant letter jumping without paginating through all preceding items.
Implement useLibraryCacheValidation hook that validates cached data on app focus using lightweight Limit=0 count requests. Invalidates relevant queries when library counts change.
Create LetterAnchoredArtists, LetterAnchoredAlbums, and LetterAnchoredTracks components that use the new bidirectional hooks and support instant A-Z navigation with smooth scrolling in both directions.
Switch ArtistsTab, AlbumsTab, and TracksTab to use the new letter-anchored components for instant A-Z navigation.
React Compiler handles memoization automatically, so useMemo and useCallback are not needed in the letter-anchored hooks.
bb8d8af to
75673c1
Compare
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.
What is the change
Replace sequential pagination in the A-Z slider with instant letter jumping using Jellyfin's
NameStartsWithOrGreaterandNameLessThanparameters. Adds bidirectional infinite queries so users can scroll both up and down from the selected letter, plus lightweight cache validation on app focus.What does this address
The A-Z slider was slow for large libraries because it paginated sequentially until finding the selected letter. Now tapping a letter instantly fetches items starting from that letter.
Issue number / link
N/A
Tag reviewers
@anultravioletaurora