Skip to content

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

Merged
merged 4 commits into from
Feb 17, 2023

Conversation

chrisbobbe
Copy link
Collaborator

@chrisbobbe chrisbobbe commented Feb 8, 2023

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).

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.
@chrisbobbe chrisbobbe force-pushed the pr-simplify-safe-area-handling branch from 2efb06c to 11a4b15 Compare February 13, 2023 23:14
@chrisbobbe
Copy link
Collaborator Author

chrisbobbe commented Feb 13, 2023

Revision pushed, with

11a4b15 widgets/app [nfc]: Smoothen a wrinkle about MediaQuery.removePadding

(I recently learned about the Builder widget. 🙂)

Copy link
Member

@gnprice gnprice left a 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.

// The compose box pads the bottom inset.
removeBottom: true,

child: const Expanded(child: MessageList())),
Copy link
Member

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:

Suggested change
child: const Expanded(child: MessageList())),
child: const Expanded(
child: MessageList())),

child: const Expanded(child: MessageList())),
const SizedBox(
height: 80,
child: Center(child: Text("(Compose box goes here.)")))]))));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly:

Suggested change
child: Center(child: Text("(Compose box goes here.)")))]))));
child: Center(
child: Text("(Compose box goes here.)")))]))));

child: Center(child: Text("(Compose box goes here.)"))),
])));

// See MediaQuery.removePadding for why we need this BuildContext.
Copy link
Member

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.

@chrisbobbe chrisbobbe force-pushed the pr-simplify-safe-area-handling branch from 11a4b15 to 57294ea Compare February 16, 2023 23:29
@chrisbobbe
Copy link
Collaborator Author

Thanks for the review! Revision pushed.

@gnprice
Copy link
Member

gnprice commented Feb 17, 2023

Thanks! Looks good; merging.

@gnprice gnprice merged commit 57294ea into zulip:main Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants