Skip to content

feat(dialog): persist global sort option - #2039

Open
avnyu wants to merge 1 commit into
pop-os:masterfrom
avnyu:state_dialog_sort_name
Open

feat(dialog): persist global sort option#2039
avnyu wants to merge 1 commit into
pop-os:masterfrom
avnyu:state_dialog_sort_name

Conversation

@avnyu

@avnyu avnyu commented Sep 3, 2026

Copy link
Copy Markdown

Fixes: pop-os/xdg-desktop-portal-cosmic#258
Fixes: #1963

Allows file dialogs to save and load sort options via State.dialog_sort_name. Previously, dialogs always defaulted to descending modified time.

Tested using the dialog example. Changing sort options updates $HOME/.local/state/cosmic/com.system76.CosmicFiles/v1/dialog_sort_name, and opening new dialogs applies the stored option.
Also tested in archlinux using xdg-cosmic-portal-cosmic package built from archlinux PKGBUILD + patch to change cosmic-files dependency to this branch.

I did use LLM for code review and grammar check. No code is generated.

  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

Add DEFAULT_SORT_OPTION_FALLBACK constant for the default sort option
(Modified, false).
Add dialog_sort_name field to State to track the dialog sort option.
Add state_handler and state fields to Dialog to load saved state.
Implement tab::Command::SetSort for Dialog to apply and persist sort
options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant