-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Fix text field selection toolbar under Opacity #31097
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
|
WIP, the test won't pass until
|
fe5f3ba to
c8f09e9
Compare
c8f09e9 to
031a85c
Compare
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.
there's a Matrix4.translate method, which would make this more efficient
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.
Done.
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.
it's more efficient to just pump once with the required amount of time to skip the animation
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.
I've removed all the previous pumps. However, I couldn't change this pumpAndSettle to even pump(Duration(seconds: 100)) to pass the test. It'll pass with await tester.pump(); await tester.pump(Duration(seconds: 1)); though. Is this a bug or an expected behavior?
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.
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.
No idea why the order would change...
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.
looks like you still have pumpAndSettle?
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.
it's significantly preferred to use pump than pumpAndSettle, because pumpAndSettle will mask regressions.
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.
Changed to pump.
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.
One suggestion is to capture the return value of pumpAndSettle and expect the result of it (or expect that it's less than some sane value).
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.
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.
The return value would catch it but it's more likely that someone fixing it will just change the number and it's more likely that a reviewer will fail to notice that.
To catch issues like flutter/flutter#30586 flutter/flutter#31097 will trigger this CHECK if #8467 were reverted and the transform_ were not initialized in this PR.
|
Ping... |
As we've introduced offset to the Opacity layer, we have to override `applyTransform` to make Leader/FollowerLayer work correctly. Fixes flutter#30587 Together with flutter/engine#8585, this test will also exercise test against flutter#30586.
Otherwise, the order of "COPY/CUT/PASTE" will be somehow different and it'll cause a golden image mismatch.
324c26a to
e94307c
Compare
| assert(transform != null); | ||
| transform.translate(offset.dx, offset.dy); | ||
| } | ||
|
|
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.
fyi @goderbauer
goderbauer
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
| find.byType(Overlay), | ||
| matchesGoldenFile('text_field_opacity_test.0.0.png'), | ||
| ); | ||
| }, skip: !Platform.isLinux); |
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.
Do you really want to skip the entire test on all non-linux platforms? Or just the golden check? In the later, I'd recommend putting the skip on "expectLater". (It looks like everything else should also work on other platforms?)
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.
Good catch! Fixed.
|
This is breaking several devicelab tasks, and failing a golden check. Do these need to be updated, or were they unexpected? cc @liyuqian |
This reverts commit e427c2d.
This reverts commit 120a1fc.


Description
As we've introduced offset to the Opacity layer, we have to override
applyTransformto make Leader/FollowerLayer work correctly.Related Issues
Fixes #30587
Together with flutter/engine#8585,
this test will also exercise test against
#30586.
Tests
I added the following tests:
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?