Skip to content

Add optional flag to determine assertiveness level in aria announcement for flutter web #107568

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

Merged
merged 12 commits into from
Jul 23, 2022

Conversation

nbayati
Copy link
Contributor

@nbayati nbayati commented Jul 13, 2022

Add an optional flag to Flutter's accessibility announcer service to support two different modes of aria announcements in flutter web. Developers can make the announcement assertive or polite using this flag. The change on the web engine side is tracked here: flutter/engine#34640

Fixes #104109

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.
  • All existing and new tests are passing.

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

@nbayati nbayati requested a review from yjbanov July 13, 2022 18:04
@flutter-dashboard flutter-dashboard bot added a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) framework flutter/packages/flutter repository. See also f: labels. labels Jul 13, 2022
@nbayati nbayati requested a review from goderbauer July 19, 2022 21:37
@nbayati nbayati requested review from chunhtai and yjbanov July 21, 2022 02:08
final AnnounceSemanticsEvent event = AnnounceSemanticsEvent(message, textDirection);
///
/// The assertiveness level of the announcement can be determined by setting [assertivenessSetting].
/// Currently, this is only supported by the web engine and has no effect on other platforms.
Copy link
Member

Choose a reason for hiding this comment

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

What do you get on other platforms? Always assertive? Always polite? Is it platform dependent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to @chunhtai's comment above:

Android does not have such setting, it will always interrupt. iOS has two different politeness, always gets interrupted or queue after current announcement.

@nbayati nbayati requested a review from goderbauer July 21, 2022 17:44
Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

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

lgtm

static Future<void> announce(String message, TextDirection textDirection) async {
final AnnounceSemanticsEvent event = AnnounceSemanticsEvent(message, textDirection);
///
/// The assertiveness level of the announcement can be determined by [assertiveness].
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I'd replace "can be" with "is"

Copy link
Contributor

Choose a reason for hiding this comment

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

This paragraph does not add any more information other than the parameter name.

Maybe mention why developer would want to use this parameter? maybe give an example situation and which enum value you can use?

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM

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, left some minor comments on doc string

/// Determines whether the announcement should interrupt any existing announcement,
/// or queue after it.
///
/// On the web this option uses the aria-live level to set the assertiveness
Copy link
Contributor

Choose a reason for hiding this comment

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

I will probably remove anything related to aria-live in the doc string. It is an implementation detail and will probably confuse reader

static Future<void> announce(String message, TextDirection textDirection) async {
final AnnounceSemanticsEvent event = AnnounceSemanticsEvent(message, textDirection);
///
/// The assertiveness level of the announcement can be determined by [assertiveness].
Copy link
Contributor

Choose a reason for hiding this comment

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

This paragraph does not add any more information other than the parameter name.

Maybe mention why developer would want to use this parameter? maybe give an example situation and which enum value you can use?

@nbayati nbayati added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 23, 2022
@auto-submit auto-submit bot merged commit 74ea713 into flutter:master Jul 23, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jul 23, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2022
camsim99 pushed a commit to camsim99/flutter that referenced this pull request Aug 10, 2022
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) autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using aria-live="assertive" for Flutter-web's SemanticsService.announce implementation
4 participants