Skip to content

Replace library sort dropdown with bottom sheet#281

Merged
theovilardo merged 8 commits intomasterfrom
codex/improve-sorting-mechanism-with-bottom-sheet
Oct 22, 2025
Merged

Replace library sort dropdown with bottom sheet#281
theovilardo merged 8 commits intomasterfrom
codex/improve-sorting-mechanism-with-bottom-sheet

Conversation

@theovilardo
Copy link
Copy Markdown
Owner

Summary

  • track library sort state by stable LibraryTabId values and ensure per-tab defaults for liked, albums, and playlists
  • replace the library action row dropdown with a Material 3 expressive modal sheet that reflects the active tab selection
  • add unit coverage for the repository migration that backfills sort defaults when preferences are missing

Testing

  • ./gradlew test (fails: Android SDK not configured in the test environment)

https://chatgpt.com/codex/tasks/task_e_68f8230b3b50832f9df237aa8f614d45

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 161 to 166
val currentSongSortOption: SortOption = SortOption.SongTitleAZ,
val currentAlbumSortOption: SortOption = SortOption.AlbumTitleAZ,
val currentArtistSortOption: SortOption = SortOption.ArtistNameAZ,
val currentFavoriteSortOption: SortOption = SortOption.LikedSongTitleAZ,
val currentFavoriteSortOption: SortOption = SortOption.LikedSongDateLiked,
val currentFolderSortOption: SortOption = SortOption.FolderNameAZ,
val searchResults: ImmutableList<SearchResultItem> = persistentListOf(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid defaulting favorites to unsupported "Date liked" sort

The commit changes the initial favorite sort to SortOption.LikedSongDateLiked, but nothing in the repository records when a song was liked—toggleFavoriteSong only keeps a set of IDs and the favoriteSongs flow handles this option by ordering by song.id, which is unrelated to when the user liked the track. After this change, a clean install or cleared preferences will default the Favorites tab to an essentially arbitrary order instead of the previously deterministic alphabetical order. Either keep the alphabetical default or persist a timestamp for likes before making "Date liked" the default.

Useful? React with 👍 / 👎.

This commit refactors the `LibrarySortBottomSheet` to improve its visual styling and code readability.

The key changes are:
- **Shape:** The selectable sort options now use a `CircleShape` clip, making them fully rounded pills instead of rectangles with rounded corners.
- **Padding:** The vertical padding has been moved outside the `clip` modifier to ensure consistent spacing between the pill-shaped options.
- **Readability:** Color variables (`selectedColor`, `unselectedColor`) have been introduced to make the selection logic clearer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant