Skip to content

fix: let BranchSelector dropdown grow to fit content#244

Open
R-Hart80 wants to merge 3 commits into
CatholicOS:devfrom
R-Hart80:fix/branch-selector-dropdown-width
Open

fix: let BranchSelector dropdown grow to fit content#244
R-Hart80 wants to merge 3 commits into
CatholicOS:devfrom
R-Hart80:fix/branch-selector-dropdown-width

Conversation

@R-Hart80
Copy link
Copy Markdown
Contributor

Problem

Closes #205.

BranchSelector's dropdown menu was hard-coded at w-64 (256 px). Branch rows pack in a check icon, branch name, optional default badge, commit SHA, ahead/behind counters, and a trash button — so any moderately long branch name (e.g. feature/preserve-entity-selection) would overflow the container and expose a horizontal scrollbar.

Fix

One-line change in components/revision/BranchSelector.tsx (line 170):

- <div className="absolute right-0 top-full z-50 mt-1 w-64 rounded-md ...">
+ <div className="absolute right-0 top-full z-50 mt-1 w-max min-w-64 max-w-[32rem] rounded-md ...">
  • w-max — menu grows to its widest row's intrinsic width, eliminating the horizontal scrollbar.
  • min-w-64 — 256 px floor keeps the existing appearance for projects with only short branch names.
  • max-w-[32rem] — 512 px ceiling prevents a single extremely long name from pushing the menu off-screen; the existing truncate on the branch-name span re-engages at that point.

The vertical scroll container (max-h-64 overflow-y-auto) is unchanged — that behaviour is correct.

Testing

  • Short branch names only: menu width is unchanged from today (≥ 256 px)
  • Moderately long name (e.g. feature/preserve-entity-selection): menu auto-grows, no horizontal scrollbar
  • Very long name: menu caps at max-w-[32rem], branch name truncates
  • Trigger button appearance unchanged
  • Existing test suite: 158/159 pass (1 pre-existing failure in LanguagePicker.test.tsx, unrelated)

🤖 Generated with Claude Code

R-Hart80 and others added 3 commits May 11, 2026 10:39
The labeled main button now triggers collapse-one-level (conservative)
and the icon-only add-on triggers collapse-all, matching the Expand
group's convention. Fixes CatholicOS#208.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…theme

Added explicit text-slate-900/dark:text-white to both <select> elements
and bg-white/dark:bg-slate-700 + text colors to each <option> so the
selected value and dropdown popup are readable in dark mode. Fixes CatholicOS#204.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaced fixed w-64 with w-max min-w-64 max-w-[32rem] so the menu
expands to its widest row without horizontal scrollbars, while keeping
a 256px floor for short names and a 512px ceiling for very long ones
(where the existing truncate on the branch-name span re-engages).
Fixes CatholicOS#205.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Warning

Rate limit exceeded

@R-Hart80 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 48 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 45506724-811e-4822-b1e7-275954ad47c2

📥 Commits

Reviewing files that changed from the base of the PR and between 0233a83 and e4b4531.

📒 Files selected for processing (3)
  • components/editor/shared/EntityTreeToolbar.tsx
  • components/pr/PRCreateModal.tsx
  • components/revision/BranchSelector.tsx
✨ 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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BranchSelector dropdown is fixed-width and shows a horizontal scrollbar with longer branch names

1 participant