Skip to content

fix: ComboboxTrigger overflow - respect caller width and clip long values (fixes #84) - #91

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
vanhci:fix/combobox-trigger-overflow
May 24, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
vanhci:fix/combobox-trigger-overflow

Conversation

@vanhci

@vanhci vanhci commented May 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix ComboboxTrigger overflow on the Citations page. When a long prompt is selected, the Prompt dropdown grows past its intended width and overlaps the adjacent Platform filter.

Root Cause

ComboboxTrigger base styles include w-fit which sizes the trigger to its content, overriding any caller-provided width (e.g. w-56). Combined with whitespace-nowrap, long selected values expand the trigger indefinitely.

The sibling SelectTrigger avoids this because SelectValue has line-clamp-1 — but ComboboxValue has no equivalent truncation.

Fix

In web/src/components/ui/combobox.tsx:

  • Remove w-fit from the base trigger className so caller-provided widths are respected
  • Add min-w-0 to allow the flex child to shrink below content size
  • Replace whitespace-nowrap with truncate (which includes overflow: hidden, text-overflow: ellipsis, and white-space: nowrap)

Acceptance Criteria

  • Selecting any prompt (including long ones) keeps the Prompt control at its set width (w-56)
  • Long selected prompt text clips with an ellipsis
  • No overlap with the Platform filter at any prompt length / viewport width
  • Other Combobox usages still render correctly (only one usage — citations page)

Testing

This is a CSS-only change to a shared UI component. Verified by inspecting the diff against the only ComboboxTrigger usage (citations/page.tsx:519).

Fixes #84

…lues

Remove w-fit from ComboboxTrigger base styles so a caller-provided width
(e.g. w-56) is not overridden. Add min-w-0 and text overflow ellipsis so
long selected values clip instead of expanding past the trigger bounds.

Fixes #84

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Welcome to Ansvisor, and thank you for your first PR! A maintainer will be by soon to review.

In the meantime, two things that make review faster:

  • A short description of why the change matters, not just what it does — most of our PRs link a Fixes #... to the issue that explains the why.
  • A quick local test note if there's anything worth eyeballing in the browser.

If you'd like to keep an eye on where Ansvisor goes next, a ⭐ on the repo helps others discover it (and Watch sends you a ping when related issues land). Either way — looking forward to your next one.

@gkhngyk
gkhngyk merged commit cfc0c43 into ansvisor:main May 24, 2026
1 check passed
@gkhngyk gkhngyk mentioned this pull request May 26, 2026
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.

Citations: selecting a prompt widens the Prompt dropdown and overlaps the Platform filter

2 participants