fix: resolve command palette aria-activedescendant wiring and restore coverage gate #499 - #587
Closed
RemmyAcee wants to merge 1 commit into
Closed
Conversation
… coverage The grouped-results command palette (issue RevoraOrg#499) shipped with two defects that broke WCAG compliance and the project coverage gate: - aria-activedescendant on the combobox input referenced cp-item-N ids that no element carried, so screen readers never announced the active option. Option buttons now carry stable ids matching the reference. - Branch coverage sat at 91.48% against the enforced 95% threshold. Added tests for Tab/Shift+Tab trap wrap-around, activedescendant wiring, unregistered icon names, arrow-key round trips, stale-index Enter, and destructive items without confirmLabel (98.58% branches). Design-system doc updated to match the actual per-group listbox wiring.
|
@RemmyAcee Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
During verification of the grouped-results command palette, two defects were found in the shipped implementation: the combobox's
aria-activedescendantreferenced element ids that did not exist anywhere in the DOM (so screen readers never announced the active option — a WCAG 2.1 AA / 4.1.2 failure), and branch coverage on the component sat at 91.48% against the project's enforced 95% per-file threshold, meaning CI would fail on merge.This PR fixes both: option rows now carry stable ids that resolve the ARIA reference, and targeted tests close every reachable coverage gap (98.58% branches). The grouped-results feature itself (section headers, Navigate/Actions/Settings groups, 5-per-group limits, Recent Actions top-5 with clear-history control) was verified working end-to-end on
master.Related Issue
Closes #499
Changes
🛠 Accessibility (ARIA combobox wiring)
src/components/CommandPalette/CommandPalette.tsxrole="option") now carry a stableid="cp-item-<flatIndex>"so the input'saria-activedescendantalways resolves to a real element.docs/uiux/command-palette-grouped-results.mdrole="listbox"wiring (aria-label="<GroupName> commands").✅ Test Coverage (restores CI gate)
src/components/CommandPalette/CommandPalette.test.tsxaria-activedescendantwiring tests: id match on first highlight, cross-group flat-index navigation, and cleared attribute when no item is active.Shift+Tabfrom the first focusable andTabfrom the last, asserting both the wrap (preventDefault+ focus move).confirmLabelfall back toitem.labelin the confirm row, announcement, and button text.Verification Results
Notes for reviewers:
[tabindex="-1"]:not([tabindex="-1"]); the new trap tests are structured to stay environment-independent without changing component behavior.Acceptance Criteria
RECENT_LIMIT = 5, per-user storage keyrevora:recent-commands:<userId>+clearRecent()aria-activedescendantwiring; axe passes in all five UI states[dir="rtl"]overrides unchanged and verified