Repository navigation
fix(library): remember the chosen sort across restarts - #808
Closed
kevenchantre wants to merge 1 commit into
Closed
kevenchantre wants to merge 1 commit into
kevenchantre wants to merge 1 commit into
Conversation
The Library's sort lived only in the open Library screen and started at Latest every time the app opened, so a chosen sort such as Title (A-Z) was lost on every restart. The sort is now a setting (librarySortMode, default Latest), loaded when the Library opens and saved whenever it changes from the sort menu, the table headers or the filter sheet; Reset saves Latest. Unknown values fall back to Latest. Playlists have no size sort, so with a saved size sort they show Latest without replacing it, and the other pages apply it again. Fixes mornyeapp#776
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
The Library's sort lived only in the open Library screen (
_sortModeinqueue_tab.dart, initialised to'latest') and was never saved, so a chosen sort such as Title (A–Z) reset to Latest every time the app restarted (#776).librarySortMode(defaultlatest), next tohistoryFilterMode, which already remembers the last Library tab. The valid values are one shared list,AppSettings.librarySortModes, which the sort menus now also use.setLibrarySortMode.Related Issues
Fixes #776
Type of Change
Validation
dart format --output=none --set-exit-if-changed lib test integration_testflutter analyzeflutter testbash scripts/check_rust_backend.shValidation notes:
test/library_sort_setting_test.dart: Latest by default; a chosen sort is saved and loaded again; every offered sort is kept; unknown values fall back to Latest.test/library_toolbar_test.dart: the Library opens with the saved sort (Material and Mornye, phone and desktop); choosing a size sort saves it; Playlists show Latest without replacing a saved size sort, and Songs applies it again; Reset in the filter sheet saves Latest.lib/models/settings.g.dartmatchesbuild_runneroutput.