-
Notifications
You must be signed in to change notification settings - Fork 309
msglist: Simplify safe-area handling; fix a small bug #8
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
msglist: Simplify safe-area handling; fix a small bug #8
Conversation
The user-visible effect was pretty small, so I didn't debug it fully in PR zulip#3: on my iPhone, before this commit, scrolling all the way down in the message list left about a centimeter, maybe less, between the bottom of the latest message and the top of the compose-box placeholder. Now, on my iPhone, scrolling down puts the bottom edge of the latest message flush with the top of the compose-box placeholder, as has been the case on devices without insets. I'm not sure if that's quite the effect we want, but if we want to add padding, we should do it on purpose. Addressing Greg's TODO in 88f3b73 would have prevented this bug from sneaking in; I'll take care of that next: // TODO have MessageListPage adjust the MediaQuery so we don't // have to worry about this here
This addresses Greg's TODO in 88f3b73: // TODO have MessageListPage adjust the MediaQuery so we don't // have to worry about this here Not seeing (experimentally) any more bugs like the one fixed in the previous commit, I'm marking this NFC.
2efb06c
to
11a4b15
Compare
Revision pushed, with 11a4b15 widgets/app [nfc]: Smoothen a wrinkle about MediaQuery.removePadding (I recently learned about the |
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! Looks good, with small nits below.
lib/widgets/app.dart
Outdated
// The compose box pads the bottom inset. | ||
removeBottom: true, | ||
|
||
child: const Expanded(child: MessageList())), |
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 MessageList gets a bit lost here for me, visually — that is, it's easy to miss when looking for the main payload of this widget tree. Let's give it its own line:
child: const Expanded(child: MessageList())), | |
child: const Expanded( | |
child: MessageList())), |
lib/widgets/app.dart
Outdated
child: const Expanded(child: MessageList())), | ||
const SizedBox( | ||
height: 80, | ||
child: Center(child: Text("(Compose box goes here.)")))])))); |
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.
Similarly:
child: Center(child: Text("(Compose box goes here.)")))])))); | |
child: Center( | |
child: Text("(Compose box goes here.)")))])))); |
lib/widgets/app.dart
Outdated
child: Center(child: Text("(Compose box goes here.)"))), | ||
]))); | ||
|
||
// See MediaQuery.removePadding for why we need this BuildContext. |
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 comment can be dropped; when a reader wants to know why we need this BuildContext, they'll naturally look to where it's used, and that tells them the same information that's in the comment.
11a4b15
to
57294ea
Compare
Thanks for the review! Revision pushed. |
Thanks! Looks good; merging. |
This addresses Greg's TODO in 88f3b73:
// TODO have MessageListPage adjust the MediaQuery so we don't
// have to worry about this here
with a bugfix beforehand, so that resolving the TODO is NFC (or at least seems to be, experimentally).