mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 01:35:39 -04:00
Replace keyboard system with TanStack Hotkeys and jotai atoms
Remove react-hotkeys-hook, KeyboardProvider context, useRegisterShortcut wrapper, and KeyboardHelpDialog component. Components now call TanStack useHotkey/useHotkeySequence directly. Shared state uses jotai atoms in lib/atoms/, shortcut metadata lives as a static const in lib/constants/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from "react";
|
||||
import { type ShortcutDef, useKeyboard } from "@/components/keyboard-provider";
|
||||
|
||||
export function useRegisterShortcut(id: string, def: ShortcutDef) {
|
||||
const { registerShortcut, unregisterShortcut } = useKeyboard();
|
||||
|
||||
useEffect(() => {
|
||||
registerShortcut(id, def);
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
return () => unregisterShortcut(id);
|
||||
}, [id, unregisterShortcut]);
|
||||
}
|
||||
Reference in New Issue
Block a user