Skip to content

fix(windows): windows branch switch ui broken#1038

Open
EwanJordaan wants to merge 10 commits intopingdotgg:mainfrom
EwanJordaan:fix(windows)/branch-selection-ui
Open

fix(windows): windows branch switch ui broken#1038
EwanJordaan wants to merge 10 commits intopingdotgg:mainfrom
EwanJordaan:fix(windows)/branch-selection-ui

Conversation

@EwanJordaan
Copy link
Copy Markdown

@EwanJordaan EwanJordaan commented Mar 13, 2026

What Changed

  • Moved selected-row styling into the shared combobox and autocomplete primitives
  • Removed branch-selector-specific selected styling
  • Fixed the Windows branch switch UI so the hover effect renders consistently

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:

  • The selected branch row could render incorrectly or inconsistently in the branch switch UI on Windows
  • Hovering over branches did not update the highlighted row visually

After:

  • The selected branch row uses the shared selected-state styling
  • Hover, highlighted, and selected states are now consistent with the shared combobox/autocomplete behavior
  • Hover highlighting follows the cursor correctly in the branch switch UI

Video:

Screen.Recording.2026-03-13.195339.mp4

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for the UI change
  • I included a video for animation/interaction changes

Issue #1040

Note

Fix broken branch selector UI on Windows by correcting hover and selection styling

  • Adds hover:bg-accent, data-selected:bg-accent/50, and data-selected:text-foreground classes to ComboboxItem in combobox.tsx and AutocompleteItem in autocomplete.tsx so hover and selected states are visually indicated.
  • Replaces the manual active-branch equality check in BranchToolbarBranchSelector.tsx with a unified branchSelectorHighlightClassName applied to all item types.

Macroscope summarized 8b03884.


Note

Low Risk
Low risk: CSS-class changes only, but they affect shared ComboboxItem/AutocompleteItem styling 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 ComboboxItem and AutocompleteItem primitives.

BranchToolbarBranchSelector removes its per-branch “active” styling and instead applies a single highlight class to all items (regular branches, create-branch, and checkout-PR), relying on data-selected/data-highlighted for consistent rendering.

Written by Cursor Bugbot for commit 8b03884. This will update automatically on new commits. Configure here.

@github-actions github-actions bot added size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 13, 2026
- Apply shared hover/selected/highlight class to all branch combobox items
- Keep branch action rows and branch rows visually consistent in the selector
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 13, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c60ea614-fa9a-4a35-9b0b-6be9bf2ee46a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:S 10-29 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Mar 13, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

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",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

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";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant