-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Reland update bottom navigation bar test for m3 #137998
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
Reland update bottom navigation bar test for m3 #137998
Conversation
|
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. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
@Piinks This is an attempt to reland #136624, I found Unfortunately, you won't be able to push commits to this PR because it belongs to the Nevercode organisation on Github. For this same reason, Taha switched to a personnal fork some months ago, I will switch too as soon as possible as It would be easier for you. |
Piinks
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.
Just QQ about web using the sparkle
| // Regression test for: https://github.com/flutter/flutter/issues/22226 | ||
| Widget runTest() { | ||
| int currentIndex = 0; | ||
| const bool useInkSparkle = !kIsWeb; |
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.
Why not on web?
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 am pretty sure web supports shaders now, I wonder if we need to update the InkSparkle then...
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 don't think InkSparkle shader would work on web + Android mobile (web might support shaders but it is probably on CanvasKit). But we might need to ask someone who knows more.
InkSparkle documentation explicitly mentionned it is not supported with the HTML renderer, see
flutter/packages/flutter/lib/src/material/ink_sparkle.dart
Lines 17 to 18 in 6e9d4cc
| /// This effect relies on a shader and therefore is unsupported on the Flutter | |
| /// Web HTML backend. |
As of today InkSparkle is deactived on Web. For instance, the useInkSparkle variable I used in this test is direcly inspired by the ThemeData implementation, see
| final bool useInkSparkle = platform == TargetPlatform.android && !kIsWeb; |
And tests for InkSparkle are deactivated on Web, see
| skip: kIsWeb, // [intended] shaders are not yet supported for web. |
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.
Yeah I inquired about this yesterday after I noticed the same in the docs. I know that shaders are supported in canvaskit, maybe we need to update the sparkle and the docs to have it on canvaskit then? We could use this flag: https://api.flutter.dev/flutter/foundation/isCanvasKit.html
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.
(We could also file a bug about this and follow up in a separate 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.
FYI, I filed #138487.
|
|
||
| return MaterialApp( | ||
| // Because this test relies on golden, fo a constant seed for the ink sparkle animation. | ||
| theme: ThemeData(splashFactory: useInkSparkle ? InkSparkle.constantTurbulenceSeedSplashFactory : null), |
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.
Yes! constantTurbulenceSeedSplashFactory should eliminate the randomness we saw in the previous PR. 👍
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.
Just double checking - this is the only test in this PR with the sparkle?
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.
Yes, this is the only golden test in this PR.
For future M3 test migration PRs, this issue will surface on any golden test that simulates a tap on a widget tree that contains an InkWell. I don't know if there are a lot of them, the tricky part will be to be aware of this (Taha and me will take care on our migration PRs).
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.
Yeah, I wonder, should we create an M3 test utility for this? You could create just a simple wrapper class that creates a MaterialApp with the turbulence seed set, and then re-use it in every M3 test so we'll know it is consistently being applied.
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.
Oh! Actually scratch that. How about this instead - let's update InkSparkle so that in debug mode it always uses the fixed turbulence seed. That would be the best way to prevent this issue from reoccurring. Probably in the InkSparkle constructor, set the seed in an assert statement so in debug mode (including tests) it will always be fixed and consistent!
cc @TahaTesser
Piinks
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
|
I will push an update once #138757 will be merged. |
Manual roll requested by [email protected] flutter/flutter@9c9e061...ab721f9 2023-11-21 [email protected] Roll Flutter Engine from 6da31e1bff67 to 746697c27569 (1 revision) (flutter/flutter#138826) 2023-11-21 [email protected] Add mhbdev to AUTHORS (flutter/flutter#138311) 2023-11-21 [email protected] Manual roll Flutter Engine from 70b1c7341255 to 6da31e1bff67 (10 revisions) (flutter/flutter#138817) 2023-11-21 [email protected] Fix Chips with Tooltip throw an assertion when enabling or disabling (flutter/flutter#138799) 2023-11-21 [email protected] Roll Packages from c5443ad to c9933fc (2 revisions) (flutter/flutter#138809) 2023-11-21 [email protected] Roll Flutter Engine from 3348fb0ca302 to 70b1c7341255 (1 revision) (flutter/flutter#138774) 2023-11-21 [email protected] Roll Flutter Engine from f3e9b38a2588 to 3348fb0ca302 (1 revision) (flutter/flutter#138772) 2023-11-21 [email protected] Roll Flutter Engine from 39fb4581cff2 to f3e9b38a2588 (3 revisions) (flutter/flutter#138770) 2023-11-21 [email protected] Add dartdoc warnings (flutter/flutter#138766) 2023-11-21 [email protected] Roll Flutter Engine from 6e8e55ef1a7f to 39fb4581cff2 (2 revisions) (flutter/flutter#138765) 2023-11-20 [email protected] Added Features requested in #137530 (flutter/flutter#137532) 2023-11-20 [email protected] Bump dartdoc to 7.0.2 (flutter/flutter#138760) 2023-11-20 [email protected] Roll Flutter Engine from 7a31543b4630 to 6e8e55ef1a7f (4 revisions) (flutter/flutter#138761) 2023-11-20 [email protected] [Reland] Introduce `AnimationStyle` (flutter/flutter#138721) 2023-11-20 [email protected] Roll Flutter Engine from 337ab58e81f7 to 7a31543b4630 (2 revisions) (flutter/flutter#138759) 2023-11-20 [email protected] Reland update bottom navigation bar test for m3 (flutter/flutter#137998) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
|
So just to be clear, |
This is a reland of #136624 which was reverted because one new M3 golden test failed. The failure was related to the ink sparkle animation.
Ink sparkle is the M3 default animation, it does not play well with golden because it introduces an element of randomness.
One way to avoid this randomness is to use the
InkSparkle.constantTurbulenceSeedSplashFactory.This PR has two commits:
InkSparkle.constantTurbulenceSeedSplashFactory.