Skip to content

Commit 6ff2016

Browse files
t3dotggclaude
andcommitted
fix(web): machine label no longer shifts between one and many machines
Small composer controls pulled their icon 2px into the padding, but the locked single-machine label did not, so the label moved when a project gained a second machine. Below sm the font size also differed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent ffaa1db commit 6ff2016

4 files changed

Lines changed: 7 additions & 11 deletions

File tree

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,7 @@ const RunContextSelector = memo(function RunContextSelector({
214214
const workspaceIcon = (
215215
<Tooltip>
216216
<TooltipTrigger render={<span className="inline-flex shrink-0" />}>
217-
<WorkspaceIcon
218-
className={isPanel ? THREAD_DETAILS_PANEL_ICON_CLASS : "size-3 shrink-0 mx-0!"}
219-
/>
217+
<WorkspaceIcon className={isPanel ? THREAD_DETAILS_PANEL_ICON_CLASS : "size-3 shrink-0"} />
220218
</TooltipTrigger>
221219
<TooltipPopup>
222220
{isPanel
@@ -232,17 +230,15 @@ const RunContextSelector = memo(function RunContextSelector({
232230
<TooltipTrigger render={<span className="inline-flex shrink-0" />}>
233231
{autoEnvironmentLabel ? (
234232
<ScaleIcon
235-
className={isPanel ? THREAD_DETAILS_PANEL_ICON_CLASS : "size-3 shrink-0 mx-0!"}
233+
className={isPanel ? THREAD_DETAILS_PANEL_ICON_CLASS : "size-3 shrink-0"}
236234
aria-hidden="true"
237235
/>
238236
) : (
239237
<EnvironmentMachineIcon
240238
kind={activeEnvironment?.machine ?? "server"}
241239
// Wide machine glyphs need a little more box to match the square row icons.
242240
className={
243-
isPanel
244-
? cn(THREAD_DETAILS_PANEL_ICON_CLASS, "-mx-px size-4.5")
245-
: "size-3 shrink-0 mx-0!"
241+
isPanel ? cn(THREAD_DETAILS_PANEL_ICON_CLASS, "-mx-px size-4.5") : "size-3 shrink-0"
246242
}
247243
/>
248244
)}
@@ -267,7 +263,7 @@ const RunContextSelector = memo(function RunContextSelector({
267263
return (
268264
<span
269265
className={cn(
270-
"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",
266+
"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",
271267
isPanel && "max-w-full",
272268
isPanel && THREAD_DETAILS_PANEL_LOCKED_ROW_CLASS,
273269
)}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const BranchToolbarEnvModeSelector = memo(function BranchToolbarEnvModeSe
7373
if (envLocked || forceNewWorktree) {
7474
const lockedRow = (
7575
<span
76-
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"
76+
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"
7777
data-composer-context-control
7878
>
7979
{activeWorktreePath ? (

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvir
6868
if (envLocked || (onEnvironmentChange === undefined && onAddToMachine === undefined)) {
6969
const lockedRow = (
7070
<span
71-
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"
71+
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"
7272
data-composer-context-control
7373
>
7474
<EnvironmentMachineIcon

‎apps/web/src/components/chat/ComposerControl.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function composerControlClassName(size: ComposerControlSize, className?: string)
1212
"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",
1313
"[&_: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",
1414
size === "xs"
15-
? "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"
15+
? "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"
1616
: "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",
1717
"aria-pressed:bg-accent aria-pressed:text-accent-foreground aria-pressed:hover:bg-accent/80",
1818
className,

0 commit comments

Comments
 (0)