From bb6e7215672ac1dabfd69501149fc3ce6ff25da0 Mon Sep 17 00:00:00 2001 From: User Date: Wed, 11 Mar 2026 15:32:39 -0400 Subject: [PATCH] fix: remove Cmd+1..9 company-switch shortcut This shortcut interfered with browser tab-switching (Cmd+1..9) and produced a black screen when used. Removes the handler, the Layout callback, and the design-guide documentation entry. Closes RUS-56 --- ui/src/components/Layout.tsx | 11 ----------- ui/src/hooks/useKeyboardShortcuts.ts | 12 ++---------- ui/src/pages/DesignGuide.tsx | 2 +- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/ui/src/components/Layout.tsx b/ui/src/components/Layout.tsx index 9af35ada..e12e6717 100644 --- a/ui/src/components/Layout.tsx +++ b/ui/src/components/Layout.tsx @@ -104,23 +104,12 @@ export function Layout() { const togglePanel = togglePanelVisible; - // Cmd+1..9 to switch companies - const switchCompany = useCallback( - (index: number) => { - if (index < companies.length) { - setSelectedCompanyId(companies[index]!.id); - } - }, - [companies, setSelectedCompanyId], - ); - useCompanyPageMemory(); useKeyboardShortcuts({ onNewIssue: () => openNewIssue(), onToggleSidebar: toggleSidebar, onTogglePanel: togglePanel, - onSwitchCompany: switchCompany, }); useEffect(() => { diff --git a/ui/src/hooks/useKeyboardShortcuts.ts b/ui/src/hooks/useKeyboardShortcuts.ts index f12c9f3e..6120da80 100644 --- a/ui/src/hooks/useKeyboardShortcuts.ts +++ b/ui/src/hooks/useKeyboardShortcuts.ts @@ -4,10 +4,9 @@ interface ShortcutHandlers { onNewIssue?: () => void; onToggleSidebar?: () => void; onTogglePanel?: () => void; - onSwitchCompany?: (index: number) => void; } -export function useKeyboardShortcuts({ onNewIssue, onToggleSidebar, onTogglePanel, onSwitchCompany }: ShortcutHandlers) { +export function useKeyboardShortcuts({ onNewIssue, onToggleSidebar, onTogglePanel }: ShortcutHandlers) { useEffect(() => { function handleKeyDown(e: KeyboardEvent) { // Don't fire shortcuts when typing in inputs @@ -16,13 +15,6 @@ export function useKeyboardShortcuts({ onNewIssue, onToggleSidebar, onTogglePane return; } - // Cmd+1..9 → Switch company - if ((e.metaKey || e.ctrlKey) && e.key >= "1" && e.key <= "9") { - e.preventDefault(); - onSwitchCompany?.(parseInt(e.key, 10) - 1); - return; - } - // C → New Issue if (e.key === "c" && !e.metaKey && !e.ctrlKey && !e.altKey) { e.preventDefault(); @@ -44,5 +36,5 @@ export function useKeyboardShortcuts({ onNewIssue, onToggleSidebar, onTogglePane document.addEventListener("keydown", handleKeyDown); return () => document.removeEventListener("keydown", handleKeyDown); - }, [onNewIssue, onToggleSidebar, onTogglePanel, onSwitchCompany]); + }, [onNewIssue, onToggleSidebar, onTogglePanel]); } diff --git a/ui/src/pages/DesignGuide.tsx b/ui/src/pages/DesignGuide.tsx index e7ee898d..9d4ab867 100644 --- a/ui/src/pages/DesignGuide.tsx +++ b/ui/src/pages/DesignGuide.tsx @@ -1313,7 +1313,7 @@ export function DesignGuide() { ["C", "New Issue (outside inputs)"], ["[", "Toggle Sidebar"], ["]", "Toggle Properties Panel"], - ["Cmd+1..9 / Ctrl+1..9", "Switch Company (by rail order)"], + ["Cmd+Enter / Ctrl+Enter", "Submit markdown comment"], ].map(([key, desc]) => (