feat(ux/a11y): visible, labeled command-palette trigger in the sidebar

A ⌘K palette with no visible entry point is itself a discoverability +
a11y gap (keyboard/SR users can't find it). Added a labeled 'Jump to…'
button (aria-label spells out the shortcut) that dispatches a
'commandpalette:open' event the palette now also listens for. Verified
the other top a11y items are already satisfied here (sonner Toaster
provides the aria-live region; sidebar icon buttons are aria-labeled;
skip-link + drawer focus mgmt already present).
This commit is contained in:
Moheeb Zara
2026-05-17 02:02:31 -07:00
parent 390046a96b
commit 331a0c60ce
2 changed files with 18 additions and 1 deletions
+6 -1
View File
@@ -96,8 +96,13 @@ export function CommandPalette({
setOpen(o => !o)
}
}
const onOpen = () => setOpen(true)
document.addEventListener('keydown', onKey)
return () => document.removeEventListener('keydown', onKey)
window.addEventListener('commandpalette:open', onOpen)
return () => {
document.removeEventListener('keydown', onKey)
window.removeEventListener('commandpalette:open', onOpen)
}
}, [])
const allowed = useCallback(