Skip to content

project_panel: Add sort_order settings #50221

Merged
smitbarmase merged 12 commits intozed-industries:mainfrom
Steffen70:feature/case-sensitive-sorting
Apr 8, 2026
Merged

project_panel: Add sort_order settings #50221
smitbarmase merged 12 commits intozed-industries:mainfrom
Steffen70:feature/case-sensitive-sorting

Conversation

@Steffen70
Copy link
Copy Markdown
Contributor

@Steffen70 Steffen70 commented Feb 26, 2026

(Feature Requests #24962)

"Before you mark this PR as ready for review, make sure that you have:"

  • Added a solid test coverage and/or screenshots from doing manual testing
  • Done a self-review taking into account security and performance aspects
  • Aligned any UI changes with the UI checklist

Release Notes:

  • Added a sort_order to project_panel settings which dictates how files and directories are sorted relative to each other in a sort_mode.

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Feb 26, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @Steffen70 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Feb 26, 2026
@Steffen70
Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Feb 26, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Feb 26, 2026

The cla-bot has been summoned, and re-checked this pull request!

@maxdeviant maxdeviant changed the title Added a setting to enable case-sensitive sorting in the project panel Add a setting to enable case-sensitive sorting in the project panel Feb 26, 2026
Comment thread docs/src/reference/all-settings.md
@Steffen70
Copy link
Copy Markdown
Contributor Author

Hello! Checking in on this PR. I'm happy to make any necessary adjustments or fix any merge conflicts if they pop up. Let me know when someone has a chance to take a look!

@smitbarmase
Copy link
Copy Markdown
Member

Thanks! I’m going to take a look at this today.

@smitbarmase smitbarmase force-pushed the feature/case-sensitive-sorting branch from 59ac0fa to afb39fa Compare April 8, 2026 08:40
@Steffen70
Copy link
Copy Markdown
Contributor Author

Thank you! I clearly should have spent a little more time finalizing this, given the number of edits required.

@smitbarmase
Copy link
Copy Markdown
Member

No worries, most of it was not a correctness issue, but I felt the need for refactoring given the state we were in. Thanks for putting up intial version. Instead of having a single bool, I changed it to a sort_order_lexicographic enum, which can take 4 values.

By default, it is default, which is case-insensitive natural sort. The three further values are:

  • upper, where we prefer uppercase names over lowercase names, and within that, it does the normal sorting defined by the sort mode.
  • lower, which is the opposite.
  • unicode, which is pure Unicode comparison.

This also follows how VS Code does it, and I have now also updated the importing from there. I also updated the benchmarks for these 12 cases, which are 3 sort modes across 4 different sort orders.

Case origin/main Current Branch
DirectoriesFirst / Default 12.053 ms 11.799 ms
Mixed / Default 9.151 ms 8.823 ms
FilesFirst / Default 8.252 ms 8.657 ms

We should be fine on that front.

@smitbarmase smitbarmase changed the title Add a setting to enable case-sensitive sorting in the project panel project_panel: Add sort_order_lexicographic Apr 8, 2026
Comment thread crates/settings/src/vscode_import.rs Outdated
Comment thread crates/project_panel/src/project_panel.rs
@smitbarmase smitbarmase changed the title project_panel: Add sort_order_lexicographic project_panel: Add sort_order settings Apr 8, 2026
@smitbarmase smitbarmase merged commit 320cef3 into zed-industries:main Apr 8, 2026
49 of 51 checks passed
piper-of-dawn pushed a commit to piper-of-dawn/zed that referenced this pull request Apr 25, 2026
_(Feature Requests zed-industries#24962)_

_"Before you mark this PR as ready for review, make sure that you
have:"_

* [x] Added a solid test coverage and/or screenshots from doing manual
testing
* [x] Done a self-review taking into account security and performance
aspects
* [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Added a `sort_order` to `project_panel` settings which dictates how
files and directories are sorted relative to each other in a
`sort_mode`.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants