Skip to content

feat: sort playlists alphabetically in "Add to playlist" dialog#5910

Open
eran132 wants to merge 1 commit into
yuliskov:masterfrom
eran132:feat/sort-playlists-alphabetically
Open

feat: sort playlists alphabetically in "Add to playlist" dialog#5910
eran132 wants to merge 1 commit into
yuliskov:masterfrom
eran132:feat/sort-playlists-alphabetically

Conversation

@eran132

@eran132 eran132 commented Jun 16, 2026

Copy link
Copy Markdown

What

Sorts the playlists in the Add to playlist context menu alphabetically by title, instead of showing them in most-recently-used (MRU) order.

Why

Requested in #5904. Because the list was ordered by recent use, a given playlist's position kept changing every time you opened the menu, so you could never build muscle memory for where a playlist sits — and the less-recently-used ones were the hardest to find. Sorting alphabetically gives every playlist a stable, predictable position.

How

In AppDialogUtil.appendPlaylistDialogContent(), the playlist list is copied and sorted case-insensitively by title before the dialog options are built. Copying first avoids mutating the caller's list. null titles are treated as empty strings to stay null-safe.

One file changed, +10/-1.

Testing

Built locally: ./gradlew :common:compileStstableDebugJavaWithJavacBUILD SUCCESSFUL (JDK 17, AGP 7.4.2, compileSdk 34).

Closes #5904

🤖 Generated with Claude Code

The "Add to playlist" context menu listed playlists in most-recently-used
order, so a playlist's position kept changing between invocations, making
it hard to locate the less-recently-used ones.

Sort the list alphabetically by title (case-insensitive) before building
the dialog so each playlist keeps a stable, predictable position. The
input list is copied first to avoid mutating the caller's list.

Closes yuliskov#5904

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 16, 2026 09:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR changes playlist option ordering in the playlist dialog by sorting playlists alphabetically to keep their positions stable across openings.

Changes:

  • Copy playlistInfos into a new list and sort it case-insensitively by title before rendering options.
  • Add an inline comment referencing issue #5904 to document the intent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1095 to +1102
// Sort playlists alphabetically so their position stays stable instead of
// shuffling around in most-recently-used order (see issue #5904).
List<PlaylistInfo> sortedPlaylistInfos = new ArrayList<>(playlistInfos);
Collections.sort(sortedPlaylistInfos, (info1, info2) -> {
String title1 = info1.getTitle() != null ? info1.getTitle() : "";
String title2 = info2.getTitle() != null ? info2.getTitle() : "";
return title1.compareToIgnoreCase(title2);
});
Comment on lines +1097 to +1102
List<PlaylistInfo> sortedPlaylistInfos = new ArrayList<>(playlistInfos);
Collections.sort(sortedPlaylistInfos, (info1, info2) -> {
String title1 = info1.getTitle() != null ? info1.getTitle() : "";
String title2 = info2.getTitle() != null ? info2.getTitle() : "";
return title1.compareToIgnoreCase(title2);
});
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.

[Feature Request]: In the Playlist context menu, sort playlists alphabetically.

2 participants