Skip to content
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

Handle a11y focus event on Ios and android #41777

Merged
merged 34 commits into from
May 30, 2023

Conversation

hannah-hyj
Copy link
Member

@hannah-hyj hannah-hyj commented May 5, 2023

framework change:flutter/flutter#126171
issue: flutter/flutter#94523

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 and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

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

@flutter-dashboard

This comment was marked as outdated.

@cyanglaz cyanglaz marked this pull request as draft May 8, 2023 19:42
@hannah-hyj hannah-hyj marked this pull request as ready for review May 9, 2023 20:27
@hannah-hyj hannah-hyj changed the title [draft] Handle a11y focus event Handle a11y focus event on Ios and android May 9, 2023
@chunhtai chunhtai self-requested a review May 10, 2023 15:38
@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

Changes reported for pull request #41777 at sha f95041f

@hannah-hyj hannah-hyj requested a review from chunhtai May 12, 2023 22:23
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

ArgumentCaptor.forClass(AccessibilityEvent.class);
verify(mockParent).requestSendAccessibilityEvent(eq(mockRootView), eventCaptor.capture());
AccessibilityEvent event = eventCaptor.getAllValues().get(0);
assertEquals(event.getEventType(), AccessibilityEvent.TYPE_VIEW_FOCUSED);
Copy link
Contributor

Choose a reason for hiding this comment

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

also check for id?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with this!

Copy link
Member Author

Choose a reason for hiding this comment

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

I tested nodeId in AccessibilityChannelTest.java
And there is no public api to get id from AccessibilityEvent.

Copy link
Contributor

@chunhtai chunhtai May 25, 2023

Choose a reason for hiding this comment

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

This seems to not be addressed yet

per our offline discussion we talked previously, we can create a mocked event spy on the setSource

@chunhtai chunhtai requested review from vashworth and camsim99 May 16, 2023 22:14
@chunhtai
Copy link
Contributor

added vashworth for ios and camsim99 for android

Copy link
Contributor

@camsim99 camsim99 left a comment

Choose a reason for hiding this comment

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

Android part LGTM!

ArgumentCaptor.forClass(AccessibilityEvent.class);
verify(mockParent).requestSendAccessibilityEvent(eq(mockRootView), eventCaptor.capture());
AccessibilityEvent event = eventCaptor.getAllValues().get(0);
assertEquals(event.getEventType(), AccessibilityEvent.TYPE_VIEW_FOCUSED);
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with this!

@@ -362,6 +362,10 @@ static bool DidFlagChange(const flutter::SemanticsNode& oldNode,
NSString* message = annotatedEvent[@"data"][@"message"];
ios_delegate_->PostAccessibilityNotification(UIAccessibilityAnnouncementNotification, message);
}
if ([type isEqualToString:@"focus"]) {
SemanticsObject* node = objects_.get()[annotatedEvent[@"nodeId"]];
ios_delegate_->PostAccessibilityNotification(UIAccessibilityLayoutChangedNotification, node);
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if node is nil? Seems like nil is an OK arg, but just double checking

Copy link
Member Author

Choose a reason for hiding this comment

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

Tested in my device, if node is nil, nothing will happen, the focus will not be changed

@hannah-hyj hannah-hyj requested a review from vashworth May 18, 2023 00:57
Copy link
Contributor

@vashworth vashworth left a comment

Choose a reason for hiding this comment

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

LGTM

@leighajarett leighajarett requested a review from hellohuanlin May 22, 2023 19:12
@chinmaygarde
Copy link
Member

Are we blocked on this?

@hellohuanlin
Copy link
Contributor

Nope. I think we can land it with @vashworth's stamp

@hannah-hyj hannah-hyj added the autosubmit Merge PR when tree becomes green via auto submit App label May 30, 2023
@auto-submit auto-submit bot merged commit 1ba8091 into flutter:main May 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 30, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request May 30, 2023
…127890)

flutter/engine@a6d3124...1ba8091

2023-05-30 jhy03261997@gmail.com Handle a11y focus event on Ios and android (flutter/engine#41777)
2023-05-30 matej.knopp@gmail.com Fix unitialized SkRect (flutter/engine#42403)
2023-05-30 reidbaker@google.com Update engine testing to use api 33 for android tests.  (flutter/engine#42351)
2023-05-30 gspencergoog@users.noreply.github.com Reland: "Adding app lifecycle notification for macOS and Linux, add `hidden` state." (#40542) (flutter/engine#42418)
2023-05-30 30870216+gaaclarke@users.noreply.github.com [Impeller] Fixed GlyphAtlasWithLotsOfdUniqueGlyphSize (flutter/engine#42423)
2023-05-30 54558023+keyonghan@users.noreply.github.com Remove legacy xcode properties/dependencies (flutter/engine#42368)
2023-05-30 skia-flutter-autoroll@skia.org Roll Skia from bab82f14da1a to fed417995ba9 (7 revisions) (flutter/engine#42424)
2023-05-30 30870216+gaaclarke@users.noreply.github.com [Impeller] removed vulkan unit test csv (flutter/engine#42354)
2023-05-30 skia-flutter-autoroll@skia.org Roll Skia from d22106cc40a0 to bab82f14da1a (7 revisions) (flutter/engine#42420)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC jonahwilliams@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-android platform-ios will affect goldens
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants