Skip to content

[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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

victorsanni
Copy link
Contributor

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. a: internationalization Supporting other languages or locales. (aka i18n) labels Aug 20, 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 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.

Comment on lines +17 to +18
"expandedHint": "Collapsed",
"collapsedHint": "Expanded"
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

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.

Comment on lines +205 to +209
/// 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';
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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

  1. Documentation should be useful and explain the 'why' and the 'how' to avoid confusion. (link)

@victorsanni victorsanni requested a review from chunhtai August 21, 2025 16:30
@victorsanni
Copy link
Contributor Author

This is not a breaking change for localization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: internationalization Supporting other languages or locales. (aka i18n) f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant