-
Notifications
You must be signed in to change notification settings - Fork 834
fix: use a unified file list sorting rule in both list and tree views #12212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@nshcr is attempting to deploy a commit to the GitButler Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR unifies the file sorting rules between tree view and list view by extracting common sorting configuration into shared constants. Previously, the sortChildren function (used for tree view) and sortLikeFileTree function (used for list view) had slightly different sorting behaviors, which became noticeable with the new all-in-one continuous files diff preview feature.
Changes:
- Introduced shared sorting constants
FILE_SORT_CONFIGandFILE_SORT_LOCALEto ensure consistent sorting behavior - Updated both
sortChildrenandsortLikeFileTreefunctions to use the unified configuration - Removed inline sorting configuration that was previously defined within
sortLikeFileTree
|
cc @mtsgrd |
|
Amazing. Thank you! 🎉 |
|
Just one question, would FILE_SORT_LOCALE = undefined make it use the browsers locale? It might be better than explicitly setting |
|
@PavelLaptev fyi! |
|
@nshcr awesome :-) Thanks! |
@mtsgrd Thanks for merging it! I kept the locale set to For reference, in this PR (#10517), I also used formatting rules that respect the user's locale, which might be helpful for the software's localization in the future. |
The previous file list component used different filename sorting rules in the tree view and list view.
This wasn't a major issue in the earlier changed files view, but it has become much more noticeable with the recently introduced all-in-one continuous files diff preview, which follows the same sorting order as the list view.
This PR fixes the issue by making both views use a unified sorting rule.