Added an useKey hook and implemented the default actions (Space: Reveal -> Remembered) and 1/2 for the list of actions (Forgotten and Remembered for now).
Currently there is no hint for the shortcuts. I think we could show it while hovering the buttons.
Also, noticed there is logic for pendingOutcomeChange which is called when the user is interacting with one of the actions. Should we call pendingOutcomeChange on keydown and only call the handlers on keyup to make use of this API? If yes, we should probably move the shortcut handling logic inside Button.tsx.
Note: Storybook focuses the sidebar when pressing 1 (just keep that in mind while testing).
Added an
useKey
hook and implemented the default actions (Space: Reveal -> Remembered) and 1/2 for the list of actions (Forgotten and Remembered for now).Currently there is no hint for the shortcuts. I think we could show it while hovering the buttons.
Also, noticed there is logic for
pendingOutcomeChange
which is called when the user is interacting with one of the actions. Should we callpendingOutcomeChange
onkeydown
and only call the handlers onkeyup
to make use of this API? If yes, we should probably move the shortcut handling logic insideButton.tsx
.165