Repository navigation
fix(Toolbar): a link shares the row's single tab stop - #8921
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Recommending approval. Adding a[href] to Toolbar's roving selector gives a link in the row the same single Tab stop and arrow-key access as the other controls, which component:Toolbar FR4 already requires, and the new test fails without the fix and passes with it. Nothing more is needed from you; because the pull request also edits the current Toolbar record, the repository's spec-owner check still needs an engineering owner's approval on this head before merge.
[Automated review]
|
/approve-spec f60c20d |
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewModified ComponentsToolbar (@astryxdesign/core) · View in Storybook
Component Size
Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included. Bundle Size SummaryGzip figures measure each package's entry file, not the code an import pulls in.
Accessibility AuditStatus: The accessibility audit did not run on this pull request. It runs after merges to Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
User impact
A builder who puts a link in a Toolbar, for example
<Button label="Docs" href="/docs" />between Cut and Paste, gets a row with two Tab stops. Keyboard users have to Tab through the link on their way out of the toolbar, and the arrow keys jump over it, so the link is reachable only with Tab.Problem and solution fit
itemSelectoris'button, input, [tabindex]'. A Button withhrefrenders an<a href>with notabindex, so the selector never matches it. Roving neither stamps it-1nor visits it with the arrow keys, and the browser keeps it in the tab order.component:ToolbarFR4 requires the row to be a single tab stop, and the APG toolbar pattern makes the toolbar one tab stop.Fix: add
a[href]to the selector, the same change #5389 made in ButtonGroup for the same defect.Expected behavior and authority
component:ToolbarFR4 (authoritycurrent): "The row MUST be a single tab stop." The record listed links under its implementation gap; this change takes them out.a[href]to ButtonGroup's selector and called the missing link member a defect.Smallest restoration
Toolbar.tsx:itemSelectorbecomes'button, input, a[href], [tabindex]'.Toolbar.test.tsx: one case. Tab from the first control leaves the toolbar, and ArrowRight visits the link.Toolbar.spec.md: the FR4 implementation gap, the Current-state impact bullet, and the unverified list no longer name links.textareaandselectstay in the gap: they use the arrow keys themselves, so they are not part of this fix.Evidence
Playwright Chromium against Storybook served locally from this branch, with the selector reverted for AS-IS. The probe story (not committed) renders
Before, a Toolbar withCut,Docs(Button withhref), andPaste, thenAfter. Each caption is the focused element's role and name, read from Chromium's accessibility tree at that moment. The red outline and the caption panel are recording-only.mainBeforeCutToolbar.tsxreverted tomain(Tab from Cut lands on the link) and passes with this change.AS-IS
toolbar-AS-IS.mp4
TO-BE
toolbar-TO-BE.mp4
Writing rubric results
Scope
Testing
pnpm exec vitest run --project ui packages/core/src/Toolbar packages/core/src/ButtonGroup: 88 passed.pnpm -F @astryxdesign/core typecheck, eslint and prettier on the changed files,pnpm check:knowledge,git diff --check: passed.mainselector versus this branch.