Skip to content

Conversation

@ash2moon
Copy link
Contributor

@ash2moon ash2moon commented Aug 27, 2025

Why this PR is closed:

This PR is closed because a new and improved method is now available that avoids using a live region. Recent developments support the expanded flag for ExpansionTile. It is preferable to use the expanded flag, rather than a live region, to announce whether a tile is expanded.


Migrates expansion tile to prefer using idiomatic a11y semantics over announcements.
Resolves #122101
Partially completes #165510

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on [Discord].

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@ash2moon ash2moon requested a review from a team as a code owner August 27, 2025 21:38
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions bot added platform-android Android applications specifically framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine related. See also e: labels. f: material design flutter/packages/flutter/material repository. labels Aug 27, 2025
@ash2moon ash2moon marked this pull request as draft August 27, 2025 21:38
@github-actions github-actions bot added the team-android Owned by Android platform team label Aug 27, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 migrates ExpansionTile to use a Semantics live region for accessibility announcements instead of SemanticsService.announce. This is achieved by wrapping the tile in a Semantics widget with liveRegion: true and commenting out the explicit announcement calls.

My review focuses on the correctness and maintainability of these changes. I've identified a potentially brittle magic string check in the Android accessibility bridge that should be clarified or removed. I also have a question about a change to the semantics hint on iOS/macOS, which might affect how the tile's state is announced on focus.

Comment on lines +2709 to +2711
if (label != null && label.startsWith("T")) {
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This condition seems brittle as it relies on a magic string "T". Could you add a comment explaining why this check is necessary and what kind of labels it's intended to match? If this is for temporary testing, it should be removed before merging. Relying on string prefixes can lead to maintainability issues and unintended side effects if labels change in the future.

Comment on lines 596 to +598
semanticsHint = _tileController.isExpanded
? '${localizations.collapsedHint}\n ${localizations.expansionTileExpandedHint}'
: '${localizations.expandedHint}\n ${localizations.expansionTileCollapsedHint}';
? localizations.expansionTileExpandedHint
: localizations.expansionTileCollapsedHint;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

By removing the state (collapsedHint/expandedHint) from semanticsHint, the state of the ExpansionTile (expanded or collapsed) might not be announced when the user focuses on it. The new liveRegion will announce the state when it changes, but not on initial focus. Is it intended that the state is not announced on focus? Usually, for controls like this, the state is part of the accessibility label or hint.

hannah-hyj and others added 6 commits September 30, 2025 16:30
Update semantics_test.dart

1

6

5

5

Update embedder_semantics_update.cc

lint

add flag

4

3

Update semantics.dart

2

1

avoid abbreviation

avoid abbreviation

lint
Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>
@github-actions github-actions bot added platform-ios iOS applications specifically a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) platform-web Web applications specifically team-ios Owned by iOS platform team labels Oct 7, 2025
@ash2moon
Copy link
Contributor Author

This PR is closed because a new and improved method is now available that avoids using a live region. Recent developments support the expanded flag for ExpansionTile. It is preferable to use the expanded flag, rather than a live region, to announce whether a tile is expanded.

@ash2moon ash2moon closed this Oct 29, 2025
@ash2moon ash2moon deleted the feat/expansion-tile-live-region branch November 5, 2025 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) engine flutter/engine related. See also e: labels. f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. platform-android Android applications specifically platform-ios iOS applications specifically platform-web Web applications specifically team-android Owned by Android platform team team-ios Owned by iOS platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SemanticsService.announce gets interrupted by VoiceOver

2 participants