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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user