feat: add branch sorting option#88
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a user-configurable branch sorting preference that affects branch-selection views (e.g., branch dropdown/history compare), persisted in app state and exposed in Preferences.
Changes:
- Introduces a
BranchSortOrderpreference stored inAppStore/localStorage and wired through UI props. - Updates branch grouping/sorting logic to support Alphabet, Recently Added (reflog order), and Recently Changed (by last commit date).
- Adjusts recent-branch loading limits in
GitStorebased on the selected sort mode, and adds/updates unit tests.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| app/test/unit/group-branches-test.ts | Adds coverage for new sort modes and recent-branch capping behavior. |
| app/src/ui/toolbar/branch-dropdown.tsx | Threads branchSortOrder prop into branch dropdown rendering. |
| app/src/ui/repository.tsx | Passes branchSortOrder down into repository view children. |
| app/src/ui/preferences/preferences.tsx | Adds branchSortOrder to preferences state and persists via dispatcher. |
| app/src/ui/preferences/appearance.tsx | Adds Appearance UI for selecting branch sort order. |
| app/src/ui/history/compare.tsx | Passes branchSortOrder into compare sidebar branch list. |
| app/src/ui/dispatcher/dispatcher.ts | Adds dispatcher API for updating branch sort order. |
| app/src/ui/branches/group-branches.ts | Implements new grouping/sorting behavior based on sort order. |
| app/src/ui/branches/branches-container.tsx | Threads branchSortOrder into BranchList. |
| app/src/ui/branches/branch-list.tsx | Updates group header labeling based on sort order. |
| app/src/ui/app.tsx | Passes app state branchSortOrder into relevant UI surfaces. |
| app/src/models/branch-sort-order.ts | Adds the sort order model/default. |
| app/src/lib/stores/git-store.ts | Adds sort-dependent recent-branch limits and extends loadBranches. |
| app/src/lib/stores/app-store.ts | Persists the setting, reloads branches on change, and wires into initial load. |
| app/src/lib/app-state.ts | Extends global app state with branchSortOrder. |
You can also share your feedback on Copilot code review. Take the survey.
f9d4f8a to
61736de
Compare
61736de to
ed012e0
Compare
|
Sorry, I'm getting a bit confused by this line:
I never said we should remove the "Recent branches" section. In fact, in the screenshot of my last comment you can see this section. |
I was referring to your reply here: #88 (comment). FWIW, I kept "Recent branches", so we should be good. |
|
Done! |
|
Great! Thanks for your contribution :) ESLint is complaining about an unused prop, but it looks like a false positive, I'll probably just add an ignore clause after merging the PR. |
|
Thank you for the collab and especially so quickly. Was a really awesome experience! |





Description
Hi! Thanks for maintaining this. I love it.
What I also love is the "Recent branches" list. Especially with AI, I try multiple things at the same time. So just showing 5 is not enough. I thought about adding a setting that changes the amount of branches that are displayed in "Recent branches", but I figured: It's much more useful to either sort by recently added (what "Recent branches" currently does), or new, "Recently changed" (based on commits).
Screenshots
Release notes
Notes: