feat: add sort options to Downloads screen#1751
Open
lesquel wants to merge 2 commits intomaxrave-dev:mainfrom
Open
feat: add sort options to Downloads screen#1751lesquel wants to merge 2 commits intomaxrave-dev:mainfrom
lesquel wants to merge 2 commits intomaxrave-dev:mainfrom
Conversation
Add the ability to sort downloaded songs by: - Title (A-Z / Z-A) - Download date (Newest / Oldest first) - Artist name (A-Z / Z-A) The sort preference is persisted via DataStoreManager so it survives app restarts. The implementation follows the same patterns used in LocalPlaylistScreen (SortPlaylistBottomSheet). Changes: - New DownloadSortType sealed class with 6 sort variants - New SortDownloadsBottomSheet composable in ModalBottomSheet.kt - DownloadSortType.displayNameRes() extension in AllExt.kt - LibraryDynamicPlaylistViewModel: reactive sorting via combine() of raw songs + sort type, preference persistence with putString/getString - LibraryDynamicPlaylistScreen: sort icon in TopAppBar (Downloads only) - i18n strings for all 26 locales
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add the ability to sort downloaded songs by multiple criteria with ascending/descending direction. The sort preference persists between sessions.
Sort Options
Implementation Details
Architecture
coresubmodule — all new code lives incomposeAppSortPlaylistBottomSheetfromLocalPlaylistScreenNew Files
DownloadSortType.kt— Sealed class with 6 sort variants + serialization (toKey()/fromKey())Modified Files
LibraryDynamicPlaylistViewModel.kt— Reactive sorting viacombine(rawSongs, sortType), preference persistence viaDataStoreManager.putString()/getString()LibraryDynamicPlaylistScreen.kt— Sort icon button in TopAppBar (visible only for Downloaded type),SortDownloadsBottomSheetintegrationModalBottomSheet.kt— NewSortDownloadsBottomSheetcomposableAllExt.kt—DownloadSortType.displayNameRes()extension functionstrings.xmlfiles — i18n support for all existing locales (ar, az, bg, ca, de, es, fa, fi, fr, hi, in, it, iw, ja, ko, nl, pl, pt, ru, th, tr, uk, vi, zh, zh-rTW)Key Design Decisions
DownloadSortTypeis separate fromFilterState(avoids modifyingcoresubmodule)DataStoreManagerinjected viaby inject()fromKoinComponent(no DI module changes needed)"download_sort_type"Screenshots
Sort icon appears in the Downloads screen TopAppBar. Tapping opens a bottom sheet with 6 sort options.
Testing Checklist