diff --git a/components/keyboard-shortcuts.tsx b/components/keyboard-shortcuts.tsx index 2bcffb2..19e6977 100644 --- a/components/keyboard-shortcuts.tsx +++ b/components/keyboard-shortcuts.tsx @@ -31,11 +31,17 @@ import { eventBinding, formatBinding, isTypingSurface, + kbdEventForAction, KEYBOARD_ACTIONS, } from "@/src/core"; import { isDictationActive } from "@/components/dictation"; import { useSettingsDialog } from "@/components/settings/settings-dialog.tsx"; +// Re-exported for the contract pin (tests/keyboard-toggle-sidebar.test.ts): +// the dispatcher composes event names through the ONE helper — a second +// spelling here is how the ⌘B bug happened. +export { kbdEventForAction }; + export function KeyboardShortcuts() { const router = useRouter(); const [cheatOpen, setCheatOpen] = useState(false); @@ -109,7 +115,7 @@ export function KeyboardShortcuts() { handlersRef.current.setCheatOpen(true); break; default: - window.dispatchEvent(new CustomEvent(`lh:kbd-${action}`)); + window.dispatchEvent(new CustomEvent(kbdEventForAction(action))); } }; window.addEventListener("keydown", onKeyDown); diff --git a/components/model-picker.tsx b/components/model-picker.tsx index 15d4536..59536d1 100644 --- a/components/model-picker.tsx +++ b/components/model-picker.tsx @@ -277,8 +277,11 @@ export function ModelControl() {