-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Modify dataMap to include assertiveness only if it's not set to polite #108396
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
Conversation
…e to prevent google3 tests from breaking
'message': message, | ||
'textDirection': textDirection.index, | ||
}; | ||
|
||
if (assertiveness == Assertiveness.assertive) { | ||
dataMap['assertiveness']=assertiveness.index; |
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.
nit: add spaces around =
.
'message': message, | ||
'textDirection': textDirection.index, | ||
}; | ||
|
||
if (assertiveness == Assertiveness.assertive) { |
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.
Please use switch/case for enums: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#avoid-using-if-chains-or--or--with-enum-values
'message': message, | ||
'textDirection': textDirection.index, | ||
}; | ||
|
||
if (assertiveness == Assertiveness.assertive) { |
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.
Overall, this is a pretty strange design. Can we just fix up the failing tests in google?
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.
This PR is accompanied by an engine change as well, so my recommendation is to avoid touching too many repositories at once, which is achieved by making it non-breaking.
Having said that, fixing downstream tests sounds like a good idea. We can do it in multiple phases. Phase one - this change - introduce the API in a non-breaking fashion and stabilize it. Phase two - update tests to accept assertiveness: 0
. Phase three - remove the condition.
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.
To be very clear: I don't think it is great practice that this was submitted while we were still discussing the best course forward. There should have at the very least been a TODO left here to remind future readers why we are (temporarily) doing this weirdness. Also, please clean this up ASAP once this has rolled into google.
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.
'message': message, | ||
'textDirection': textDirection.index, | ||
}; | ||
|
||
if (assertiveness == Assertiveness.assertive) { |
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.
This PR is accompanied by an engine change as well, so my recommendation is to avoid touching too many repositories at once, which is achieved by making it non-breaking.
Having said that, fixing downstream tests sounds like a good idea. We can do it in multiple phases. Phase one - this change - introduce the API in a non-breaking fashion and stabilize it. Phase two - update tests to accept assertiveness: 0
. Phase three - remove the condition.
flutter#108396) * Modify dataMap to include assertiveness only if it's not set to polite to prevent google3 tests from breaking * small code style enhancement
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
The first PR was breaking some of the Google tests and had to get reverted. The tests were breaking because they were receiving an additional piece of information (
assertiveness
) in the dataMap string. In this fix, we don't includeassertiveness
if it has the default value ofpolite
.Fixes #104109
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.