Skip to content

fix(Toolbar): a link shares the row's single tab stop - #8921

Merged
cixzhang merged 1 commit into
meta:mainfrom
kyu-rong:fix/toolbar-link-roving
Oct 31, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
kyu-rong:fix/toolbar-link-roving

Conversation

@kyu-rong

@kyu-rong kyu-rong commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Why does it happen? Toolbar's roving itemSelector is 'button, input, [tabindex]'. A Button with href renders an <a href> with no tabindex, so the selector never matches it. Roving neither stamps it -1 nor visits it with the arrow keys, and the browser keeps it in the tab order.
  • Why does it hurt? The toolbar stops being one composite widget: Tab lands inside it twice, and the arrow-key order a screen-reader user learns skips one of its controls.
  • Why does it matter? component:Toolbar FR4 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

Smallest restoration

  • Toolbar.tsx: itemSelector becomes '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. textarea and select stay in the gap: they use the arrow keys themselves, so they are not part of this fix.
  • A patch changeset.

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 with Cut, Docs (Button with href), and Paste, then After. 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.

Key main This branch
Tab from Before button "Cut" button "Cut"
Tab link "Docs" button "After"
ArrowRight from Cut button "Paste" link "Docs"
ArrowRight button "Cut" button "Paste"
  • Reproduction before the change: Tab stops on the link inside the toolbar, and the arrow keys skip it.
  • Result after the change: Tab leaves the toolbar from its single stop, and the arrow keys visit the link.
  • Representative unchanged path: rows of buttons and inputs only; the existing keyboard suites pass unchanged.
  • Regression test: the new case fails with Toolbar.tsx reverted to main (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

  • R1 narration: none; the edited sentences state which controls share the stop.
  • R2 research: none.
  • R3 evidence: no pull request is cited in the record.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none in the record.

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

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.
  • Playwright Chromium keyboard walk of the cases above, main selector versus this branch.

@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 30, 2026 2:51am UTC

Request Review

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:spec-owner-review Current knowledge records await owner approval labels Oct 30, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 30, 2026
@astracat-bot

astracat-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 30, 2026, 3:20 AM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Oct 31, 2026
@cixzhang cixzhang closed this Oct 31, 2026
@cixzhang cixzhang reopened this Oct 31, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec f60c20d

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Modified Components

Toolbar (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) 340B 340B 0B
Lines of Code 269 269 -
Complexity High High (17) -

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/TableSelectionToolbar 53.6KB 53.6KB +7B 11.3KB 11.3KB 0B
core/Toolbar 40.1KB 40.1KB +7B 7.7KB 7.7KB 0B
richtext/RichTextEditorToolbar N/A 214.0KB N/A N/A 454B N/A

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 Summary

Gzip figures measure each package's entry file, not the code an import pulls in.

Package Entry (ESM) Entry gzip before Entry gzip after Delta
@astryxdesign/core 4.9KB 1.2KB 1.2KB 0B
Package stylesheet Gzip before Gzip after Delta
@astryxdesign/core 35.4KB 35.4KB 0B

Accessibility Audit

Status: The accessibility audit did not run on this pull request. It runs after merges to main and before each release; pull requests that touch components run it with the ci:heavy-lanes label.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Oct 31, 2026
@cixzhang
cixzhang merged commit b9b2db5 into meta:main Oct 31, 2026
68 of 107 checks passed

This branch was successfully deployed

1 active deployment
Preview — f60c20d5 Deployed Oct 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants