From dda44ed33280106aa46612fd9e1f1475bb5a0712 Mon Sep 17 00:00:00 2001 From: oliver <97427849+flamboh@users.noreply.github.com> Date: Wed, 16 Sep 2026 15:07:08 -0700 Subject: [PATCH] fix(web): show tooltips for composer environment and workspace controls (#11787) --- apps/web/src/components/BranchToolbar.tsx | 34 +++++-- .../BranchToolbarEnvModeSelector.tsx | 96 +++++++++++-------- .../BranchToolbarEnvironmentSelector.tsx | 92 ++++++++++-------- 3 files changed, 132 insertions(+), 90 deletions(-) diff --git a/apps/web/src/components/BranchToolbar.tsx b/apps/web/src/components/BranchToolbar.tsx index d36eabc3cec5578a2782bf743249ea47616c6c06..b2840cfadd0ee177f2efa46009eaccd38c6abfa1 100644 --- a/apps/web/src/components/BranchToolbar.tsx +++ b/apps/web/src/components/BranchToolbar.tsx @@ -53,6 +53,7 @@ import { MenuTrigger, } from "./ui/menu"; import { Separator } from "./ui/separator"; +import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; import { ComposerSurface } from "./chat/ComposerSurface"; import { useComposerMenuProps } from "./chat/composerEventScope"; import { measureRestingComposerControls } from "./chat/restingComposerControlsMeasurement"; @@ -137,22 +138,35 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({ ? resolveEnvModeLabel("worktree") : resolveCurrentWorkspaceLabel(activeWorktreePath); const isLocked = envLocked || envModeLocked; + const workspaceIcon = ( + + }> + + + {workspaceLabel} + + ); const icon = showEnvironmentIndicator ? ( // Button's base styles apply `-mx-0.5` to descendant SVGs, which eats 4px // out of whatever gap we set. mx-0! cancels that so gap-0.5 reads as 2px. - {autoEnvironmentLabel ? ( - ) : ( - + workspaceIcon ); const triggerContent = ( <> diff --git a/apps/web/src/components/BranchToolbarEnvModeSelector.tsx b/apps/web/src/components/BranchToolbarEnvModeSelector.tsx index b29c77cb378d4819ce1aa98e3152333559fc2729..c1c3487dbadcdc519fde11357135a8533333ba75 100644 --- a/apps/web/src/components/BranchToolbarEnvModeSelector.tsx +++ b/apps/web/src/components/BranchToolbarEnvModeSelector.tsx @@ -17,6 +17,7 @@ import { SelectTrigger, SelectValue, } from "./ui/select"; +import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; const PREVIOUS_WORKTREE_SELECT_VALUE = "previous-worktree"; @@ -52,27 +53,31 @@ export const BranchToolbarEnvModeSelector = memo(function BranchToolbarEnvModeSe if (envLocked) { return ( - - {activeWorktreePath ? ( - - ) : ( - - )} - + } + className="inline-flex h-7 min-w-0 items-center gap-1 border border-transparent px-[calc(--spacing(2)-1px)] font-normal text-muted-foreground/70 text-xs sm:h-6" + data-composer-context-control > + {activeWorktreePath ? ( + + ) : ( + + )} - {resolveLockedWorkspaceLabel(activeWorktreePath)} + + {resolveLockedWorkspaceLabel(activeWorktreePath)} + - - + + {resolveLockedWorkspaceLabel(activeWorktreePath)} + ); } @@ -89,33 +94,44 @@ export const BranchToolbarEnvModeSelector = memo(function BranchToolbarEnvModeSe }} items={envModeItems} > - - {effectiveEnvMode === "worktree" ? ( - - ) : activeWorktreePath ? ( - - ) : ( - - )} - + + } > + {effectiveEnvMode === "worktree" ? ( + + ) : activeWorktreePath ? ( + + ) : ( + + )} - + + + - - + + + {effectiveEnvMode === "worktree" + ? resolveEnvModeLabel("worktree") + : resolveCurrentWorkspaceLabel(activeWorktreePath)} + + Workspace diff --git a/apps/web/src/components/BranchToolbarEnvironmentSelector.tsx b/apps/web/src/components/BranchToolbarEnvironmentSelector.tsx index 231e4b0d824d64a9a7624990b3431b05dc321fe5..a29bb92e83d00d5c52a5138a91f121eb3c623c88 100644 --- a/apps/web/src/components/BranchToolbarEnvironmentSelector.tsx +++ b/apps/web/src/components/BranchToolbarEnvironmentSelector.tsx @@ -14,6 +14,7 @@ import { SelectTrigger, SelectValue, } from "./ui/select"; +import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; interface BranchToolbarEnvironmentSelectorProps { autoEnvironmentLabel?: string | undefined; @@ -59,26 +60,30 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvir // only thing in the strip. if (envLocked || onEnvironmentChange === undefined) { return ( - - - + } + className="inline-flex h-7 min-w-0 max-w-full items-center gap-1 border border-transparent px-[calc(--spacing(2)-1px)] font-normal text-muted-foreground/70 text-xs sm:h-6" + data-composer-context-control > + - {activeEnvironment?.label ?? "Run on"} + + {activeEnvironment?.label ?? "Run on"} + - - + + {activeEnvironment?.label ?? "Run on"} + ); } @@ -91,34 +96,41 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvir } items={environmentItems} > - - {autoEnvironmentLabel ? ( - + + {autoEnvironmentLabel ?? activeEnvironment?.label ?? "Run on"} + Run on -- 2.54.0