Skip to content

Suppress repeated recipient headers #174

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

Closed
gnprice opened this issue Jun 9, 2023 · 1 comment · Fixed by #300
Closed

Suppress repeated recipient headers #174

gnprice opened this issue Jun 9, 2023 · 1 comment · Fixed by #300
Assignees
Labels
a-msglist The message-list screen, except what's label:a-content a-sticky_header Our `sticky_header` library
Milestone

Comments

@gnprice
Copy link
Member

gnprice commented Jun 9, 2023

In Zulip web and zulip-mobile, when consecutive messages have the same recipient information, we don't repeat the recipient header. This makes a big difference for the flow of reading a conversation, and we should do the same.

If we do a version of this before we have date separators #173, then we should repeat the recipient header when the date changes, in order to show the new date (with #172). If we already have #173, then we should suppress recipient headers across dates too.

@gnprice gnprice added the a-msglist The message-list screen, except what's label:a-content label Jun 9, 2023
@gnprice gnprice added this to the Alpha milestone Jun 9, 2023
@gnprice gnprice self-assigned this Jul 17, 2023
@gnprice
Copy link
Member Author

gnprice commented Jul 17, 2023

I have a draft branch for this feature (and #175).

The complicated part (and this was predictable once you think through it, but I didn't realize it until I picked this up the other day) is that this requires reworking our approach to making the recipient headers sticky.

  • Our current sticky-header implementation (which I built back in December, a week into the experimental prototype, largely just to find out how easily we could do so) calls for a list item to have a header and a body. When the item is in view in the middle or bottom of the list's viewport, the header is laid out vertically above the body; when the item is partially scrolled off the top, the header sticks to the top of the viewport and paints over the body; as the item approaches being scrolled all the way off the top, the header catches on the bottom of the item and scrolls off with it.
    • (The list item includes the padding between the message and the message after it, in order to get the gapless effect where the header appears to get pushed off the top of the viewport by the header below it.)
  • This means that any list item that is going to supply a sticky header must also show the same header when it's not at the top of the viewport. Which works fine when each message has its own header, as in the current prototype.
  • But when repeated recipient headers are suppressed, that means many messages will not show a header when they're in the middle or bottom of the viewport… and yet when one of those same messages is the one at the top of the viewport, we do want a sticky header for it.
  • From a user perspective, the sticky recipient header that appears when a given message is at the top of the viewport corresponds to the header that appears at the top of the entire block that that message belongs to. So it would be possible to use the existing sticky-header implementation by having the list item be that entire block. But that would mean that the unit of laziness for the list would be the entire block — whenever any part of the block was in view, we'd build and lay out the entire block. And that may be an unbounded number of messages, potentially all of the hundreds or thousands of messages we know of in the current narrow. Effectively that would largely defeat the performance benefits of a ListView.
  • So we want something different. My draft branch includes an overhaul of lib/widgets/sticky_header.dart.

gnprice added a commit to gnprice/zulip-flutter that referenced this issue Aug 31, 2023
In particular this gives us two features we'll want in the Zulip
message list when we go to make recipient headers appear only
where needed (zulip#174):

 * An item's header now gets built (and laid out and painted) only if
   the item is actually the one at the relevant edge of the viewport
   such that the stickiness comes into play.  This lets us attach a
   sticky header to every message, even when it shares a recipient
   header with the message that comes before it.

 * An item can now (optionally) allow the header's stickiness at the
   edge of the viewport to take precedence over the header's
   confinement within the item's own bounds.  We'll use this to let
   the header stay pinned when scrolling between items that share a
   recipient header.
gnprice added a commit to gnprice/zulip-flutter that referenced this issue Sep 7, 2023
chrisbobbe pushed a commit that referenced this issue Sep 8, 2023
@gnprice gnprice added the a-sticky_header Our `sticky_header` library label Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-msglist The message-list screen, except what's label:a-content a-sticky_header Our `sticky_header` library
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant