feat(web): add keyboard shortcuts for tool navigation

Register global keyboard shortcuts: Cmd/Ctrl+K to focus search,
Cmd/Ctrl+/ for tools view, Cmd/Ctrl+Shift+D to toggle theme,
Cmd/Ctrl+Alt+1-8 for quick tool navigation. Uses platform-aware
mod key detection (Cmd on Mac, Ctrl on Windows/Linux).
This commit is contained in:
Siddharth Kumar Sah
2026-03-22 04:42:14 +08:00
parent 0cd3d71a63
commit 939bc2e001
2 changed files with 132 additions and 0 deletions
@@ -0,0 +1,15 @@
import { useKeyboardShortcuts } from "@/hooks/use-keyboard-shortcuts";
/**
* Wrapper that registers global keyboard shortcuts.
* Must be rendered inside a <BrowserRouter> so that
* useNavigate() works inside the hook.
*/
export function KeyboardShortcutProvider({
children,
}: {
children: React.ReactNode;
}) {
useKeyboardShortcuts();
return <>{children}</>;
}