-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Include platformViewId in semantics tree #28953
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
jonahwilliams
left a comment
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.
LGTM with nit
amirh
left a comment
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.
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?
|
I'll take out iOS for now. It's easy to add once we know what we actually need there. |
|
Changed it so that the platformViewId will only show up in the semantics tree if the platform view has been fully created. PTAL |
amirh
left a comment
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.
LGTM
Thanks!
|
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? |
|
@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. 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. |
|
@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! |
|
Totally agree we should try hard to avoid breaking changes. |
98b8fba to
c0d9ef8
Compare
c0d9ef8 to
8dff1ac
Compare
jonahwilliams
left a comment
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.
LGTM
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
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.///).flutter analyze --flutter-repo) does not report any problems on my PR.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