-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[Fix]: showDateRangePicker with "large" helpText cutoffs the save button #146049
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
nate-thegrate
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.
Sorry for my poor explanation earlier—I think it'd be best to keep the existing test as-is, and add another test to cover this bugfix.
// existing test, unchanged
testWidgets('Save and help text is used', (WidgetTester tester) async {
helpText = 'help';
saveText = 'make it so';
await preparePicker(tester, (Future<DateTimeRange?> range) async {
expect(find.text(helpText!), findsOneWidget);
expect(find.text(saveText!), findsOneWidget);
});
});
// we should add a test like this
testWidgets("long helpText string doesn't cut off the 'save' button", (WidgetTester tester) async {
helpText = 'long string' * 20;
saveText = 'make it so';
await preparePicker(tester, (Future<DateTimeRange?> range) async {
expect(find.text(helpText!), findsOneWidget);
expect(find.text(saveText!), findsOneWidget);
});
});P.S. I don't have write access in this repository, so you'll need an approval from @MitchellGoodwin and 1 other person :)
MitchellGoodwin
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. Thank you for putting this together!
justinmc
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 nits, and assuming that the Google tests pass. This could break image diff tests I think.
| }); | ||
| }); | ||
|
|
||
| testWidgets('Long helpText cant not cutoffs the save button', (WidgetTester tester) async { |
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.
'Long helpText does not cutoff the save button'
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.
@justinmc Thanks for your review, I have updated the test.
| saveText = 'make it so'; | ||
| await preparePicker(tester, (Future<DateTimeRange?> range) async { | ||
| expect(find.text(helpText!), findsOneWidget); | ||
| expect(find.text(saveText!), findsOneWidget); |
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 looks like this test will fail on master due to layout overflow, not due to these expectations. So I would add this line here: expect(tester.takeException(), 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.
@justinmc Thanks for your review, I have updated the test.
justinmc
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.
Sorry, forgot to check "approve".
@justinmc Thank you , can your review again |
| await preparePicker(tester, (Future<DateTimeRange?> range) async { | ||
| expect(find.text(helpText!), findsOneWidget); | ||
| expect(find.text(saveText!), findsOneWidget); | ||
| expect(tester.takeException(), 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.
I think it would be better to have the check you had before and this one. So both this .takeException() and the check for helpText and saveText.
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 believe the check for helpText and saveText is already there; the most recent commit reverted the change to that test and added a new one instead.
Here's what the branch looks like currently:
flutter/packages/flutter/test/material/date_range_picker_test.dart
Lines 261 to 277 in 3c26c7d
| testWidgets('Save and help text is used', (WidgetTester tester) async { | |
| helpText = 'help'; | |
| saveText = 'make it so'; | |
| await preparePicker(tester, (Future<DateTimeRange?> range) async { | |
| expect(find.text(helpText!), findsOneWidget); | |
| expect(find.text(saveText!), findsOneWidget); | |
| }); | |
| }); | |
| testWidgets('Long helpText does not cutoff the save button', (WidgetTester tester) async { | |
| helpText = 'long helpText' * 100; | |
| await preparePicker(tester, (Future<DateTimeRange?> range) async { | |
| expect(tester.takeException(), 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.
I meant that the test with the long help text should also still check for the save button. That old test should not be touched as well.
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 misunderstood 😅
Yeah, that makes sense!
| expect(tester.takeException(), null); | |
| expect(tester.takeException(), null); | |
| expect(find.text(helpText!), findsOneWidget); | |
| expect(find.text(saveText!), findsOneWidget); |
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.
@MitchellGoodwin Thank you for the review, sorry for my misunderstanding, I have changed the test.
flutter/flutter@db8c475...b597dd2 2024-04-30 [email protected] Roll Flutter Engine from 2c1517bbf555 to 0ce67714ce4c (1 revision) (flutter/flutter#147585) 2024-04-30 [email protected] Roll Packages from 87a7c51 to cc47b06 (5 revisions) (flutter/flutter#147580) 2024-04-30 [email protected] Roll Flutter Engine from 1a6ef9957b24 to 2c1517bbf555 (1 revision) (flutter/flutter#147579) 2024-04-30 [email protected] Roll Flutter Engine from 64877c08661d to 1a6ef9957b24 (1 revision) (flutter/flutter#147576) 2024-04-30 [email protected] Roll Flutter Engine from 1d62704cb3d2 to 64877c08661d (1 revision) (flutter/flutter#147567) 2024-04-30 [email protected] Roll Flutter Engine from aace42365fc7 to 1d62704cb3d2 (2 revisions) (flutter/flutter#147566) 2024-04-30 [email protected] Roll Flutter Engine from ea6343846c62 to aace42365fc7 (2 revisions) (flutter/flutter#147563) 2024-04-30 [email protected] Roll Flutter Engine from c519e9dd182b to ea6343846c62 (1 revision) (flutter/flutter#147560) 2024-04-30 [email protected] Roll Flutter Engine from 27bb23221305 to c519e9dd182b (1 revision) (flutter/flutter#147557) 2024-04-30 [email protected] Roll Flutter Engine from 93ccb9ab2cda to 27bb23221305 (2 revisions) (flutter/flutter#147556) 2024-04-30 [email protected] Roll Flutter Engine from c093562677fa to 93ccb9ab2cda (1 revision) (flutter/flutter#147553) 2024-04-29 [email protected] Bump dependencies in Flutter (flutter/flutter#147546) 2024-04-29 [email protected] Add configurable hitTestBehavior to Scrollable (flutter/flutter#146403) 2024-04-29 [email protected] Fix wide `DatePicker` input mode button padding for Material 3 (flutter/flutter#147236) 2024-04-29 [email protected] Roll Flutter Engine from 13c7ac9376a5 to c093562677fa (1 revision) (flutter/flutter#147547) 2024-04-29 [email protected] Roll Flutter Engine from 5165c711771c to 13c7ac9376a5 (1 revision) (flutter/flutter#147542) 2024-04-29 [email protected] Roll Packages from dd01140 to 87a7c51 (2 revisions) (flutter/flutter#147539) 2024-04-29 [email protected] Roll Flutter Engine from 399837d38807 to 5165c711771c (2 revisions) (flutter/flutter#147537) 2024-04-29 [email protected] [Fix]: showDateRangePicker with "large" helpText cutoffs the save button (flutter/flutter#146049) 2024-04-29 [email protected] Roll Flutter Engine from 752b146df767 to 399837d38807 (10 revisions) (flutter/flutter#147532) 2024-04-29 [email protected] Add ability to disable `FloatingActionButton` scale and rotation animations using `FloatingActionButtonAnimator.noAnimation` (flutter/flutter#146126) 2024-04-29 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Flutter Engine from 752b146df767 to f4c20e97e6aa (2 revisions) (#147495)" (flutter/flutter#147502) 2024-04-28 [email protected] Roll Flutter Engine from 752b146df767 to f4c20e97e6aa (2 revisions) (flutter/flutter#147495) 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
flutter/flutter@db8c475...b597dd2 2024-04-30 [email protected] Roll Flutter Engine from 2c1517bbf555 to 0ce67714ce4c (1 revision) (flutter/flutter#147585) 2024-04-30 [email protected] Roll Packages from 87a7c51 to cc47b06 (5 revisions) (flutter/flutter#147580) 2024-04-30 [email protected] Roll Flutter Engine from 1a6ef9957b24 to 2c1517bbf555 (1 revision) (flutter/flutter#147579) 2024-04-30 [email protected] Roll Flutter Engine from 64877c08661d to 1a6ef9957b24 (1 revision) (flutter/flutter#147576) 2024-04-30 [email protected] Roll Flutter Engine from 1d62704cb3d2 to 64877c08661d (1 revision) (flutter/flutter#147567) 2024-04-30 [email protected] Roll Flutter Engine from aace42365fc7 to 1d62704cb3d2 (2 revisions) (flutter/flutter#147566) 2024-04-30 [email protected] Roll Flutter Engine from ea6343846c62 to aace42365fc7 (2 revisions) (flutter/flutter#147563) 2024-04-30 [email protected] Roll Flutter Engine from c519e9dd182b to ea6343846c62 (1 revision) (flutter/flutter#147560) 2024-04-30 [email protected] Roll Flutter Engine from 27bb23221305 to c519e9dd182b (1 revision) (flutter/flutter#147557) 2024-04-30 [email protected] Roll Flutter Engine from 93ccb9ab2cda to 27bb23221305 (2 revisions) (flutter/flutter#147556) 2024-04-30 [email protected] Roll Flutter Engine from c093562677fa to 93ccb9ab2cda (1 revision) (flutter/flutter#147553) 2024-04-29 [email protected] Bump dependencies in Flutter (flutter/flutter#147546) 2024-04-29 [email protected] Add configurable hitTestBehavior to Scrollable (flutter/flutter#146403) 2024-04-29 [email protected] Fix wide `DatePicker` input mode button padding for Material 3 (flutter/flutter#147236) 2024-04-29 [email protected] Roll Flutter Engine from 13c7ac9376a5 to c093562677fa (1 revision) (flutter/flutter#147547) 2024-04-29 [email protected] Roll Flutter Engine from 5165c711771c to 13c7ac9376a5 (1 revision) (flutter/flutter#147542) 2024-04-29 [email protected] Roll Packages from dd01140 to 87a7c51 (2 revisions) (flutter/flutter#147539) 2024-04-29 [email protected] Roll Flutter Engine from 399837d38807 to 5165c711771c (2 revisions) (flutter/flutter#147537) 2024-04-29 [email protected] [Fix]: showDateRangePicker with "large" helpText cutoffs the save button (flutter/flutter#146049) 2024-04-29 [email protected] Roll Flutter Engine from 752b146df767 to 399837d38807 (10 revisions) (flutter/flutter#147532) 2024-04-29 [email protected] Add ability to disable `FloatingActionButton` scale and rotation animations using `FloatingActionButtonAnimator.noAnimation` (flutter/flutter#146126) 2024-04-29 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Flutter Engine from 752b146df767 to f4c20e97e6aa (2 revisions) (#147495)" (flutter/flutter#147502) 2024-04-28 [email protected] Roll Flutter Engine from 752b146df767 to f4c20e97e6aa (2 revisions) (flutter/flutter#147495) 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
Fix #146039
Pre-launch Checklist
If you need help, consider asking for advice on the #hackers-new channel on Discord.