-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Add back "Use live region in error text input decorator for Android #165531" #168992
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
7f6df3d
to
9bd8d56
Compare
ec61f12
to
cb5647c
Compare
It doesn't seem like it's any of those issues. Most of my merges were because the tree was blocked, and I had to update my branch to the latest version to check if the tree would be fixed. Another recurring issue I noticed was that the Google Testing job would sometimes delete the CL and rerunning the test wouldn't actually do anything different. I only just found out about rerunning tests through Luci though, so I'll be doing that instead for any future flaky tests. |
autosubmit label was removed for flutter/flutter/168992, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label. |
@@ -968,6 +969,20 @@ class AccessibilityFeatures { | |||
/// Only supported on iOS. | |||
bool get onOffSwitchLabels => _kOnOffSwitchLabelsIndex & _index != 0; | |||
|
|||
/// Whether accessibility announcements (like [SemanticsService.announce]) |
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.
Can we get rid of the like
? or if there is some fuzziness can you articulate more clearly what else would match?
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.
There is technically another way to send an announcement but it is much less common and that is by sending an announcement event over the system channel directly.
@@ -968,6 +969,20 @@ class AccessibilityFeatures { | |||
/// Only supported on iOS. | |||
bool get onOffSwitchLabels => _kOnOffSwitchLabelsIndex & _index != 0; | |||
|
|||
/// Whether accessibility announcements (like [SemanticsService.announce]) | |||
/// are allowed on the current platform. |
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.
/// are allowed on the current platform. | |
/// are encouraged on the current platform. |
right now announce is discouraged but possible on android 36.
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.
I think the accessibility team discourages using announcements
in general. Should we keep it as supports
in that case?
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 android accessibility team discourages announcements other accessability teams have the api and have no issue. Think about this documentation from the callers perspective. Is this value about if you can use announcements? I think not because technically they can work until it is just discourage because they want to turn off the api. Is this value about if you should or if it is encouraged or if it is some other word? But make the value have predictable meaning to a new situation.
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.
Ah, sorry I meant that the Flutter accessibility team also discourages announcements too. @chunhtai for more input on announce usage in Flutter. I'm thinking that supportsAnnounce would be the best because if Android ever removes announce support, then supportsAnnounce can still just be false and developer's can continue to rely on their branched logic.
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.
I think Android team is meant to remove the API at some point, so I think having a more definite language here is more future proof.
Flutter accessibility team also discourages announcements too
I don't think we have an opinion on this. This is per platform decision, we have to follow each platform so that flutter app in that platform won't create a different user experience.
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.
Okay gotcha. I'm leaning towards using supports
in the docs here then. Also see similar comment here for reasoning: #168992 (comment)
engine/src/flutter/lib/web_ui/lib/src/engine/semantics/semantics.dart
Outdated
Show resolved
Hide resolved
@@ -115,6 +115,7 @@ abstract class AccessibilityFeatures { | |||
bool get reduceMotion; | |||
bool get highContrast; | |||
bool get onOffSwitchLabels; | |||
bool get announce; |
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.
Maybe it is too late but it feels like announce needs a modifier. Like prefer or should and that announce alone is confusing.
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.
I was thinking something like supportsAnnounce
. How's that sound?
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.
Q: "How strongly do you feel about that change? ... no other method there is using a prefix and the class name implies these are feature flags "
The name does seem to imply a prefix but I am struggling to guess at the prefix.
For example:
Is the prefix can-InvertColors or should-InvertColors or userPrefers-InvertColors phoneHas-InvertColorsOption.
Same with disableAnimations, can-DisableAnimations does not make sense should-DisableAnimations and userPrefers-DisabledAnimations could make sense.
I think announce is even more difficult because with api 36 my understanding is not that it wont work but instead it should not be used. That subtly important especially since we have positive and negative versions of an announce boolean.
If we knew other platforms were going to also remove announce then I would say we should actualy create 2 booleans one for if it will work and the other for if it is not depreciated.
So renaming this variable is not blocking but resolving the confusion about the scope and what the booleans actually mean across the pr is blocking.
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.
That makes sense.
In that case I'm thinking that supportsAnnounce for now and if another platform does something different like encouragesAnnounce, we can add that later?
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.
I'm trying to come up with a proper name change and I'm leaning towards supportsAnnounce
.
Reason to use supports
: It would treat deprecated/removed use cases the same way and developers don't have to worry about potentially a future removal of the API as this will already count for it.
Reason not to use supports
: If developers truly need announce
, they would need to write a platform check to see if their specific platform simply discourages it but still has the capability.
Reason to use prefers
: It allows developers to treat this flag as only a hint.
Reason not to use prefers
: It's a bit misleading because then users would be tempted to use announce when other mechanisms like liveRegion
would be more appropriate. Even iOS (see docs discourages use when elements are changing too frequently.
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.
I ended up choosing to go with supportsAnnounce
. This will require some refactoring in the engine before this PR lands. See PR: 170618
@@ -584,6 +589,23 @@ class MediaQueryData { | |||
/// originates. | |||
final bool boldText; | |||
|
|||
/// Whether accessibility announcements (like [SemanticsService.announce]) | |||
/// are allowed on the current platform. |
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.
/// are allowed on the current platform. | |
/// are encouraged on the current platform. |
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.
How about "supported"? Flutter does not really encourage using announcements.
Partly of #165510⤵️ Child PR: #168992 Partly re-lands #165531 The PR was originally reverted due to an issue with an internal Google test. I split re-land PR into two separate ones so that we can individually revert in case it fails again. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
…lutter into feat/form-live-region
…/form-live-region # Conflicts: # engine/src/flutter/lib/ui/window.dart # engine/src/flutter/lib/web_ui/lib/src/engine/semantics/semantics.dart
…/form-live-region
Partly of #165510
Re-lands #165531
The PR was originally reverted due to an issue with an internal Google test. I added a new test case under
input_decorator_test.dart
which does something similar to prevent the regression. All other code is the same as #165531.The easiest way to review this would probably be to just check the diff after the first commit to see the changes I made. To check if the reland commit is the same, it might be best to just compare solely that commit against the original PR.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.