fix(windows): windows branch switch ui broken#1038
fix(windows): windows branch switch ui broken#1038EwanJordaan wants to merge 10 commits intopingdotgg:mainfrom
Conversation
- Apply shared hover/selected/highlight class to all branch combobox items - Keep branch action rows and branch rows visually consistent in the selector
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| <ComboboxPrimitive.Item | ||
| className={cn( | ||
| "grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", | ||
| "grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base outline-none hover:bg-accent data-disabled:pointer-events-none data-selected:bg-accent/50 data-selected:text-foreground data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", |
There was a problem hiding this comment.
Shared primitives missing hover:text-accent-foreground class
Medium Severity
The shared ComboboxItem and AutocompleteItem base styles add hover:bg-accent but omit hover:text-accent-foreground. The branch selector works around this by adding hover:text-accent-foreground via branchSelectorHighlightClassName, but other combobox consumers won't get the text color change on hover. This is inconsistent with the data-highlighted state which pairs bg-accent with text-accent-foreground. On Windows where data-highlighted may not activate on hover, these consumers will see a background change without the corresponding text color update.
Additional Locations (1)
| resolvedActiveBranch, | ||
| }); | ||
| const branchSelectorHighlightClassName = | ||
| "hover:bg-accent hover:text-accent-foreground data-selected:bg-accent/50 data-selected:text-foreground data-highlighted:bg-accent data-highlighted:text-accent-foreground"; |
There was a problem hiding this comment.
Branch selector highlight className mostly redundant with base
Low Severity
branchSelectorHighlightClassName contains six utility classes, but five of them (hover:bg-accent, data-selected:bg-accent/50, data-selected:text-foreground, data-highlighted:bg-accent, data-highlighted:text-accent-foreground) are already in the ComboboxItem base styles and are silently deduplicated by tailwind-merge. Only hover:text-accent-foreground is a meaningful addition. This creates a false impression that the branch selector needs custom styling and makes it easy to drift from the shared primitives.


What Changed
Why
The branch switcher already controls selection through the combobox value state, but the selected styling was partly hardcoded in the branch selector itself. That made the UI behavior inconsistent and more fragile.
This change moves selected-state styling into the shared combobox/autocomplete primitives so visual state is handled consistently through the existing
data-selected,data-highlighted, and hover behaviors.By relying on the shared primitives instead of custom styling in the branch selector, the UI behavior becomes predictable across combobox-based components and resolves the Windows branch selection hover issue.
UI Changes
Before:
After:
Video:
Screen.Recording.2026-03-13.195339.mp4
Checklist
Issue #1040
Note
Fix broken branch selector UI on Windows by correcting hover and selection styling
hover:bg-accent,data-selected:bg-accent/50, anddata-selected:text-foregroundclasses toComboboxItemin combobox.tsx andAutocompleteItemin autocomplete.tsx so hover and selected states are visually indicated.branchSelectorHighlightClassNameapplied to all item types.Macroscope summarized 8b03884.
Note
Low Risk
Low risk: CSS-class changes only, but they affect shared
ComboboxItem/AutocompleteItemstyling across the app and could subtly change selection/hover visuals in other pickers.Overview
Fixes inconsistent branch-switch hover/selection visuals (notably on Windows) by centralizing selected/hover styling in the shared
ComboboxItemandAutocompleteItemprimitives.BranchToolbarBranchSelectorremoves its per-branch “active” styling and instead applies a single highlight class to all items (regular branches, create-branch, and checkout-PR), relying ondata-selected/data-highlightedfor consistent rendering.Written by Cursor Bugbot for commit 8b03884. This will update automatically on new commits. Configure here.