Skip to content

Commit 0645834

Browse files
committed
feat(webapp): match the environment selector popover item sizing to the project menu
Bump the Env popover's item icons (size-5) and labels (text-[0.90625rem]) to match the Project popover, including the preview/dev branch submenu, its branch list, and the "Manage branches" footer. Applied only at these call sites so the shared EnvironmentLabel/EnvironmentCombo defaults used across the app are unchanged.
1 parent 347fabe commit 0645834

2 files changed

Lines changed: 43 additions & 12 deletions

File tree

.server-changes/side-menu-project-and-org-menus.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Restructure the side menu's top-left and project/organization navigation:
1414
connections, Roles, SSO, Vercel integration, Slack integration, Switch
1515
organization, then Account and Logout) using the same icons and links as the
1616
organization settings side menu.
17+
- Match the Environment selector popover's item sizing (icons and labels,
18+
including the branch submenu and its footer) to the Project popover so the two
19+
side-menu menus are visually consistent.
1720

1821
The org loader now exposes whether the RBAC and SSO plugins are installed so the
1922
side menu can gate the Roles and SSO items the same way the settings side menu

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

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ import { V4Badge } from "../V4Badge";
3535
import { type SideMenuEnvironment, type SideMenuProject } from "./SideMenu";
3636
import { 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.
41+
const ENV_POPOVER_ITEM_ICON = "size-5";
42+
const ENV_POPOVER_ITEM_LABEL = "text-[0.90625rem] font-medium tracking-[-0.01em]";
43+
3844
export function EnvironmentSelector({
3945
organization,
4046
project,
@@ -135,7 +141,13 @@ export function EnvironmentSelector({
135141
<PopoverMenuItem
136142
key={env.id}
137143
to={urlForEnvironment(env)}
138-
title={<EnvironmentCombo environment={env} className="mx-auto grow text-2sm" />}
144+
title={
145+
<EnvironmentCombo
146+
environment={env}
147+
className={cn("mx-auto grow", ENV_POPOVER_ITEM_LABEL)}
148+
iconClassName={ENV_POPOVER_ITEM_ICON}
149+
/>
150+
}
139151
isSelected={env.id === environment.id}
140152
/>
141153
);
@@ -153,8 +165,12 @@ export function EnvironmentSelector({
153165
)}
154166
title={
155167
<div className="flex w-full items-center justify-between">
156-
<EnvironmentCombo environment={{ type: "STAGING" }} className="text-2sm" />
157-
<span className="text-indigo-500">Upgrade</span>
168+
<EnvironmentCombo
169+
environment={{ type: "STAGING" }}
170+
className={ENV_POPOVER_ITEM_LABEL}
171+
iconClassName={ENV_POPOVER_ITEM_ICON}
172+
/>
173+
<span className={cn("text-indigo-500", ENV_POPOVER_ITEM_LABEL)}>Upgrade</span>
158174
</div>
159175
}
160176
isSelected={false}
@@ -167,8 +183,12 @@ export function EnvironmentSelector({
167183
)}
168184
title={
169185
<div className="flex w-full items-center justify-between">
170-
<EnvironmentCombo environment={{ type: "PREVIEW" }} className="text-2sm" />
171-
<span className="text-indigo-500">Upgrade</span>
186+
<EnvironmentCombo
187+
environment={{ type: "PREVIEW" }}
188+
className={ENV_POPOVER_ITEM_LABEL}
189+
iconClassName={ENV_POPOVER_ITEM_ICON}
190+
/>
191+
<span className={cn("text-indigo-500", ENV_POPOVER_ITEM_LABEL)}>Upgrade</span>
172192
</div>
173193
}
174194
isSelected={false}
@@ -233,7 +253,11 @@ function Branches({
233253
textAlignLeft
234254
fullWidth
235255
>
236-
<EnvironmentCombo environment={parentEnvironment} className="mx-auto grow text-2sm" />
256+
<EnvironmentCombo
257+
environment={parentEnvironment}
258+
className={cn("mx-auto grow", ENV_POPOVER_ITEM_LABEL)}
259+
iconClassName={ENV_POPOVER_ITEM_ICON}
260+
/>
237261
</ButtonContent>
238262
</PopoverTrigger>
239263
<PopoverContent
@@ -302,14 +326,16 @@ export function BranchesPopoverContent({
302326
to={urlForEnvironment(environment)}
303327
title={
304328
<>
305-
<span className={cn("block w-full", envTextClassName)}>
329+
<span className={cn("block w-full", envTextClassName, ENV_POPOVER_ITEM_LABEL)}>
306330
{environment.branchName}
307331
</span>
308332
<Badge variant="extra-small">Archived</Badge>
309333
</>
310334
}
311335
icon={
312-
<BranchEnvironmentIconSmall className={cn("size-4 shrink-0", envTextClassName)} />
336+
<BranchEnvironmentIconSmall
337+
className={cn(ENV_POPOVER_ITEM_ICON, "shrink-0", envTextClassName)}
338+
/>
313339
}
314340
isSelected={environment.id === currentEnvironment.id}
315341
/>
@@ -323,13 +349,13 @@ export function BranchesPopoverContent({
323349
key={env.id}
324350
to={urlForEnvironment(env)}
325351
title={
326-
<span className={cn("block w-full", envTextClassName)}>
352+
<span className={cn("block w-full", envTextClassName, ENV_POPOVER_ITEM_LABEL)}>
327353
{env.branchName ?? DEFAULT_DEV_BRANCH}
328354
</span>
329355
}
330356
icon={
331357
<BranchEnvironmentIconSmall
332-
className={cn("size-4 shrink-0", envTextClassName)}
358+
className={cn(ENV_POPOVER_ITEM_ICON, "shrink-0", envTextClassName)}
333359
/>
334360
}
335361
isSelected={env.id === currentEnvironment.id}
@@ -362,15 +388,17 @@ export function BranchesPopoverContent({
362388
<PopoverMenuItem
363389
to={branchesDevPath(organization, project, environment)}
364390
title="Manage dev branches"
365-
icon={<Cog8ToothIcon className="size-4 text-text-dimmed" />}
391+
icon={<Cog8ToothIcon className={cn(ENV_POPOVER_ITEM_ICON, "text-text-dimmed")} />}
366392
leadingIconClassName="text-text-dimmed"
393+
className={ENV_POPOVER_ITEM_LABEL}
367394
/>
368395
) : (
369396
<PopoverMenuItem
370397
to={branchesPath(organization, project, environment)}
371398
title="Manage preview branches"
372-
icon={<Cog8ToothIcon className="size-4 text-text-dimmed" />}
399+
icon={<Cog8ToothIcon className={cn(ENV_POPOVER_ITEM_ICON, "text-text-dimmed")} />}
373400
leadingIconClassName="text-text-dimmed"
401+
className={ENV_POPOVER_ITEM_LABEL}
374402
/>
375403
)}
376404
</div>

0 commit comments

Comments
 (0)