Skip to content

Conversation

@goderbauer
Copy link
Member

@goderbauer goderbauer commented Mar 6, 2019

Description

Include the platformViewId of PaltformViews in the semantics tree. The accessibility bridge in the engine can use this id to steal the semantics nodes from the actual platform view and stick them into Flutter's semantics tree.

This will require engine to be rolled to flutter/engine#8055.

Related Issues

#19418

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes tests for all changed/updated/fixed behaviors (See Test Coverage).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

Breaking change announcement: https://groups.google.com/forum/#!topic/flutter-announce/LoAfcK5IJ9A

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM with nit

Copy link
Contributor

@amirh amirh left a comment

Choose a reason for hiding this comment

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

Thanks!

Note that on Android the RenderAndroidView is created before the Android View (the platform view) is created. Is it possible to only update the id when the view is created? we could potentially wrap the OnPlatformViewCreated callback here and trigger update semantics?

Note that I'm not yet sure what's the plan for iOS and whether we'll need the semantic node there, but I guess we could always remove it later?

@goderbauer
Copy link
Member Author

I'll take out iOS for now. It's easy to add once we know what we actually need there.

@goderbauer goderbauer added the framework flutter/packages/flutter repository. See also f: labels. label Mar 6, 2019
@goderbauer
Copy link
Member Author

Changed it so that the platformViewId will only show up in the semantics tree if the platform view has been fully created. PTAL

Copy link
Contributor

@amirh amirh left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks!

@goderbauer goderbauer added the c: API break Backwards-incompatible API changes label Mar 7, 2019
@sjmcdowall
Copy link
Contributor

Does this HAVE to be a breaking change? Could you not still allow the construction arg as an optional and if present initialize the List of callbacks and still have the .addOnPlatformViewController to add (or create the first one) more? That way you save backwards compatibility at really no cost to anything?

@amirh
Copy link
Contributor

amirh commented Mar 7, 2019

@sjmcdowall it doesn't have to be a breaking change, I was thinking that no one yet is using this API directly(this class is pretty internal and also pretty new) in which case probably better to make a breaking change and keep the API cleaner.
Is this breaking your project?

If you look at the history for the PR it actually started with what you are suggesting, but we figured it's cleaner to keep a single symmetric add/remove API.

@sjmcdowall
Copy link
Contributor

@amirh -- Doesn't break my project, I was just commenting from 20+ years of experience that doing non-breaking changes are generally better than breaking ones. However, the use case here seems clean and the amount (and who has to do it) of work not very large. Cheers!

@amirh
Copy link
Contributor

amirh commented Mar 8, 2019

Totally agree we should try hard to avoid breaking changes.
In this specific case, I believe it's unlikely that someone is already using AndroidViewController directly (vs using AndroidView), so prefer to keep it cleaner while we can.

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@goderbauer goderbauer merged commit 816ae4b into flutter:master Mar 12, 2019
@goderbauer goderbauer deleted the platformSemantics branch March 12, 2019 14:44
cyanglaz pushed a commit that referenced this pull request Mar 27, 2019
Include the platformViewId of PlatformViews in the semantics tree. The accessibility bridge in the engine can use this id to steal the semantics nodes from the actual platform view and stick them into Flutter's semantics tree.

It is the iOS PlatformView counter part of #28953. It reverts the change in 5b5d6e8 and 03fd797.

#29302
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

c: API break Backwards-incompatible API changes framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants