Repository navigation
Commands with optional shortcuts/hotkeys #119
OliverJAsh
started this conversation in
Ideas
Replies: 1 comment
|
App hotkeys cover the listing part now. They shipped in #175, released in export const appHotkeys = defineAppHotkeys({
'doc.save': { hotkey: 'Mod+S', meta: { name: 'Save' } },
'issue.assign': { hotkey: null, meta: { name: 'Assign to…' } },
})
Running a command from the palette still calls your own function, because app hotkeys don't store callbacks. I'm leaving this open while we think about whether app hotkeys should be runnable by ID. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
A common UX pattern is the "command palette" (
cmd+k). where the listed commands may or may not have associated keyboard shortcuts (see for example Linear, VS Code and Chrome Dev Tools).It seems TanStack Hotkeys is very close to enabling this except for the fact that the primary unit is hotkeys rather than commands, i.e. it's not clear how you would define a command without a shortcut/hotkey.
I almost wonder whether the hook should be
useCommand(with optionalhotkey) instead ofuseHotkey. 🤔Example from Linear. Observe how some commands don't have shortcuts:
All reactions