Skip to content

Commit 70bdbc3

Browse files
jeprecatedclaude
andauthored
fix(web): composer host and workspace tooltips show their shortcuts (pingdotgg#21167)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent c32dc2f commit 70bdbc3

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ import {
2020
SelectValue,
2121
} from "./ui/select";
2222
import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";
23+
import { useAtomValue } from "@effect/atom-react";
24+
import { shortcutLabelForCommand } from "../keybindings";
25+
import { primaryServerKeybindingsAtom } from "../state/server";
2326

2427
const PREVIOUS_WORKTREE_SELECT_VALUE = "previous-worktree";
2528

@@ -45,6 +48,10 @@ export const BranchToolbarEnvModeSelector = memo(function BranchToolbarEnvModeSe
4548
onUsePreviousWorktree,
4649
}: BranchToolbarEnvModeSelectorProps) {
4750
const composerFloatingLayerProps = useComposerMenuProps();
51+
const shortcutLabel = shortcutLabelForCommand(
52+
useAtomValue(primaryServerKeybindingsAtom),
53+
"composer.workspace",
54+
);
4855
const showPreviousWorktree = Boolean(previousWorktreeLabel && onUsePreviousWorktree);
4956
const envModeItems = [
5057
{
@@ -137,6 +144,7 @@ export const BranchToolbarEnvModeSelector = memo(function BranchToolbarEnvModeSe
137144
{effectiveEnvMode === "worktree"
138145
? resolveEnvModeLabel("worktree")
139146
: resolveCurrentWorkspaceLabel(activeWorktreePath)}
147+
{shortcutLabel ? ` · ${shortcutLabel}` : null}
140148
</TooltipPopup>
141149
</Tooltip>
142150
<SelectPopup

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { ComposerSelectControl } from "./chat/ComposerControl";
22
import { ComposerContextLabel } from "./ComposerContextLabel";
33
import { Tooltip, TooltipTrigger, TooltipPopup } from "./ui/tooltip";
4+
import { useAtomValue } from "@effect/atom-react";
5+
import { shortcutLabelForCommand } from "../keybindings";
6+
import { primaryServerKeybindingsAtom } from "../state/server";
47
import type { EnvironmentId } from "@t3tools/contracts";
58
import { ScaleIcon } from "lucide-react";
69
import { memo } from "react";
@@ -35,6 +38,10 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvir
3538
onEnvironmentChange,
3639
}: BranchToolbarEnvironmentSelectorProps) {
3740
const composerFloatingLayerProps = useComposerMenuProps();
41+
const shortcutLabel = shortcutLabelForCommand(
42+
useAtomValue(primaryServerKeybindingsAtom),
43+
"composer.host",
44+
);
3845
const activeEnvironment =
3946
availableEnvironments.find((env) => env.environmentId === environmentId) ?? null;
4047

@@ -107,7 +114,10 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvir
107114
<SelectValue />
108115
</ComposerContextLabel>
109116
</TooltipTrigger>
110-
<TooltipPopup>{autoEnvironmentLabel ?? activeEnvironment?.label ?? "Run on"}</TooltipPopup>
117+
<TooltipPopup>
118+
{autoEnvironmentLabel ?? activeEnvironment?.label ?? "Run on"}
119+
{shortcutLabel ? ` · ${shortcutLabel}` : null}
120+
</TooltipPopup>
111121
</Tooltip>
112122
<SelectPopup alignItemWithTrigger={false} {...composerFloatingLayerProps}>
113123
<SelectGroup>

0 commit comments

Comments
 (0)