Skip to content

Agentic Button: expose visible labels and toggle state - #4403

Merged
Jason Morse (JasonVMo) merged 6 commits into
mainfrom
user/sriramas/button-accessibility-fix
Oct 29, 2026
Merged

Jason Morse (JasonVMo) merged 6 commits into
mainfrom
user/sriramas/button-accessibility-fix

Conversation

@srividyaramas

@srividyaramas srividyaramas commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Why

People using assistive technology should get the same button label and selection state that are shown on screen. Agentic Button was not consistently exposing its visible text as a native accessible name, and controlled toggle buttons were missing their native toggle action.

What changed

Button now uses plain text content as its accessible name when the app has not supplied one. App-provided names and label references still take precedence, including deliberately empty labels.

When the app supplies a selected state, the button declares the corresponding checked state and custom toggle action. Windows exposes the native checked projection. On macOS, a custom Toggle action is not a default AXPress action, and the desktop driver does not expose checked queries for a button role. The app still owns selection; forwarding an accessibility action does not change selection or generate an extra press.

This change includes focused regression tests, updated component documentation, and a patch changeset. Broader component coverage will come separately.

Testing

  • The full components-package unit suite passed: 581 tests and all eight existing snapshots, including 20 new regression cases.
  • All eight selected Win32 component callbacks passed at the current head, including caller-owned selection/reset, names, roles, checked projection, and native action transport. The full selected native run passed 179 checks with eight existing input-dependent cases skipped.
  • Package build, lint, formatting, story type-checking, and component contract checks passed.
  • A separate local validation branch combining the Button and ListboxItem changes with the previously validated Windows tooling repair passed 587 unit tests and the cache-cleared root aggregate: 175 tasks, zero failures.
  • macOS Fabric and Paper Storybook CI passed at this head. Each report includes three passing Button callbacks and five explicitly skipped host/input-specific callbacks; callback presence and skip reasons were verified in the native artifacts.

The macOS follow-up changes only Storybook tests and related contract documentation. Shared role and enabled-state assertions still run across desktop hosts. Native checked projection is a separate Windows test, explicitly reported as unsupported on macOS. The caller-owned selection/reset interaction uses physical activation on macOS and is explicitly skipped when that input capability is unavailable; Windows/Win32 accessibility activation is retained.

Keyboard and pointer coverage is not complete: input was disabled in the local native run. Native macOS, including its physical-input interaction, and Windows Fabric have not been qualified locally. Unsupported or skipped cases are not passes.

Paper's first CI attempt hit the existing Avatar activity-ring worker deadline before any authored Button callback ran. One Paper-job retry on the unchanged commit passed. No runtime code or timeouts changed in this follow-up.

All PR checks on this head completed without failures as of October 28. The root aggregate cited above ran on the separate combined validation branch, not on this isolated product head. The Windows tooling repair landed upstream in #4400 and is not part of this PR. Green CI does not qualify the explicitly skipped macOS checked projection or physical-input interaction.

Declare resolved Toggle actions for caller-owned selection, retain native action forwarding, and add checked-state ownership and stable-layout regressions without physical input.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4b66f3ef-85ac-4405-bd35-dcc167a077b1
…rship

Preserve explicit naming and label references. Add runtime and native naming regressions, and allow the caller-owned selection example to use real native action transport without physical input.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4b66f3ef-85ac-4405-bd35-dcc167a077b1
Keep native accessibility actions distinct from onPress while qualifying caller-owned reset without physical input.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4b66f3ef-85ac-4405-bd35-dcc167a077b1
Keep ordinary accessibility taps and declared Toggle actions distinct from pointer/keyboard onPress; exercise each real transport through its caller.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4b66f3ef-85ac-4405-bd35-dcc167a077b1
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Bundle size report

Tree-shaken, minified production esbuild bundles with React and React Native runtimes externalized.

Scenario Modules-Mac (Δ) Modules-Win (Δ) Size-Mac (Δ) Size-Win (Δ)
components-button 65 (+1) 66 (+1) 51.57k (+944b) 51.50k (+944b)
components-catalog 214 (+0) 215 (+0) 205.90k (+413b) 205.82k (+413b)
design-theme-state 34 (+0) 35 (+0) 30.15k (+0b) 30.08k (+0b)
design-themed-root 38 (+0) 39 (+0) 32.12k (+0b) 32.04k (+0b)
design-color-lib 6 (+0) 6 (+0) 6.33k (+0b) 6.33k (+0b)
design-theme-state-legacy-source 35 (+0) 36 (+0) 31.81k (+0b) 31.73k (+0b)
design-legacy-theme-from-flex 58 (+0) 59 (+0) 97.77k (+0b) 97.63k (+0b)

The job is advisory: size changes are reported but do not fail the pull request. Bundle or analysis errors still fail.


View bundle-size workflow run

@srividyaramas
srividyaramas marked this pull request as ready for review October 28, 2026 18:32
SriRamas23 and others added 2 commits October 28, 2026 12:27
Keep portable button role and enabled-state assertions shared, isolate Windows checked projection, and require physical macOS caller activation without changing product behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4b66f3ef-85ac-4405-bd35-dcc167a077b1
Keep the validated source unchanged and preserve append-only history.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4b66f3ef-85ac-4405-bd35-dcc167a077b1
@JasonVMo
Jason Morse (JasonVMo) merged commit b13da50 into main Oct 29, 2026
32 of 33 checks passed
@JasonVMo
Jason Morse (JasonVMo) deleted the user/sriramas/button-accessibility-fix branch October 29, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants