Skip to content

Improve A-Z navigation performance#980

Open
skalthoff wants to merge 7 commits intoimprove-cold-start-performancefrom
feature/fast-az-navigation
Open

Improve A-Z navigation performance#980
skalthoff wants to merge 7 commits intoimprove-cold-start-performancefrom
feature/fast-az-navigation

Conversation

@skalthoff
Copy link
Collaborator

What is the change

Replace sequential pagination in the A-Z slider with instant letter jumping using Jellyfin's NameStartsWithOrGreater and NameLessThan parameters. 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

@skalthoff skalthoff force-pushed the feature/fast-az-navigation branch from 77dded2 to 08feb62 Compare February 4, 2026 19:09

export const queryClientPersister = createAsyncStoragePersister({
storage: clientStorage,
export const queryClientPersister = createSyncStoragePersister({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC @riteshshukla04 and I moved this to async storage to save on memory - but maybe we can re-evaluate?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep valid, it jsut feels SOOOOO buttery on devices that can handle it tho...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@skalthoff skalthoff force-pushed the feature/fast-az-navigation branch from bb8d8af to 75673c1 Compare February 5, 2026 09:12
@skalthoff skalthoff changed the base branch from main to improve-cold-start-performance February 5, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants