Skip to content

feat(playlists): sort playlist tracks by release date (#854) - #856

Merged
LargeModGames merged 1 commit into
LargeModGames:mainfrom
kapok-4o:feat/playlist-release-date-sort
Oct 15, 2026
Merged

LargeModGames merged 1 commit into
LargeModGames:mainfrom
kapok-4o:feat/playlist-release-date-sort

Conversation

@kapok-4o

@kapok-4o kapok-4o commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes #854. The sort menu on a playlist now offers Release Date (y), like Saved Albums.

  • SortContext::PlaylistTracks lists SortField::ReleaseDate.
  • Both playlist sort paths order by TrackInfo::release_date: sort_playlist_track_matches (the loaded pages and search results) and Sorter::sort_tracks (the full refetch walk). The dates are YYYY, YYYY-MM or YYYY-MM-DD, so the strings order chronologically; a track without one sorts first in ascending order, as in Saved Albums.
  • default_sort_playlist_tracks accepts release_date and release_date:desc (settings options and docs/configuration.md).
  • release_date_sort_is_offered_for_saved_albums_only from feat(albums): show the release year on the artist page and sort saved albums by it (#698) #719 pinned the old behaviour; it is now …_for_saved_albums_and_playlists_only and still checks that Saved Artists and Recently Played don't offer it.

Testing

macOS (aarch64), on 5e488628:

  • cargo fmt --all --check: clean.
  • cargo clippy --locked -- -D warnings: clean for default, all-sources, slim, headless, mcp-only and the gui feature set.
  • cargo test --locked: slim 1598 passed; default 2078 passed, 8 ignored; all-sources 2287 passed, 30 ignored; gui 1775 passed, 8 ignored (no bindings diff).
  • New tests: release_date_sort_orders_tracks_by_date_with_undated_tracks_first, playlist_search_results_sort_by_release_date, and the updated release_date_sort_is_offered_for_saved_albums_and_playlists_only. All three fail with the change reverted.

Additional notes

Not tried against a live Spotify account: I haven't checked that every playlist track carries a release date. A track without one sorts as undated rather than failing.

Summary by CodeRabbit

  • New Features
    • Added release-date sorting for playlist tracks, with ascending and descending options.
    • Tracks without release dates appear first when sorting ascending and last when sorting descending.

)

The playlist sort menu offers Release Date like Saved Albums. Both playlist sort paths (the loaded pages and search results, and the full refetch walk) order by each track's album release date; a track without one sorts first, as in Saved Albums. default_sort_playlist_tracks accepts release_date and release_date:desc.
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LargeModGames/spotatui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f0bca5a6-46dd-4b3d-8994-8e09dc41252e
📥 Commits

Reviewing files that changed from the base of the PR and between 5e48862 and 4b4200f.

📒 Files selected for processing: 5
  • CHANGELOG.md
  • docs/configuration.md
  • src/core/app/playlist_pages.rs
  • src/core/app/settings_schema.rs
  • src/core/sort.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

Playlist track sorting now supports release date in ascending and descending order. Tracks without a release date sort first ascending and last descending. The setting options, configuration documentation, and changelog include the new sort field.

Changes: Playlist Release-Date Sorting

Layer / File(s) Summary
Expose release-date sorting
src/core/sort.rs, src/core/app/settings_schema.rs, docs/configuration.md, CHANGELOG.md
PlaylistTracks now offers ReleaseDate. The playlist sort setting and documentation list release_date; the changelog also records release_date:desc and the y shortcut.
Sort playlist tracks by release date
src/core/sort.rs, src/core/app/playlist_pages.rs
Track and playlist search sorting use release-date values. Tests cover both sort directions, undated tracks, and preservation of playlist positions.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 4b420

No identified issue blocks merging. Playlist tracks without release dates are intended to sort as undated.

Pre-merge checks: Passed 4
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the permitted conventional-commit prefix feat(playlists): and clearly describes the main change, sorting playlist tracks by release date.
Linked Issues check Passed Issue #854 requires the Release Date menu entry, ascending and descending playlist sorting, settings values, and automated coverage. SortContext::PlaylistTracks includes SortField::ReleaseDate. `s…
Out of Scope Changes check Passed The changed source files implement issue #854. The tests verify the new sort behavior and configuration. The configuration documentation and changelog describe the same feature. No unrelated change is…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
✨ Simplify code
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/core/app/playlist_pages.rs 97.2% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@LargeModGames
LargeModGames merged commit 21eeb05 into LargeModGames:main Oct 15, 2026
32 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.

Playlist tracks: add a Release Date sort

2 participants