TypeScript
fix(web): machine label no longer shifts between one and many machines (#28070)
Theo Brownea24ec905c815
diff --git a/apps/web/src/components/BranchToolbar.tsx b/apps/web/src/components/BranchToolbar.tsxindex 27639044e75..93249bcf0c9 100644--- a/apps/web/src/components/BranchToolbar.tsx+++ b/apps/web/src/components/BranchToolbar.tsx@@ -214,9 +214,7 @@ const RunContextSelector = memo(function RunContextSelector({const workspaceIcon = (<Tooltip><TooltipTrigger render={<span className="inline-flex shrink-0" />}>- <WorkspaceIcon- className={isPanel ? THREAD_DETAILS_PANEL_ICON_CLASS : "size-3 shrink-0 mx-0!"}- />+ <WorkspaceIcon className={isPanel ? THREAD_DETAILS_PANEL_ICON_CLASS : "size-3 shrink-0"} /></TooltipTrigger><TooltipPopup>{isPanel@@ -232,7 +230,7 @@ const RunContextSelector = memo(function RunContextSelector({<TooltipTrigger render={<span className="inline-flex shrink-0" />}>{autoEnvironmentLabel ? (<ScaleIcon- className={isPanel ? THREAD_DETAILS_PANEL_ICON_CLASS : "size-3 shrink-0 mx-0!"}+ className={isPanel ? THREAD_DETAILS_PANEL_ICON_CLASS : "size-3 shrink-0"}aria-hidden="true"/>) : (@@ -240,9 +238,7 @@ const RunContextSelector = memo(function RunContextSelector({kind={activeEnvironment?.machine ?? "server"}// Wide machine glyphs need a little more box to match the square row icons.className={- isPanel- ? cn(THREAD_DETAILS_PANEL_ICON_CLASS, "-mx-px size-4.5")- : "size-3 shrink-0 mx-0!"+ isPanel ? cn(THREAD_DETAILS_PANEL_ICON_CLASS, "-mx-px size-4.5") : "size-3 shrink-0"}/>)}@@ -267,7 +263,7 @@ const RunContextSelector = memo(function RunContextSelector({return (<spanclassName={cn(- "inline-flex h-7 min-w-0 max-w-[48%] flex-initial items-center justify-start gap-1 rounded-md border border-transparent px-1.75 font-normal text-foreground/70 text-xs sm:h-6 dark:text-muted-foreground",+ "inline-flex h-7 min-w-0 max-w-[48%] flex-initial items-center justify-start gap-1 rounded-md border border-transparent px-1.75 font-normal text-foreground/70 text-sm sm:h-6 sm:text-xs dark:text-muted-foreground",isPanel && "max-w-full",isPanel && THREAD_DETAILS_PANEL_LOCKED_ROW_CLASS,)}diff --git a/apps/web/src/components/BranchToolbarEnvModeSelector.tsx b/apps/web/src/components/BranchToolbarEnvModeSelector.tsxindex 60a9584fe0b..41bd2b008be 100644--- a/apps/web/src/components/BranchToolbarEnvModeSelector.tsx+++ b/apps/web/src/components/BranchToolbarEnvModeSelector.tsx@@ -73,7 +73,7 @@ export const BranchToolbarEnvModeSelector = memo(function BranchToolbarEnvModeSeif (envLocked || forceNewWorktree) {const lockedRow = (<span- className="inline-flex h-7 min-w-0 items-center gap-1 border border-transparent px-1.75 font-normal text-muted-foreground/70 text-xs sm:h-6"+ className="inline-flex h-7 min-w-0 items-center gap-1 border border-transparent px-1.75 font-normal text-muted-foreground/70 text-sm sm:h-6 sm:text-xs"data-composer-context-control>{activeWorktreePath ? (diff --git a/apps/web/src/components/BranchToolbarEnvironmentSelector.tsx b/apps/web/src/components/BranchToolbarEnvironmentSelector.tsxindex 818ff8389be..4dfe1ae50f0 100644--- a/apps/web/src/components/BranchToolbarEnvironmentSelector.tsx+++ b/apps/web/src/components/BranchToolbarEnvironmentSelector.tsx@@ -68,7 +68,7 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvirif (envLocked || (onEnvironmentChange === undefined && onAddToMachine === undefined)) {const lockedRow = (<span- className="inline-flex h-7 min-w-0 max-w-full items-center gap-1 border border-transparent px-1.75 font-normal text-muted-foreground/70 text-xs sm:h-6"+ className="inline-flex h-7 min-w-0 max-w-full items-center gap-1 border border-transparent px-1.75 font-normal text-muted-foreground/70 text-sm sm:h-6 sm:text-xs"data-composer-context-control><EnvironmentMachineIcondiff --git a/apps/web/src/components/chat/ComposerControl.tsx b/apps/web/src/components/chat/ComposerControl.tsxindex 9ec5d4e1144..139e80d081e 100644--- a/apps/web/src/components/chat/ComposerControl.tsx+++ b/apps/web/src/components/chat/ComposerControl.tsx@@ -12,7 +12,7 @@ function composerControlClassName(size: ComposerControlSize, className?: string)"relative inline-flex shrink-0 cursor-pointer items-center justify-center whitespace-nowrap rounded-(--control-radius) border border-transparent text-base outline-none hover:bg-accent data-pressed:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 data-disabled:pointer-events-none data-disabled:opacity-64 pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 [&:active:not([aria-haspopup])]:scale-[0.97] [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:-mx-0.5 [&_svg[data-composer-control-icon]]:mx-0","[&_:is([data-composer-control-label],[data-chat-provider-model-picker-label])]:[text-box:trim-both_cap_alphabetic] supports-[text-box:trim-both_cap_alphabetic]:[&_:is([data-composer-control-label],[data-chat-provider-model-picker-label])]:py-1.5",size === "xs"- ? "h-7 gap-1 px-1.75 font-normal text-foreground/70 text-sm hover:text-foreground dark:text-muted-foreground sm:h-6 sm:text-xs [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5 [&_svg[data-composer-control-chevron]]:ms-0 [&_svg[data-composer-control-chevron]]:-me-1"+ ? "h-7 gap-1 px-1.75 font-normal text-foreground/70 text-sm hover:text-foreground dark:text-muted-foreground sm:h-6 sm:text-xs [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5 [&_svg]:mx-0 [&_svg[data-composer-control-chevron]]:ms-0 [&_svg[data-composer-control-chevron]]:-me-1": "h-7 gap-1.5 px-2 font-medium text-foreground/80 [&_svg:not([class*='text-'])]:text-muted-foreground hover:text-foreground sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4","aria-pressed:bg-accent aria-pressed:text-accent-foreground aria-pressed:hover:bg-accent/80",className,