Skip to content

perf(shuffle): Implement paginated shuffle with seeded deterministic …#962

Merged
Alexzafra13 merged 2 commits intomainfrom
claude/review-frontend-code-01GfARhs6DummV6xxbL7R4N4
Nov 30, 2025
Merged

perf(shuffle): Implement paginated shuffle with seeded deterministic …#962
Alexzafra13 merged 2 commits intomainfrom
claude/review-frontend-code-01GfARhs6DummV6xxbL7R4N4

Conversation

@Alexzafra13
Copy link
Copy Markdown
Owner

…ordering

  • Replace findAllShuffled with findShuffledPaginated in ITrackRepository
  • Use md5(id || seed) for deterministic ordering in PostgreSQL
  • Add seed, skip, take params to GET /tracks/shuffle endpoint
  • Return hasMore, seed, skip, take in response for pagination
  • Update frontend tracksService with new ShuffledTracksResponse type
  • Refactor useShufflePlay hook for batch loading with auto-prefetch
  • Create unit tests for GetShuffledTracksUseCase
  • Update existing tests with new repository method

Benefits:

  • Reduces initial payload from ~3600 tracks to 50 tracks
  • Enables infinite scrolling through shuffle queue
  • Same seed produces same order for consistent pagination

claude and others added 2 commits November 30, 2025 19:50
…ordering

- Replace findAllShuffled with findShuffledPaginated in ITrackRepository
- Use md5(id || seed) for deterministic ordering in PostgreSQL
- Add seed, skip, take params to GET /tracks/shuffle endpoint
- Return hasMore, seed, skip, take in response for pagination
- Update frontend tracksService with new ShuffledTracksResponse type
- Refactor useShufflePlay hook for batch loading with auto-prefetch
- Create unit tests for GetShuffledTracksUseCase
- Update existing tests with new repository method

Benefits:
- Reduces initial payload from ~3600 tracks to 50 tracks
- Enables infinite scrolling through shuffle queue
- Same seed produces same order for consistent pagination
@Alexzafra13 Alexzafra13 merged commit 9845c8f into main Nov 30, 2025
1 of 2 checks passed
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