-
-
Notifications
You must be signed in to change notification settings - Fork 177
feat: add branch switcher with cmd+b shortcut #331
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
Add a quick branch switcher modal accessible via cmd+b (configurable): - New BranchSwitcherPrompt component for branch selection UI - useBranchSwitcher hook for managing switcher state and logic - useBranchSwitcherShortcut hook for keyboard shortcut handling - Settings integration for customizing the shortcut - Support switching to branches in linked worktrees - Fix cmd+n shortcut to ignore shift key combinations - Fix notification compilation on release builds
|
There is also a git related issue that I fixed in a separate PR: #332 That bug was causing issues with the head of the checked out branch being unclean. |
|
@codex review |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1947bb3f9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return ( | ||
| workspaces.find( | ||
| (ws) => ws.kind === "worktree" && ws.worktree?.branch === branch, | ||
| ) ?? null |
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.
Filter worktree matches to active workspace
The branch switcher treats any worktree with the same branch name as a match, regardless of which repo it belongs to. If the user has multiple workspaces with common branch names like main or develop, selecting a branch from the active repo can incorrectly switch to an unrelated worktree from a different repo because getWorktreeByBranch scans the full workspaces list. This only happens when there is at least one other worktree sharing the branch name, but in that case the switcher jumps to the wrong workspace. Consider restricting the search to worktrees whose parentId (or repo root) matches the active workspace.
Useful? React with 👍 / 👎.
Add a quick branch switcher modal accessible via cmd+b (configurable):
Small unrelated fix: