Repository navigation
feat(a11y): add keyboard grid navigation to comparison table - #1529
Merged
nanaf6203-bit merged 1 commit intoNov 24, 2026
Merged
nanaf6203-bit merged 1 commit into
nanaf6203-bit merged 1 commit into
Conversation
The comparison table was mouse-only: sortable headers were plain <th> click handlers, rows could not be expanded from the keyboard, and there was no way to move between cells. Rebuilds the table as an ARIA grid with a roving tabindex (arrows, Home/End, RTL-aware), keyboard-activated sorting, Enter/Space expand, Escape collapse with focus restored to the row header, and a skip link. Also adds the other three items assigned to this contributor: a transaction live region, and the inspection-report and cross-chain bridge type modules behind a types barrel.
|
@mercy60 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! 🚀 |
nanaf6203-bit
approved these changes
Nov 24, 2026
nanaf6203-bit
left a comment
Contributor
There was a problem hiding this comment.
Reviewed and happy with this. Thanks!
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.
Summary
Closes #1363
Rebuilds
PropertyComparisonTableas an ARIA grid that is fully operable from the keyboard, and adds the other three items assigned to this contributor in the sameui-extensions/slice: a transaction status live region (#1361), the inspection-report types (#1359), and the cross-chain bridge types (#1357) behind a newtypes/index.tsbarrel. The most important design decision is the roving tabindex: the grid is a single tab stop, arrow keys move between cells, and focus is tracked in component state rather than derived from the DOM, so the header sort buttons stay in the normal tab order instead of being swallowed by the grid.Also closes
Closes #1361, Closes #1359, Closes #1357
Why
PropertyComparisonTablewas mouse-only. Sorting was anonClickon a plain<th>, so a keyboard user could not change the sort order at all; expanding a row wasonClickon a<tr>; there was no way to move between cells; and there was no skip link, so reaching the table meant tabbing through everything above it. The table also exposed no grid semantics, so a screen reader announced the cells as unrelated table data rather than a navigable grid.The fix follows the existing roving-tabindex guidance the issue points at and keeps the component's public API intact —
ComparisonProperty,ComparisonSortKey, named and default exports, and theloading/dirprops all still behave as before; the two new props are optional. No second table abstraction was introduced.What was built
ui-extensions/components/PropertyComparisonTable.tsxrole="grid",aria-rowcount,aria-colcount),<th scope="col">sort headers wrapping real<button>s,<th scope="row">property names, rovingtabindexoverdata-cell="row-column", arrow/Home/End/PageUp/PageDown navigation clamped at the edges, RTL-mirrored horizontal movement, Enter/Space to expand, Escape to collapse and refocus the row header, per-cellaria-labelnaming row + column + value,focus-visibleoutline on every cell and header button, and a skip link that is the first focusable element. Also exports the purenextCellPositionhelper.ui-extensions/components/TransactionLiveRegion.tsxTransactionLiveRegionwith a separate polite (role="status",aria-live="polite") and assertive (role="alert",aria-live="assertive") region, botharia-atomicand wrapped insr-only. Announces pending/confirmed/failed through templates containing{hash}and{error}, debounced so only the final status in a burst is spoken. Pure helpersformatTransactionAnnouncement,shortHash,isUrgentStatus.ui-extensions/types/inspection.tsInspectionReport,InspectionFinding,InspectorProfile,InspectionStatus,InspectionSeverity, plusInspectionCategory.ui-extensions/types/bridge.tsBridgeTransaction,BridgeConfirmation,ValidatorSet,BridgeStatus,BridgeConfirmationStatus,BridgeChainConfig. Amounts are decimal strings so values aboveNumber.MAX_SAFE_INTEGERare not lost.ui-extensions/types/index.tsui-extensions/tests/propertyComparisonTableKeyboard.test.tsxui-extensions/tests/transactionLiveRegion.test.tsxui-extensions/tests/inspectionTypes.test.tsui-extensions/tests/bridgeTypes.test.tsIntegration changes outside
<module>/None — every changed path is inside
ui-extensions/.Within it,
ui-extensions/components/PropertyComparisonTable.tsxis modified rather than replaced. The change is backward compatible: the exported types, the named and default exports, and the existingproperties/loading/dirprops are unchanged;showSkipLinkandaria-labelare additive and optional.ui-extensions/stories/PropertyComparisonTable.stories.tsxneeded no edits and still type-checks.The only behavioural differences consumers could notice are accessibility improvements: the sort control is now a
<button>inside the header rather than a clickable<th>, and the property-name cell is a<th scope="row">rather than a<td>. Both are required for the announced headers criterion.Acceptance criteria coverage (primary issue)
Closes #1363 — Keyboard Navigation for Property Comparison Table
propertyComparisonTableKeyboard.test.tsx: moves between interactive elements with Tab — skip link → Location → Price)propertyComparisonTableKeyboard.test.tsx: navigates cells with the arrow keys;nextCellPositionmoves horizontally and vertically / clamps at the edges are not crossed)propertyComparisonTableKeyboard.test.tsx: activates sorting with Enter on a column header; expands a row with Enter and collapses it with Escape)propertyComparisonTableKeyboard.test.tsx: expands a row with Enter and collapses it with Escape; leaves Escape alone when no row is expanded)propertyComparisonTableKeyboard.test.tsx: gives every cell a visible focus indicator —focus-visible:outline*on row headers, data cells and header buttons)propertyComparisonTableKeyboard.test.tsx: exposes the table as a named ARIA grid with row and column headers —scope="col"/scope="row"plus per-cellaria-label)propertyComparisonTableKeyboard.test.tsx: renders a skip link above the grid that moves focus into it)Closes #1361 — Screen Reader Announcements for Transaction Updates
transactionLiveRegion.test.tsx: renders two visually hidden live regions with the right politeness)isUrgentStatusonly treatsfailedas urgent)transactionLiveRegion.test.tsx: announces pending and confirmed politely; announces failures assertively and not politely)transactionLiveRegion.test.tsx: substitutes the shortened hash;shortHashkeeps both ends of the hash)transactionLiveRegion.test.tsx: debounces rapid status changes down to the final one; honours a custom debounce window)transactionLiveRegion.test.tsx: the wrapper issr-only)transactionLiveRegion.test.tsx: uses configurable announcement messages;formatTransactionAnnouncementaccepts per-status message overrides)Closes #1359 — TypeScript Types for Property Inspection Reports
inspectionTypes.test.ts: models a complete report with findings and inspector details)inspectionTypes.test.ts: defines the inspection status and severity enums)keeps the status and severity value sets distinct)inspectionTypes.test.ts: exports every type from the types barrel)inspectionTypes.test.ts: contains no runtime behaviour beyond the enums — the module's only runtime values are the threeenums the issue requires; no functions, classes or services)Closes #1357 — TypeScript Types for Cross-Chain Bridge Data
bridgeTypes.test.ts: models a transaction with chain config, confirmations and validator set)bridgeTypes.test.ts: defines the bridge and confirmation status enums; separates terminal states from in-flight states)bridgeTypes.test.ts: models a transaction with chain config, confirmations and validator set)bridgeTypes.test.ts: exports every type from the types barrel)bridgeTypes.test.ts: contains no runtime behaviour beyond the enums — twoenums, no functions or services)Deliberately deferred
None. All four issues assigned to this contributor are implemented in full; each
Closeskeyword above refers to work contained in this diff.Test plan
npx jest ui-extensions/tests/{propertyComparisonTableKeyboard,transactionLiveRegion,inspectionTypes,bridgeTypes}: 43/43 passing (43 new: 18 + 14 + 5 + 6)npx jest --watchAll=false --ci: 2358/2450 passing across 249 suites (before: 2315/2407 across 245 suites). The same 25 pre-existing suites / 92 pre-existing tests fail before and after; this PR adds 4 suites and 43 passing tests and no new failures.npm run typecheck(tsc --noEmit): 482 errors before and 482 after — zero new, and zero errors mentionui-extensions. The story that imports the modified table still type-checks.npx eslint ui-extensions: 10 errors before and 10 after — zero new. All are the pre-existingParsing error: Unexpected token {onui-extensions/stories/*.stories.tsx, becauseeslint.config.mjsonly applies the TypeScript parser tosrc/**and.storybook/**; this PR adds no story files. See Notes.npm run build: cannot pass at base.npm run buildrunsnpm run typecheck && next build, andtsc --noEmitexits2onmain(482 errors) whilenext.config.tssetstypescript.ignoreBuildErrors: false. The gate is red before this PR and this PR adds no errors to it.Env vars / Notes
No new environment variables.
Public surface added:
types/index.tsis the new barrel forui-extensions, andPropertyComparisonTableadditionally exportsnextCellPositionplus the optionalshowSkipLinkandaria-labelprops. No existing export was removed or renamed.Known pre-existing gates (unchanged by this PR, documented for reviewers):
typescript,lintand thereforebuildalready fail onmainbecauseui-extensions/**is absent fromtsconfig.json'sincludeand from the TypeScript parserfileslist ineslint.config.mjs. This PR does not change those configs, as the issue requires changes to stay withinui-extensions/.