Repository navigation
fix(picker): remember sorting choices across chooser launches - #281
pedrosatin wants to merge 1 commit into
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to Saved sorting is available on a fresh chooser launch, and navigation within an open chooser intentionally keeps its current sort. No material merge risk was identified. Pre-merge checks |
|
requestSort() records the folder's sort entry and updates the default sort leaf in ViewState. A fresh chooser launch reopens with the chosen order instead of resetting to Name ascending.
a3c7508 to
0e03cda
Compare
|
merged as authored; the file picker remembers its sort (a3c7508, the same change as this PR's current head, v0.3.10). Thanks @pedrosatin! https://github.com/thisisgm/flea/releases/tag/v0.3.10 |
flea --pickchooser dialogs, the ones browsers spawn for downloads and uploads, reset column sorting to Name ascending on every launch. The main window persists sort choices toui.json, butrequestSort()inui/PickerWindow.qmlonly touched in-memory properties (backend.sortBy,backend.sortDesc). The portal process dies as soon as a file is picked or the dialog is cancelled. The next chooser request started from scratch and reloadedui.jsonuntouched.requestSort()now recordsfolderSortsfor the active folder and updates the defaultsortleaf viaViewState, which persists the choice to~/.local/state/flea/ui.json. The next chooser in the same folder reopens with the saved sort. Unvisited folders fall back to the saved default.Related: #134 seeded the first picker listing from saved settings. #185 introduced the picker sort header, which was in-memory only until per-folder sorting landed in v0.3.7 (
1a4fb969).Changes:
ui/PickerWindow.qml: inrequestSort(order), callbackend.rememberFolderSort(win.path, order.key, order.desc)for non-Recent folders, and update thesortleaf withViewState.changeLeaf(mtimemaps todate). File stays at its 779-line budget.tests/js/picker.js: unit test assertingrequestSortrecords the folder sort and updates theViewStatesort leaf.Verified with a three-process run driving
PickerWindow.qmloffscreen againstflea --backend: after sortingdirAby Date descending,ui.jsonon disk held both the new default (date, reverse) andfolderSorts[dirA]. A second process openeddirAalready sorted by Date descending, and a third opened an unvisiteddirBwith the inherited default.Suites and gates
tests/js.sh pickerpassed 384 checks including the newrequestSortassertions.picker-header,picker-recent,picker-selection,picker-stallandpicker-gridall pass.tools/flea-file-budgetandtools/flea-qmllint-gatereport 0 failures.Summary by CodeRabbit