summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKha Nguyen <hi@khanguyen.com>2025-07-22 19:33:10 -0500
committerKha Nguyen <hi@khanguyen.com>2025-07-22 19:33:10 -0500
commitf6073c47c620deda88affe12a220917a0561e649 (patch)
treec61f55d7aa308bb98030a05d7031a19b45465e4a
parentf98651cd331c0753e9d13015bf07dad8d0c98047 (diff)
downloadopencut-f6073c47c620deda88affe12a220917a0561e649.tar.gz
highlight all keys when editing shorcuts for an action
-rw-r--r--apps/web/src/components/keyboard-shortcuts-help.tsx10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/web/src/components/keyboard-shortcuts-help.tsx b/apps/web/src/components/keyboard-shortcuts-help.tsx
index 8b4c6274..d04b27fa 100644
--- a/apps/web/src/components/keyboard-shortcuts-help.tsx
+++ b/apps/web/src/components/keyboard-shortcuts-help.tsx
@@ -21,11 +21,11 @@ import { toast } from "sonner";
const ShortcutItem = ({
shortcut,
- recordingKey,
+ isRecording,
onStartRecording,
}: {
shortcut: KeyboardShortcut;
- recordingKey: string | null;
+ isRecording: boolean;
onStartRecording: (keyId: string, shortcut: KeyboardShortcut) => void;
}) => {
// Filter out lowercase duplicates for display - if both "j" and "J" exist, only show "J"
@@ -59,7 +59,7 @@ const ShortcutItem = ({
keyId={keyId}
originalKey={key}
shortcut={shortcut}
- isRecording={recordingKey === keyId}
+ isRecording={isRecording}
onStartRecording={() => onStartRecording(keyId, shortcut)}
>
{keyPart}
@@ -234,7 +234,9 @@ export const KeyboardShortcutsHelp = () => {
<ShortcutItem
key={index}
shortcut={shortcut}
- recordingKey={recordingKey}
+ isRecording={
+ shortcut.action === recordingShortcut?.action
+ }
onStartRecording={handleStartRecording}
/>
))}