feat: allow using typed branch name directly#2195
Open
thmsobrmlr wants to merge 3 commits into
Open
Conversation
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
apps/code/src/renderer/features/git-interaction/components/BranchSelector.tsx:251-263
**Enter key bypasses highlighted combobox item**
Because `onKeyDownCapture` intercepts Enter and calls `stopPropagation` whenever `canUseInputBranch` is true, the combobox's own keyboard-selection logic is never reached. If a user types a partial name (e.g. `feat`), uses the arrow keys to highlight `feat/my-specific-branch`, and presses Enter, they will check out `feat` (the raw typed text) instead of the highlighted branch. This silently breaks keyboard-driven selection whenever the typed text differs from the highlighted item.
A common fix is to inspect whether any list item currently has the aria-selected / active-descendant focus — or, simpler, only intercept Enter when there are zero filtered list items that exactly match the trimmed input (i.e. the typed name doesn't resolve to anything in the list), so normal selection still wins when an item is highlighted.
Reviews (1): Last reviewed commit: "add comment" | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
the branch dropdown is slow as **** for large repos
Changes
allows using a typed/pasted branch name through a check button, or by pressing enter
How did you test this?
tried locally