Skip to content

Commit e5a3c0d

Browse files
committed
fix(webapp): cap the env selector label width when reused outside the side menu
The selector is reused in the blank-state panels and the limits page, where --sm-label-opacity is unset. Its label max-width now falls back to a ~200px cap in those contexts so long environment names truncate instead of widening the control, matching the previous behavior.
1 parent 5ac7532 commit e5a3c0d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

apps/webapp/app/components/navigation/EnvironmentSelector.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,16 @@ export function EnvironmentSelector({
9090
<span className="flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden">
9191
<EnvironmentIcon environment={environment} className="size-5 shrink-0" />
9292
{/*
93-
Opacity follows --sm-label-opacity to fade both directions without popping in on
94-
drag-open; the generous max-width cap fades the text in place (not truncated) but
95-
scales to 0 so it never holds width. Unset elsewhere → fully visible.
93+
In the side menu, opacity + max-width follow --sm-label-opacity (1 → 0): the label
94+
fades in place and scales its width to 0 so it never holds width mid-drag. The
95+
selector is also reused outside the side menu (BlankStatePanels, limits) where the var
96+
is unset — the 0.2 max-width fallback pins a ~200px cap (0.2 * 1000px) so long names
97+
ellipsis-truncate there instead of widening the control, while opacity stays 1.
9698
*/}
9799
<span
98100
className="flex min-w-0 items-center overflow-hidden"
99101
style={{
100-
maxWidth: "calc(var(--sm-label-opacity, 1) * 1000px)",
102+
maxWidth: "calc(var(--sm-label-opacity, 0.2) * 1000px)",
101103
opacity: "var(--sm-label-opacity, 1)",
102104
}}
103105
>

0 commit comments

Comments
 (0)