Remove use of announce in time_picker and remove double Feedback.forTap calls#167241
Remove use of announce in time_picker and remove double Feedback.forTap calls#167241auto-submit[bot] merged 2 commits intoflutter:masterfrom
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
|
This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
495ee64 to
bfde3c0
Compare
|
Test failure: @QuncCccccc once the test is fixed, are you the right person to review this Material time picker change? If not can you recommend a reviewer? |
|
I can take a look! But I probably will ask @chunhtai for a second review, as he is the accessibility expert! Please let me know when it's ready😊 |
179de80 to
1769213
Compare
| case Orientation.portrait: | ||
| return Column( | ||
| return Semantics( | ||
| key: const ValueKey<String>('time-picker-header-semantics'), |
There was a problem hiding this comment.
we should avoid adding key for testing purposes like this.
If the purpose is to ensure the semantics label is correct in test, you can use find.bySemanticsLabel('your expected label') and findsOneWidget
| _TimePickerModel.selectedTimeOf(context), | ||
| alwaysUse24HourFormat: MediaQuery.alwaysUse24HourFormatOf(context), | ||
| ), | ||
| child: switch (_TimePickerModel.orientationOf(context)) { |
There was a problem hiding this comment.
Consider store the switch result into a child first for readability
| return Column( | ||
| return Semantics( | ||
| key: const ValueKey<String>('time-picker-header-semantics'), | ||
| label: MaterialLocalizations.of(context).formatTimeOfDay( |
There was a problem hiding this comment.
Can you explain a bit why we need a label here, is the previous behavior broken?
There was a problem hiding this comment.
This is because previously we were using _announceInitialTimeOnce to announce this time, but now with a label, it is announced when it is in focus.
| switch (widget.hourDialType) { | ||
| case _HourDialType.twentyFourHour: | ||
| case _HourDialType.twentyFourHourDoubleRing: | ||
| _announceToAccessibility(context, localizations.formatDecimal(newTime.hour)); |
There was a problem hiding this comment.
Since we remove all the announcement, how do we convey the information to user ? I assume there will be a liveregion somewhere?
Same for other announcements.
There was a problem hiding this comment.
A lot of these announcements were manually invoked because of the problem with Feedback.wrapForTap resulting in double announcements. Since the root cause was due to InkWell already doing a Feedback.wrapForTap, we did not need the extra wrapper within the on* callbacks. I think because of this, the original author used announce to prevent Talkback from speaking the double announcement and rewriting its responses.
There was a problem hiding this comment.
If in the course of your investigation you found prs or comments that helped you come to this conclusion please add them as a comment here. If not then please do not spend time tracking it down.
6266ef5 to
e630328
Compare
| final RenderObjectWidget orientationSpecificHeader = switch (_TimePickerModel.orientationOf( | ||
| context, | ||
| )) { | ||
| Orientation.portrait => Column( |
There was a problem hiding this comment.
It is out of scope for this pr but I really dont like how we are using the device orientation enum value all over this code for what I think is a proxy for OrientationBuilder.
reidbaker
left a comment
There was a problem hiding this comment.
Please hold merge until approval from someone on the framework team.
|
@ash2moon Is this PR ready for submission? |
This pull request replaces the use of the deprecated announce calls with idiomatic Semantic widgets and also removes the extra
Feedback.forTapcall. TheInkWellwidget already wraps the onTap with theFeedback.forTap. I also made sure sure that existing functionality is not impacted.Resolves #166448
Partially addresses #165510
Physical Testing:
Android ✅
iOS ✅
Web ✅
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.