-
Notifications
You must be signed in to change notification settings - Fork 350
settings: Make page scrollable #1911
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
|
Thanks for taking care of this! Before we can review this change, it will need a test. Those screenshots and recordings are very helpful, thanks. One remark: there's nothing unreasonable about the large text size — people vary in how sharp their vision is, and for some people that setting is useful by making it possible to read the text on the screen. |
499c590 to
4685d90
Compare
|
Thank you @gnprice for reminding about the test. I have added the test for scrolling in the latest commit. I have limited the screen size to 200x200px to test the scrolling effect as lower down to 100x100px caused some rendering issue while running the test. |
chrisbobbe
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! Comments below.
For the commit message:
settings: Add scroll for settings page
This commit replaced Column with
ListView Widget to enable scrolling effect.
- It needs a
Fixes #<issue number>.line, like other commits that fix issues in the tracker. - The sentence in the body isn't needed; it just restates what's already obvious from reading the diff.
- For the summary line, "add scroll" sounds a little odd to me; how about
settings: Make page scrollable.
test/widgets/settings_test.dart
Outdated
| }, variant: TargetPlatformVariant({TargetPlatform.android, TargetPlatform.iOS})); | ||
| }); | ||
|
|
||
| group('SettingPageScrollBehavior', () { |
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.
This string looks like an identifier, like the name of a class or something, but then I don't find anything when I look for its definition. To be less confusing, we should just say "SettingsPage scroll behavior" or similar. (SettingsPage is the name of a class, so it doesn't add confusion to use that name.)
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.
Also nit: the test groups are now in this order:
- 'ThemeSetting'
- 'BrowserPreference'
- (this group)
- 'VisitFirstUnreadSetting'
- 'MarkReadOnScrollSetting'
To be more organized, let's put the new group before the groups that are about individual settings, instead of in the middle of them.
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, Moving it to the top seems reasonable here.
test/widgets/settings_test.dart
Outdated
| final lastElementFinder = GlobalSettingsStore.experimentalFeatureFlags.isNotEmpty | ||
| ? find.text("Experimental features") | ||
| : find.text("Mark messages as read on scroll"); | ||
| check(lastElementFinder.evaluate().isEmpty).equals(true); |
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.
nit: how about check(lastElementFinder).findsNothing();
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 thought to test that the row isn't visible before scrolling. We want to be sure that the scrolling is actually what causes the row to become visible, rather than some other factor, which could arise in the future, like the settings being presented in a different order than when we wrote this test.)
test/widgets/settings_test.dart
Outdated
|
|
||
| await tester.scrollUntilVisible(lastElementFinder, 100, | ||
| scrollable: find.byType(Scrollable)); | ||
| check(lastElementFinder.evaluate().isEmpty).equals(false); |
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.
nit: how about `check(lastElementFinder).findsOne();
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.
Seems more high level.
test/widgets/settings_test.dart
Outdated
| final lastElementFinder = GlobalSettingsStore.experimentalFeatureFlags.isNotEmpty | ||
| ? find.text("Experimental features") | ||
| : find.text("Mark messages as read on scroll"); |
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.
| final lastElementFinder = GlobalSettingsStore.experimentalFeatureFlags.isNotEmpty | |
| ? find.text("Experimental features") | |
| : find.text("Mark messages as read on scroll"); | |
| final lastElementFinder = GlobalSettingsStore.experimentalFeatureFlags.isNotEmpty | |
| ? find.text("Experimental features") | |
| : find.text("Mark messages as read on scroll"); |
test/widgets/settings_test.dart
Outdated
| }); | ||
|
|
||
| group('SettingPageScrollBehavior', () { | ||
| testWidgets('scroll settings list when screen size is small', (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.
nit:
| testWidgets('scroll settings list when screen size is small', (tester) async { | |
| testWidgets('content is scrollable when taller than a screenful', (tester) async { |
(Helps focus the reader on what the test's purpose is, and acknowledges that the test can still be helpful when the screen is normal-sized, in a future where the list of settings is much longer.)
4685d90 to
08e169b
Compare
|
Thank you @chrisbobbe for taking time to review, all the requested changes and some other nits have been pushed. |
|
Bump on #1911 (review) :
Bump on #1911 (comment) :
|
08e169b to
b5dea17
Compare
|
Thanks @chrisbobbe for pointing out the issue. The following has been corrected
|
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!
From the Git history (see Greg's "secret" to using git log -p, you can see we tend to use
but not "Fixes #1904". (I think we're converging on option 1, which is what the Flutter project uses?)
|
Yeah, I like option 1 of those. (That's what Flutter upstream uses, and I like how it sets context for what the rest of the commit message will be about.) It's probably past time we should take the old style guide from zulip-mobile, copy the parts that apply here, and add that to this repo. This will be a good thing to write there. |
b5dea17 to
832f918
Compare
|
Thank you @chrisbobbe and @gnprice for the clarification, the commit description has been updated with the option 1 as recommended:
|
|
"Fixes #1904." |
832f918 to
a842403
Compare
|
Thank you @chrisbobbe for noticing the typo. Commit description changed to:
|
|
Marking for Greg's review; thank you. |
gnprice
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 @MritunjayTiwari14 for taking care of this, and thanks @chrisbobbe for the previous reviews! Just small comments below.
| appBar: ZulipAppBar( | ||
| title: Text(zulipLocalizations.settingsPageTitle)), | ||
| body: Column(children: [ | ||
| body: ListView(children: [ |
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.
settings: Make page scrollable
Fixes #1904.
The body should be separated from the summary line by a blank line, so that it makes its own paragraph.
test/widgets/settings_test.dart
Outdated
| await tester.scrollUntilVisible(lastElementFinder, 100, | ||
| scrollable: find.byType(Scrollable)); |
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.
This value for the scrollable option is the default behavior, right? So can leave it out.
test/widgets/settings_test.dart
Outdated
| group('SettingsPage scroll behavior', () { | ||
| testWidgets('content is scrollable when taller than a screenful', (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.
nit: can simplify by not wrapping this test in a group (since it was the only thing there anyway):
| group('SettingsPage scroll behavior', () { | |
| testWidgets('content is scrollable when taller than a screenful', (tester) async { | |
| testWidgets('SettingsPage content is scrollable when taller than a screenful', (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.
bump — I do think the "SettingsPage" part is helpful, for setting context when this test case goes by in flutter test output
a842403 to
f2d5b48
Compare
|
Thank you @gnprice for the review. The following has been changed in the latest commit:
|
187fce7 to
ef31267
Compare
|
Yes @gnprice, it would be right to provide context instead of just saying content, even though the test belong to SettingsPage . The context of content within SettingsPage can vary. So in the latest changes the following has been accommodated:
|
|
Thanks! Looks good; merging. |
Video Recordings
Before
before.mp4
After (Normal)
after.mp4
After (Increased Text Size to unreasonably high in android settings to test edge case)
after_increased_text_size_too_much_in_android_settings_edge_case.mp4
Fixes #1904