flutter
flutter copied to clipboard
synchronously flush semantics when semantics is enabled
This is an attempt to reduce initial data delay when android or iOS tries to query semantics tree.
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, including Features we expect every widget to implement.
- [ ] I signed the CLA.
- [ ] I listed at least one issue that this PR fixes in the description above.
- [ ] I updated/added relevant documentation (doc comments with
///). - [ ] I added new tests to check the change I am making, or this PR is test-exempt.
- [ ] I followed the breaking change policy and added Data Driven Fixes where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel on Discord.
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.
I am pretty sure something will be broken, just that we don't have good semantics test coverage on this part. will add more test.
@jonahwilliams would like to get your opinion first to see if this is something we should do
Sorry I missed this completely. I'm not certain why we wouldn't do this, though I admit I haven't looked at this code in a while
Sorry I missed this completely. I'm not certain why we wouldn't do this, though I admit I haven't looked at this code in a while
Agree, will ping again after appropriate tests are added
@chunhtai Do you need a new reviewer here?
This is not yet ready, I will try to get to this pr soon
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.
For more guidance, visit Writing a golden file test for package:flutter.
Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.
but do we have stats for how long it usually takes to flushSemantics without cache (bench_material3_semantics
I don't think this would be too risky as this is a one time thing, and without this PR the delay will just be on the next frame instead of the current frame.
Yeah 3ms (as indicated by the web benchmark) when the user turns a11y on doesn't sound too bad. But I'm curious if there's an issue for this / is there a way to experience the current a11y delay myself?
If not now, the delay it would be on the next frame without this change. in terms of talkback reaction time, it is already bad when the talkback turns on, it usually take some seconds before it start polling for ANI.
My local testing is actually smoother with this change. My guess is a slight delay and return synchrnously is better than return empty ANI first and waiting for talkback's next polling
@chunhtai Heads up that this has conflicts.