|
1 | 1 | import { ComposerSelectControl } from "./chat/ComposerControl"; |
2 | 2 | import { ComposerContextLabel } from "./ComposerContextLabel"; |
3 | 3 | 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"; |
4 | 7 | import type { EnvironmentId } from "@t3tools/contracts"; |
5 | 8 | import { ScaleIcon } from "lucide-react"; |
6 | 9 | import { memo } from "react"; |
@@ -35,6 +38,10 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvir |
35 | 38 | onEnvironmentChange, |
36 | 39 | }: BranchToolbarEnvironmentSelectorProps) { |
37 | 40 | const composerFloatingLayerProps = useComposerMenuProps(); |
| 41 | + const shortcutLabel = shortcutLabelForCommand( |
| 42 | + useAtomValue(primaryServerKeybindingsAtom), |
| 43 | + "composer.host", |
| 44 | + ); |
38 | 45 | const activeEnvironment = |
39 | 46 | availableEnvironments.find((env) => env.environmentId === environmentId) ?? null; |
40 | 47 |
|
@@ -107,7 +114,10 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvir |
107 | 114 | <SelectValue /> |
108 | 115 | </ComposerContextLabel> |
109 | 116 | </TooltipTrigger> |
110 | | - <TooltipPopup>{autoEnvironmentLabel ?? activeEnvironment?.label ?? "Run on"}</TooltipPopup> |
| 117 | + <TooltipPopup> |
| 118 | + {autoEnvironmentLabel ?? activeEnvironment?.label ?? "Run on"} |
| 119 | + {shortcutLabel ? ` · ${shortcutLabel}` : null} |
| 120 | + </TooltipPopup> |
111 | 121 | </Tooltip> |
112 | 122 | <SelectPopup alignItemWithTrigger={false} {...composerFloatingLayerProps}> |
113 | 123 | <SelectGroup> |
|
0 commit comments