Skip to content

Commit 9bf0c0e

Browse files
committed
fix(web): constrain branch toolbar context
1 parent 200fa82 commit 9bf0c0e

3 files changed

Lines changed: 20 additions & 10 deletions

File tree

‎apps/web/src/components/BranchToolbar.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ export const BranchToolbar = memo(function BranchToolbar({
321321
onUsePreviousWorktree={onUsePreviousWorktree}
322322
/>
323323
) : (
324-
<div className="flex min-w-0 shrink-0 items-center gap-1">
324+
<div className="flex min-w-0 flex-1 items-center gap-1">
325325
{showEnvironmentIndicator && availableEnvironments && (
326326
<>
327327
<BranchToolbarEnvironmentSelector

‎apps/web/src/components/BranchToolbarEnvModeSelector.tsx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const BranchToolbarEnvModeSelector = memo(function BranchToolbarEnvModeSe
5050

5151
if (envLocked) {
5252
return (
53-
<span className="inline-flex items-center gap-1 border border-transparent px-[calc(--spacing(3)-1px)] text-sm font-medium text-muted-foreground/70 sm:text-xs">
53+
<span className="inline-flex shrink-0 items-center gap-1 border border-transparent px-[calc(--spacing(3)-1px)] text-sm font-medium text-muted-foreground/70 sm:text-xs">
5454
{activeWorktreePath ? (
5555
<>
5656
<FolderGitIcon className="size-3" />
@@ -79,7 +79,12 @@ export const BranchToolbarEnvModeSelector = memo(function BranchToolbarEnvModeSe
7979
}}
8080
items={envModeItems}
8181
>
82-
<SelectTrigger variant="ghost" size="xs" className="font-medium" aria-label="Workspace">
82+
<SelectTrigger
83+
variant="ghost"
84+
size="xs"
85+
className="shrink-0 font-medium"
86+
aria-label="Workspace"
87+
>
8388
{effectiveEnvMode === "worktree" ? (
8489
<FolderGit2Icon className="size-3" />
8590
) : activeWorktreePath ? (

‎apps/web/src/components/BranchToolbarEnvironmentSelector.tsx‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvir
4343

4444
if (envLocked || onEnvironmentChange === undefined) {
4545
return (
46-
<span className="inline-flex items-center gap-1 border border-transparent px-[calc(--spacing(3)-1px)] text-sm font-medium text-muted-foreground/70 sm:text-xs">
46+
<span className="inline-flex min-w-0 max-w-full items-center gap-1 border border-transparent px-[calc(--spacing(3)-1px)] text-sm font-medium text-muted-foreground/70 sm:text-xs">
4747
{activeEnvironment?.isPrimary ? (
48-
<MonitorIcon className="size-3" />
48+
<MonitorIcon className="size-3 shrink-0" />
4949
) : (
50-
<CloudIcon className="size-3" />
50+
<CloudIcon className="size-3 shrink-0" />
5151
)}
52-
{activeEnvironment?.label ?? "Run on"}
52+
<span className="truncate">{activeEnvironment?.label ?? "Run on"}</span>
5353
</span>
5454
);
5555
}
@@ -61,11 +61,16 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvir
6161
onValueChange={(value) => onEnvironmentChange(value as EnvironmentId)}
6262
items={environmentItems}
6363
>
64-
<SelectTrigger variant="ghost" size="xs" className="font-medium" aria-label="Run on">
64+
<SelectTrigger
65+
variant="ghost"
66+
size="xs"
67+
className="min-w-0 max-w-full font-medium"
68+
aria-label="Run on"
69+
>
6570
{activeEnvironment?.isPrimary ? (
66-
<MonitorIcon className="size-3" />
71+
<MonitorIcon className="size-3 shrink-0" />
6772
) : (
68-
<CloudIcon className="size-3" />
73+
<CloudIcon className="size-3 shrink-0" />
6974
)}
7075
<SelectValue />
7176
</SelectTrigger>

0 commit comments

Comments
 (0)