Skip to content

fix(ui): truncate long team names in the models table team dropdown - #34689

Merged
yuneng-berri merged 2 commits into
litellm_internal_stagingfrom
litellm_/model-table-dropdown-truncate-2b2a3f
Jul 27, 2026
Merged

fix(ui): truncate long team names in the models table team dropdown#34689
yuneng-berri merged 2 commits into
litellm_internal_stagingfrom
litellm_/model-table-dropdown-truncate-2b2a3f

Conversation

@yuneng-berri

@yuneng-berri yuneng-berri commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Team dropdown options are sliced mid-character, not truncated
  • Teams with no alias show a 36-char id, so most options were unreadable
  • 54 of 133 option labels overflowed the dropdown on a real proxy

How it solves it:

  • Clears min-width: auto off Base UI's text wrapper so the row can size it
  • Truncates the label with an ellipsis and keeps the full value on hover

Relevant issues

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

Captured against a live proxy holding 133 real teams, driven with Playwright: real login, real click on the Team trigger, no DOM manipulation. Viewport 1280x720

Before (commit 215f05588d, tip of litellm_internal_staging at the time)

image

After (commit 55ff0e10eb)

image

Layout measured in the same runs, reading clientWidth / scrollWidth off each option label:

Option label Before After
2dfbd3b5-d15c-4e67-9bf8-20dfb57bb474 284px wide, not ellipsised 121px wide, ellipsised
2d57298b-af80-460f-93d2-939cfaaa5fc0 282px wide, not ellipsised 121px wide, ellipsised
120014f3-cffa-431f-a42d-d99f74b288c2 272px wide, not ellipsised 121px wide, ellipsised
Personal (short, control) 58px, untouched 58px, untouched

Labels escaping the 161px popup: 54 of 133 before, 0 of 133 after. Computed style on the label goes from text-overflow: clip; overflow: visible to text-overflow: ellipsis; overflow: hidden

To reproduce by hand: open the dashboard at /ui/?page=models, All Models tab, and click the Team pill in the table toolbar. Any team without a team_alias shows its id, which is what overflows

Type

🐛 Bug Fix

Changes

The dropdown popup is pinned to the trigger width by w-(--anchor-width) and clips its overflow with overflow-x: hidden. Inside it, Base UI's ItemText wrapper is flex-1 shrink-0 with min-width: auto, which resolves to the min-content width of nowrap text; a 36-char team id measures 284px and the wrapper sizes itself to that, overflowing the 161px popup and getting clipped at the edge. Nothing in the chain ever gave the text a box smaller than itself, so no ellipsis could appear

The fix clears min-width: auto off that wrapper from the call site so the row's own width governs it, then truncates the label and keeps the full value in a title so a truncated id is still recoverable on hover

Worth flagging for the reviewer: this is a call-site fix for a gap in the shared Select primitive. SelectItem renders its text through a wrapper that can never shrink, so every long-labelled select in the dashboard has the same latent behaviour. Fixing it in components/ui/select.tsx would cover all of them at once, but that file is shadcn-CLI-managed and the change would touch every select in the app, so it belongs in its own PR rather than riding along with this one

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

The Team dropdown popup is pinned to the trigger width via
w-(--anchor-width) and clips its overflow, while Base UI's ItemText
wrapper is flex-1 shrink-0 with min-width: auto, so it sizes itself to
the full nowrap label and simply overflows the popup. Teams without a
team_alias render their 36-char id, so those options were sliced
mid-character with no ellipsis.

Clears min-width: auto off the text wrapper and truncates the label at
the call site. The underlying gap is in the shared Select primitive,
which any long-labelled select in the dashboard will hit; that is left
for a separate change.
@greptile-apps

greptile-apps Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes long team-option labels in the models table dropdown.

  • Allows the shared select text wrapper to shrink within the popup.
  • Truncates overflowing labels with an ellipsis while exposing the full label on hover.
  • Adds a focused regression test covering the applied truncation classes and title attribute.

Confidence Score: 5/5

The PR appears safe to merge, with the dropdown truncation change isolated to team-option presentation.

The changed markup allows the flex text wrapper and label to shrink within the anchored popup, applies overflow truncation, and preserves access to the complete label through the title attribute.

Important Files Changed

Filename Overview
ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTable.tsx Adds shrinkable, truncated team-option labels with full text available through the title attribute; no actionable defect identified.
ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTable.test.tsx Adds focused coverage for the long-label markup, truncation classes, and hover text without weakening existing assertions.

Reviews (1): Last reviewed commit: "Merge branch 'litellm_internal_staging' ..." | Re-trigger Greptile

@yuneng-berri
yuneng-berri enabled auto-merge July 27, 2026 16:46
@yuneng-berri
yuneng-berri merged commit 2f2e1e7 into litellm_internal_staging Jul 27, 2026
73 of 74 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_/model-table-dropdown-truncate-2b2a3f branch July 27, 2026 16:54
stvnksslr pushed a commit to stvnksslr/litellm that referenced this pull request Aug 3, 2026
…opdown-truncate-2b2a3f

fix(ui): truncate long team names in the models table team dropdown

(cherry picked from commit 2f2e1e7)
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.

2 participants