@@ -35,9 +35,8 @@ import { V4Badge } from "../V4Badge";
3535import { type SideMenuEnvironment , type SideMenuProject } from "./SideMenu" ;
3636import { Badge } from "../primitives/Badge" ;
3737
38- // Size this Env popover's items to match the Project popover menu items
39- // (SIDE_MENU_POPOVER_ITEM_* in SideMenu.tsx). Applied only at these call sites so the
40- // shared EnvironmentLabel/EnvironmentCombo defaults used elsewhere in the app stay unchanged.
38+ // Size this Env popover's items to match the Project popover (SIDE_MENU_POPOVER_ITEM_* in
39+ // SideMenu.tsx). Only at these call sites, so shared EnvironmentLabel/EnvironmentCombo defaults stay.
4140const ENV_POPOVER_ITEM_ICON = "size-5" ;
4241const ENV_POPOVER_ITEM_LABEL = "text-[0.90625rem] font-medium tracking-[-0.01em]" ;
4342
@@ -83,23 +82,17 @@ export function EnvironmentSelector({
8382 < PopoverTrigger
8483 className = { cn (
8584 "group flex h-8 items-center rounded pl-1.75 hover:bg-background-hover focus-custom" ,
86- // The expanded row arrangement applies while dragging too — the resting classes only
87- // flip on release, and the label reveal mid-drag needs the expanded layout.
85+ // Expanded arrangement also applies mid-drag (resting classes flip only on release).
8886 isDragging || ! isCollapsed ? "justify-between pr-1" : "justify-center pr-0.5" ,
8987 className
9088 ) }
9189 >
9290 < span className = "flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden" >
9391 < EnvironmentIcon environment = { environment } className = "size-5 shrink-0" />
9492 { /*
95- Opacity is driven by the resizable SideMenu's `--sm-label-opacity` variable so the
96- label fades frame-by-frame in both directions (gating on isCollapsed, which only flips
97- on release, made the label pop in after a drag-open). The max-width cap is generous
98- (far wider than any env name) so the visible fade is driven purely by opacity — the
99- text stays full and fades out in place instead of truncating as the row narrows —
100- while still reaching 0 as the label finishes fading so it never holds layout width.
101- Unset in the other places this selector is used (blank-state panels, Limits page)
102- → falls back to fully visible.
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.
10396 */ }
10497 < span
10598 className = "flex min-w-0 items-center overflow-hidden"
@@ -117,9 +110,8 @@ export function EnvironmentSelector({
117110 </ span >
118111 </ span >
119112 { /*
120- The chevron's 16px of width follows the SideMenu drag variable (falls back to full
121- width elsewhere): an invisible span that holds its width mid-drag pushes the row's
122- clip edge into the environment icon.
113+ Chevron's 16px width follows --sm-label-opacity so an invisible span never holds width
114+ mid-drag and pushes the row's clip edge into the icon.
123115 */ }
124116 < span
125117 className = "overflow-hidden opacity-0 group-hover:opacity-100"
@@ -132,9 +124,8 @@ export function EnvironmentSelector({
132124 content = { `${ environmentFullTitle ( environment ) } environment` }
133125 side = "right"
134126 sideOffset = { 8 }
135- // Only surface the tooltip on the collapsed rail (instant), matching the Org and Project
136- // selectors: when expanded the label is already visible, and this selector is also reused
137- // outside the side menu (blank-state panels, Limits page) where a hover tooltip is unwanted.
127+ // Tooltip only on the collapsed rail (expanded shows the label; this selector is also reused
128+ // outside the side menu, where a hover tooltip is unwanted).
138129 hidden = { ! isCollapsed }
139130 delayDuration = { 0 }
140131 buttonClassName = "h-8!"
@@ -316,9 +307,8 @@ function Branches({
316307}
317308
318309/**
319- * The inner content of the branches popover (branch list, empty states, and the
320- * "Manage branches" footer). Shared by the dropdown's hover submenu (`Branches`)
321- * and the side-menu segmented control's Preview popover.
310+ * Inner content of the branches popover (list, empty states, "Manage branches" footer). Shared by
311+ * the `Branches` hover submenu and the side-menu Preview popover.
322312 */
323313export function BranchesPopoverContent ( {
324314 parentEnvironment,
@@ -342,10 +332,8 @@ export function BranchesPopoverContent({
342332 ? "no-active-branches"
343333 : "has-branches" ;
344334
345- // Only surface the active environment's archived-branch item in the submenu it
346- // actually belongs to. Both Development and Preview render this component, so
347- // without the parent check an archived dev branch would leak into the Preview
348- // submenu (and vice-versa).
335+ // Show the archived-branch item only in the submenu it belongs to: both Development and Preview
336+ // render this, so without the parent check an archived dev branch leaks into Preview (and vice-versa).
349337 const currentBranchIsArchived =
350338 environment . archivedAt !== null && environment . parentEnvironmentId === parentEnvironment . id ;
351339
0 commit comments