fix(web): keep project switcher rows inside the dropdown - #8616
fix(web): keep project switcher rows inside the dropdown#8616anjulahettige wants to merge 2 commits into
Conversation
|
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 Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped UI layout fix that adds one sizing utility to the shared combobox popup, keeping width-constrained project-switcher content inside its dropdown without changing data or user flows. It does not modify product defaults or introduce broader runtime capabilities. You can add or adjust custom eligibility rules. Learn more. |
ComboboxPopup pins the glass panel to the trigger width when a caller passes w-(--anchor-width), but the Base UI popup inside is a flex child without min-w-0. Its automatic minimum size is the min-content width of the widest row, which truncate on the row labels cannot reduce, so with a project name wider than the sidebar trigger the rows, their settings gears, and the search underline all render past the panel edge with no horizontal clipping. min-w-0 lets the popup shrink to the panel width so labels truncate and content clips. Popups without an explicit width class are unaffected: the panel still sizes to content between min-w-(--anchor-width) and max-w-(--available-width). Fixes pingdotgg#8612
5e253d5 to
11cc2b3
Compare
What Changed
Added
min-w-0to the popup element insideComboboxPopup(one class inapps/web/src/components/ui/combobox.tsx) so a width-constrained combobox popup clips and truncates its content instead of letting rows spill past the panel edge.Why
Fixes #8612.
The sidebar project switcher pins its popup to the trigger width with
w-(--anchor-width). That class lands on thedropdown-glasspanel span inComboboxPopup, but the Base UI popup inside is a flex child withoutmin-w-0, so its automatic minimum size is the min-content width of its widest row, and thetruncateon row labels cannot reduce that. With a project name wider than the sidebar trigger, the rows, each row's settings gear, and the search field's underline all render past the panel's right edge, floating over the thread list behind the dropdown. Nothing on that path clips horizontally.With
min-w-0the popup shrinks to the panel width, labels truncate, and the gears sit inside the panel. Popups without an explicit width class are unaffected: the panel still sizes to content betweenmin-w-(--anchor-width)andmax-w-(--available-width).The regression shipped with #5931 (first stable release v0.0.36); before that the project filter was a
MenuPopup, which puts the width class directly on the panel and wraps children in aw-fullscroller.Verified with
vp fmt --check,vp lint, andtsgo --noEmitscoped to the change, plus the before/after below from a dev instance.UI Changes
Project switcher open, one project name wider than the trigger.
Before:
After:
Checklist
Diagnosed and written by Claude Code running Claude Fable 5, via
t3 triage.Note
Low Risk
Single Tailwind class on shared combobox popup styling; no logic or data-path changes, with broad but positive layout behavior in constrained-width popups.
Overview
Fixes horizontal overflow in width-pinned combobox popups (notably the sidebar project switcher with
w-(--anchor-width)onComboboxPopup).Adds
min-w-0to the innerComboboxPrimitive.Popupincombobox.tsxso the flex child can shrink below its min-content width. Long project names and row actions now stay inside the panel andtruncateon labels works instead of drawing over the thread list.Reviewed by Cursor Bugbot for commit fea9aef. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix project switcher overflow by adding
min-w-0toComboboxPopupAdds the Tailwind class
min-w-0to the popup element in combobox.tsx. This lets the popup shrink below its intrinsic minimum width inside flex containers, keeping project switcher rows contained within the dropdown.Macroscope summarized fea9aef.