Skip to content

[VPAT] Describe the a11y_assessments dialog for screen readers - #13462

Merged
hannah-hyj merged 1 commit into
flutter:mainfrom
flutter-zl:vpat-a11y-assessments-dialog-description
Oct 30, 2026
Merged

hannah-hyj merged 1 commit into
flutter:mainfrom
flutter-zl:vpat-a11y-assessments-dialog-description

Conversation

@flutter-zl

Copy link
Copy Markdown
Contributor

Problem

On the a11y_assessments dialog demo, screen readers do not read the dialog text. When the dialog opens, focus moves to the autofocused OK button and VoiceOver only says "OK, button". The text merges into the dialog's semantics node as its label, and on web a dialog's label is not exposed unless it names the route, so the text never reaches the DOM.

Fix

The text gets its own semantics node with namesRoute: true. On web the dialog's aria-describedby then points at it, so screen readers read it as the dialog's description when it opens. OK keeps its autofocus. A new test checks that the text names the dialog.

Demo

Run the test app on web, open #/dialog, turn on VoiceOver, and activate Show Dialog. Before, only "OK, button" is read. After, VoiceOver also reads "This is a typical dialog."

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Oct 27, 2026
@flutter-zl flutter-zl changed the title [material_ui] Describe the a11y_assessments dialog for screen readers [VAPT] Describe the a11y_assessments dialog for screen readers Oct 27, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request wraps the dialog text in a Semantics widget to allow screen readers to describe the dialog, and adds a widget test to verify this behavior. The review feedback recommends declaring the Semantics widget as const to optimize widget tree rebuilds.

Comment on lines +47 to +51
Semantics(
container: true,
namesRoute: true,
child: const Text('This is a typical dialog.'),
),

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.

medium

The Semantics widget and its child subtree can be declared as const. In Flutter, using const constructors where possible is a recommended performance best practice because it allows the framework to cache the widget and avoid redundant rebuilds.

Suggested change
Semantics(
container: true,
namesRoute: true,
child: const Text('This is a typical dialog.'),
),
const Semantics(
container: true,
namesRoute: true,
child: Text('This is a typical dialog.'),
),
References
  1. Prefer using const constructors for widgets where possible to optimize widget tree rebuilds and performance, as recommended by the Dart style guide (Effective Dart). (link)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The default Semantics constructor isn't const, so const Semantics(...) doesn't compile. Only Semantics.fromProperties is. prefer_const_constructors is enabled here and passes, and the Text child is already const. Keeping it as is.

@github-actions github-actions Bot added p: material_ui triage-design Should be looked at in design triage labels Oct 27, 2026
@flutter-zl
flutter-zl requested a review from hannah-hyj October 27, 2026 19:16
@flutter-zl flutter-zl changed the title [VAPT] Describe the a11y_assessments dialog for screen readers [VPAT] Describe the a11y_assessments dialog for screen readers Oct 27, 2026

@hannah-hyj hannah-hyj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@hannah-hyj
hannah-hyj merged commit 88bd374 into flutter:main Oct 30, 2026
12 checks passed
@flutter-zl flutter-zl added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 30, 2026
chunhtai pushed a commit to chunhtai/flutter that referenced this pull request Nov 2, 2026
flutter/packages@3742a4e...3f34a6f

2026-11-01 [email protected] Roll Flutter from
ee8b482 to fcfb4f2 (3 revisions) (flutter/packages#13520)
2026-10-31 [email protected] Roll Flutter from
5e805bf to ee8b482 (17 revisions) (flutter/packages#13512)
2026-10-30 [email protected] [VPAT] Describe the a11y_assessments
dialog for screen readers (flutter/packages#13462)
2026-10-30 [email protected] [go_router_builder] Allow `build` 5
(flutter/packages#13455)
2026-10-30 [email protected] [go_router]
Support nested parentheses, groups, and lookaround assertions in path
parameters (flutter/packages#12571)
2026-10-30 [email protected] [in_app_purchase_storekit] Add
SK2Transaction.currentEntitlements() (flutter/packages#13373)
2026-10-30 [email protected] [all]
Remove broken .claude/skills symlink (flutter/packages#13492)
2026-10-30 [email protected] Roll Flutter from
c091098 to 5e805bf (15 revisions) (flutter/packages#13504)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
gmackall pushed a commit to gmackall/flutter that referenced this pull request Nov 3, 2026
flutter/packages@3742a4e...3f34a6f

2026-11-01 [email protected] Roll Flutter from
ee8b482 to fcfb4f2 (3 revisions) (flutter/packages#13520)
2026-10-31 [email protected] Roll Flutter from
5e805bf to ee8b482 (17 revisions) (flutter/packages#13512)
2026-10-30 [email protected] [VPAT] Describe the a11y_assessments
dialog for screen readers (flutter/packages#13462)
2026-10-30 [email protected] [go_router_builder] Allow `build` 5
(flutter/packages#13455)
2026-10-30 [email protected] [go_router]
Support nested parentheses, groups, and lookaround assertions in path
parameters (flutter/packages#12571)
2026-10-30 [email protected] [in_app_purchase_storekit] Add
SK2Transaction.currentEntitlements() (flutter/packages#13373)
2026-10-30 [email protected] [all]
Remove broken .claude/skills symlink (flutter/packages#13492)
2026-10-30 [email protected] Roll Flutter from
c091098 to 5e805bf (15 revisions) (flutter/packages#13504)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants