feat(a11y): keyboard navigation for the slash-command popover (LC-168) #213
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-168-slash-keyboard-nav"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
LC-168: give the slash-command popover keyboard navigation, matching the mention combobox (the two live in the same composer; mention already had a full WAI-ARIA pattern, slash was click-only).
How
[role=option], Enter/Tab insert (reuses__lcInsertSlash), Escape closes; the textarea'saria-activedescendanttracks the highlighted option;htmx:afterSwaphighlights the first option so Enter inserts a default without an arrow press first.aria-selected./command, so an@-mention token can't match at the same time), so the two keydown handlers never both act - the inactive one no-ops on its empty-token guard. Mouse click is unchanged.Deeper consolidation
Added a
main.cssrule highlighting[role="option"][aria-selected="true"]. Both comboboxes setaria-selectedon keyboard nav but nothing styled it, so the keyboard selection was screen-reader-announced yet visually invisible. This fixes it uniformly for slash, mention, and the LC-157 search bars.Test
just check(templates incl. the updated fragment compile),routes_slashgreen (renders the popover with the new id/aria-selected). main.css is hand-written + served directly (no rebuild). JS keyboard behavior isn't unit-tested in this repo (consistent with the existing untested mention combobox JS); this mirrors that proven pattern.Follows LC-157; part of the post-audit consolidation.
🤖 Generated with Claude Code