-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[A11y] Announce Expansible expansion status #174169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Part of Add semantics for CupertinoExpansionTile