Skip to content

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.

Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

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

LGTM, just a minor suggestion

@victorsanni
Copy link
Contributor Author

Blocked on #174365

Copy link
Member

@hannah-hyj hannah-hyj left a comment

Choose a reason for hiding this comment

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

LGTM

super.dispose();
}

void _announceSemantics() {
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

@victorsanni
Copy link
Contributor Author

Blocked on #174598

@Piinks
Copy link
Contributor

Piinks commented Jan 12, 2026

Greetings from stale PR triage! 👋
Is this change still on your radar?

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.

5 participants