Repository navigation
[A11y] Announce Expansible expansion status - #174169
victorsanni wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the accessibility announcements for expansion state from ExpansionTile to the more generic Expansible widget. This is a good architectural improvement. However, there is a critical issue where the new accessibility strings (expandedHint and collapsedHint) have not been translated for any of the non-English locales, using the English text as a placeholder. This defeats the purpose of localization and must be addressed. Additionally, the documentation for these new localization properties in widgets/localizations.dart is confusing and should be clarified to avoid misuse.
| "expandedHint": "Collapsed", | ||
| "collapsedHint": "Expanded" |
There was a problem hiding this comment.
The new accessibility hints expandedHint and collapsedHint must be translated into Afrikaans. Currently, they contain the English source strings.
This is a critical accessibility issue and applies to all other non-English .arb files modified in this pull request. Please provide translations for all supported languages.
| /// The semantics hint to describe the [Expansible] expanded state. | ||
| String get expandedHint => 'Collapsed'; | ||
|
|
||
| /// The semantics hint to describe the [Expansible] collapsed state. | ||
| String get collapsedHint => 'Expanded'; |
There was a problem hiding this comment.
The documentation for expandedHint and collapsedHint is confusing. The names and descriptions don't clearly convey what state they represent. While the implementation logic is correct, the documentation could be improved to prevent misunderstanding by clarifying that the hint describes the state the widget will transition to when tapped.
The descriptions in the en.arb file are much clearer. Consider updating the documentation here to be more explicit.1
/// The hint announced when an expanded [Expansible] is tapped, which collapses it.
String get expandedHint => 'Collapsed';
/// The hint announced when a collapsed [Expansible] is tapped, which expands it.
String get collapsedHint => 'Expanded';Style Guide References
Footnotes
|
This is not a breaking change for localization. |
chunhtai
left a comment
There was a problem hiding this comment.
LGTM, just a minor suggestion
|
Blocked on #174365 |
| super.dispose(); | ||
| } | ||
|
|
||
| void _announceSemantics() { |
There was a problem hiding this comment.
Instead of using the announcement service for this, can we use a combination of live region and the expanded hint? I am also working on this in another PR to do exactly that but in the ExpansionTile.
|
Blocked on #174598 |
|
Greetings from stale PR triage! 👋 |
Part of Add semantics for CupertinoExpansionTile