Skip to content

Open a message list in the middle of history, when requested #82

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

Open
gnprice opened this issue Apr 21, 2023 · 2 comments · May be fixed by #1288
Open

Open a message list in the middle of history, when requested #82

gnprice opened this issue Apr 21, 2023 · 2 comments · May be fixed by #1288
Assignees
Labels
a-msglist The message-list screen, except what's label:a-content beta feedback Things beta users have specifically asked for

Comments

@gnprice
Copy link
Member

gnprice commented Apr 21, 2023

When the user takes an action that should navigate to a particular "anchor" message (like through #73 internal links, #76 deep links, or a notification), we should take them straight to that message, rather than to the latest message or first unread message in the narrow.

This is a feature the zulip-mobile RN app lacks: zulip/zulip-mobile#3604 . (That's for internal links, but the app doesn't have it for notifications either — see narrowToNotification which passes no anchor to doNarrow — and doesn't have deep links.)

There are two parts to this:

  • Fetch the messages around the desired anchor, rather than around the latest message or the first unread.
  • Control the scroll position so that we show the desired anchor message.

This has a lot in common with:

This issue has fewer prerequisites technically than #80 — no need for #79 first. On the other hand it has more prerequisites before there's a UX context where it makes sense: it'd need either #73, #76, or notifications, all of which are more complex than #79.

@gnprice gnprice added the a-msglist The message-list screen, except what's label:a-content label May 27, 2023
@gnprice gnprice added this to the Beta milestone Jun 14, 2023
gnprice added a commit that referenced this issue Jun 14, 2023
Filed #187, #188, and #190.

Other items already existed as #80, #82, #95, #122, and #123,
or were already complete (a compose box, and three ways of
attaching something to a message.)
@gnprice gnprice modified the milestones: Beta, Launch Sep 22, 2023
gnprice added a commit to gnprice/zulip-flutter that referenced this issue Jan 30, 2024
This means that the overall scroll view has AxisDirection.down
as the scroll direction, rather than AxisDirection.up, and the
SliverStickyHeader is passed GrowthDirection.reverse instead
of GrowthDirection.forward in order to get the same effect.

This makes the scrolling a little easier to think about when focused
on MessageList's code, because for example (as seen in this diff)
`scrollMetrics.extentBefore` now refers to the messages that are
older than the ones on screen, rather than those that are newer.

This also brings us closer to the setup we'll want for zulip#80 and zulip#82,
opening the message list at an anchor other than the end: the empty
placeholder sliver at the bottom will become the list of messages
after the starting anchor, while the sliver at the top will remain
the list of messages above the anchor.
gnprice added a commit to gnprice/zulip-flutter that referenced this issue Jan 30, 2024
This means that the overall scroll view has AxisDirection.down
as the scroll direction, rather than AxisDirection.up, and the
SliverStickyHeader is passed GrowthDirection.reverse instead
of GrowthDirection.forward in order to get the same effect.

This makes the scrolling a little easier to think about when focused
on MessageList's code, because for example (as seen in this diff)
`scrollMetrics.extentBefore` now refers to the messages that are
older than the ones on screen, rather than those that are newer.

This also brings us closer to the setup we'll want for zulip#80 and zulip#82,
opening the message list at an anchor other than the end: the empty
placeholder sliver at the bottom will become the list of messages
after the starting anchor, while the sliver at the top will remain
the list of messages above the anchor.
chrisbobbe pushed a commit that referenced this issue Jan 30, 2024
This means that the overall scroll view has AxisDirection.down
as the scroll direction, rather than AxisDirection.up, and the
SliverStickyHeader is passed GrowthDirection.reverse instead
of GrowthDirection.forward in order to get the same effect.

This makes the scrolling a little easier to think about when focused
on MessageList's code, because for example (as seen in this diff)
`scrollMetrics.extentBefore` now refers to the messages that are
older than the ones on screen, rather than those that are newer.

This also brings us closer to the setup we'll want for #80 and #82,
opening the message list at an anchor other than the end: the empty
placeholder sliver at the bottom will become the list of messages
after the starting anchor, while the sliver at the top will remain
the list of messages above the anchor.
@gnprice gnprice modified the milestones: Launch, B2: Summer 2024 May 9, 2024
@gnprice gnprice modified the milestones: Beta 3: Summer 2024, Launch Sep 10, 2024
@E-m-i-n-e-n-c-e E-m-i-n-e-n-c-e linked a pull request Jan 19, 2025 that will close this issue
@E-m-i-n-e-n-c-e
Copy link
Contributor

Started working on this.

https://chat.zulip.org/#narrow/channel/516-mobile-dev-help/topic/Control.20scroll.20position.20on.20new.20and.20newly-fetched.20messages

20250119-1825-45.3281596.mp4
20250119-1831-50.5506127.mp4

gnprice added a commit to gnprice/zulip-flutter that referenced this issue Feb 14, 2025
There are still some bugs affecting the sticky_header library when a
SliverStickyHeaderList occupies only part of the viewport (which is
a configuration we'll need for letting the message list grow in both
directions, for zulip#82).

I sent a PR which aimed to fix a cluster of those, in which I tried
to get away without writing these systematic test cases for them.
It worked for the cases I did test -- including the cases that would
actually arise for the Zulip message list -- and I believed the
changes were correct when I sent the PR.  But that version was still
conceptually confused, as evidenced by the fact that it turned out
to break other cases:
  zulip#1316 (comment)

So that seems like a sign that this really should get systematic
all-cases tests.

Some of these new test cases don't yet work properly, because they
exercise the aforementioned bugs.

The "header overflowing sliver" skip condition will be removed later
in this series.

The "paint order" skips will be addressed in an upcoming PR.
@gnprice gnprice self-assigned this Mar 12, 2025
@chrisbobbe
Copy link
Collaborator

This came up in beta feedback: #mobile > Flutter Beta: Some Feedback @ 💬

@chrisbobbe chrisbobbe added the beta feedback Things beta users have specifically asked for label Apr 22, 2025
gnprice added a commit to gnprice/zulip-flutter that referenced this issue Apr 28, 2025
Thanks to all the preparatory changes we've made in this commit
series and those that came before it, this change should have only
subtle effects on user-visible behavior.

This therefore serves as a testing ground for all the ways that the
message list's scrolling behavior can become more complicated when
two (nontrivial) slivers are involved.  If we find a situation where
the behavior does change noticeably (beyond what's described below),
that will be something to investigate and fix.

In particular:

 * The sticky headers should behave exactly as they did before,
   even when the sliver boundary lies under the sticky header,
   thanks to several previous commit series.

 * On first loading a given message list, it should start out
   scrolled to the end, just as before.

 * When already scrolled to the end, the message list should stay
   there when a new message arrives, or a message is edited, etc.,
   even if the (new) latest message is taller than it was.
   This commit adds a test to confirm that.

Subtle differences include:

 * When scrolled up from the bottom and a new message comes in,
   the behavior is slightly different from before.  The current
   exact behavior is something we probably want to change anyway,
   and I think the new behavior isn't particularly better or worse.

 * The behavior upon overscroll might be slightly different;
   I'm not sure.

 * When a new message arrives, the previously-latest message gets a
   fresh element in the tree, and any UI state on it is lost.  This
   happens because it moves between one sliver-list and the other,
   and the `findChildIndexCallback` mechanism only works within a
   single sliver-list.

   This causes a couple of visible glitches, but they seem tolerable.
   This will also naturally get fixed in the next PR or two toward
   zulip#82: we'll start adding new messages to the bottom sliver, rather
   than having them push anything from the bottom to the top sliver.

   Known symptoms of this are:

   * When the user has just marked messages as read and a new message
     arrives while the unread markers are fading, the marker on the
     previously-latest message will (if it was present) abruptly
     vanish while the others smoothly continue fading.

     We have a test for the smooth fading, and it happened to test
     the latest message, so this commit adjusts the test to avoid
     triggering this issue.

   * If the user had a spoiler expanded on the previously-latest
     message, it will reset to collapsed.
gnprice added a commit to gnprice/zulip-flutter that referenced this issue Apr 30, 2025
Thanks to all the preparatory changes we've made in this commit
series and those that came before it, this change should have only
subtle effects on user-visible behavior.

This therefore serves as a testing ground for all the ways that the
message list's scrolling behavior can become more complicated when
two (nontrivial) slivers are involved.  If we find a situation where
the behavior does change noticeably (beyond what's described below),
that will be something to investigate and fix.

In particular:

 * The sticky headers should behave exactly as they did before,
   even when the sliver boundary lies under the sticky header,
   thanks to several previous commit series.

 * On first loading a given message list, it should start out
   scrolled to the end, just as before.

 * When already scrolled to the end, the message list should stay
   there when a new message arrives, or a message is edited, etc.,
   even if the (new) latest message is taller than it was.
   This commit adds a test to confirm that.

Subtle differences include:

 * When scrolled up from the bottom and a new message comes in,
   the behavior is slightly different from before.  The current
   exact behavior is something we probably want to change anyway,
   and I think the new behavior isn't particularly better or worse.

 * The behavior upon overscroll might be slightly different;
   I'm not sure.

 * When a new message arrives, the previously-latest message gets a
   fresh element in the tree, and any UI state on it is lost.  This
   happens because it moves between one sliver-list and the other,
   and the `findChildIndexCallback` mechanism only works within a
   single sliver-list.

   This causes a couple of visible glitches, but they seem tolerable.
   This will also naturally get fixed in the next PR or two toward
   zulip#82: we'll start adding new messages to the bottom sliver, rather
   than having them push anything from the bottom to the top sliver.

   Known symptoms of this are:

   * When the user has just marked messages as read and a new message
     arrives while the unread markers are fading, the marker on the
     previously-latest message will (if it was present) abruptly
     vanish while the others smoothly continue fading.

     We have a test for the smooth fading, and it happened to test
     the latest message, so this commit adjusts the test to avoid
     triggering this issue.

   * If the user had a spoiler expanded on the previously-latest
     message, it will reset to collapsed.
gnprice added a commit to gnprice/zulip-flutter that referenced this issue May 1, 2025
Thanks to all the preparatory changes we've made in this commit
series and those that came before it, this change should have only
subtle effects on user-visible behavior.

This therefore serves as a testing ground for all the ways that the
message list's scrolling behavior can become more complicated when
two (nontrivial) slivers are involved.  If we find a situation where
the behavior does change noticeably (beyond what's described below),
that will be something to investigate and fix.

In particular:

 * The sticky headers should behave exactly as they did before,
   even when the sliver boundary lies under the sticky header,
   thanks to several previous commit series.

 * On first loading a given message list, it should start out
   scrolled to the end, just as before.

 * When already scrolled to the end, the message list should stay
   there when a new message arrives, or a message is edited, etc.,
   even if the (new) latest message is taller than it was.
   This commit adds a test to confirm that.

Subtle differences include:

 * When scrolled up from the bottom and a new message comes in,
   the behavior is slightly different from before.  The current
   exact behavior is something we probably want to change anyway,
   and I think the new behavior isn't particularly better or worse.

 * The behavior upon overscroll might be slightly different;
   I'm not sure.

 * When a new message arrives, the previously-latest message gets a
   fresh element in the tree, and any UI state on it is lost.  This
   happens because it moves between one sliver-list and the other,
   and the `findChildIndexCallback` mechanism only works within a
   single sliver-list.

   This causes a couple of visible glitches, but they seem tolerable.
   This will also naturally get fixed in the next PR or two toward
   zulip#82: we'll start adding new messages to the bottom sliver, rather
   than having them push anything from the bottom to the top sliver.

   Known symptoms of this are:

   * When the user has just marked messages as read and a new message
     arrives while the unread markers are fading, the marker on the
     previously-latest message will (if it was present) abruptly
     vanish while the others smoothly continue fading.

     We have a test for the smooth fading, and it happened to test
     the latest message, so this commit adjusts the test to avoid
     triggering this issue.

   * If the user had a spoiler expanded on the previously-latest
     message, it will reset to collapsed.
gnprice added a commit to gnprice/zulip-flutter that referenced this issue May 1, 2025
Thanks to all the preparatory changes we've made in this commit
series and those that came before it, this change should have only
subtle effects on user-visible behavior.

This therefore serves as a testing ground for all the ways that the
message list's scrolling behavior can become more complicated when
two (nontrivial) slivers are involved.  If we find a situation where
the behavior does change noticeably (beyond what's described below),
that will be something to investigate and fix.

In particular:

 * The sticky headers should behave exactly as they did before,
   even when the sliver boundary lies under the sticky header,
   thanks to several previous commit series.

 * On first loading a given message list, it should start out
   scrolled to the end, just as before.

 * When already scrolled to the end, the message list should stay
   there when a new message arrives, or a message is edited, etc.,
   even if the (new) latest message is taller than it was.
   This commit adds a test to confirm that.

Subtle differences include:

 * When scrolled up from the bottom and a new message comes in,
   the behavior is slightly different from before.  The current
   exact behavior is something we probably want to change anyway,
   and I think the new behavior isn't particularly better or worse.

 * The behavior upon overscroll might be slightly different;
   I'm not sure.

 * When a new message arrives, the previously-latest message gets a
   fresh element in the tree, and any UI state on it is lost.  This
   happens because it moves between one sliver-list and the other,
   and the `findChildIndexCallback` mechanism only works within a
   single sliver-list.

   This causes a couple of visible glitches, but they seem tolerable.
   This will also naturally get fixed in the next PR or two toward
   zulip#82: we'll start adding new messages to the bottom sliver, rather
   than having them push anything from the bottom to the top sliver.

   Known symptoms of this are:

   * When the user has just marked messages as read and a new message
     arrives while the unread markers are fading, the marker on the
     previously-latest message will (if it was present) abruptly
     vanish while the others smoothly continue fading.

     We have a test for the smooth fading, and it happened to test
     the latest message, so this commit adjusts the test to avoid
     triggering this issue.

   * If the user had a spoiler expanded on the previously-latest
     message, it will reset to collapsed.
gnprice added a commit to gnprice/zulip-flutter that referenced this issue May 1, 2025
Thanks to all the preparatory changes we've made in this commit
series and those that came before it, this change should have only
subtle effects on user-visible behavior.

This therefore serves as a testing ground for all the ways that the
message list's scrolling behavior can become more complicated when
two (nontrivial) slivers are involved.  If we find a situation where
the behavior does change noticeably (beyond what's described below),
that will be something to investigate and fix.

In particular:

 * The sticky headers should behave exactly as they did before,
   even when the sliver boundary lies under the sticky header,
   thanks to several previous commit series.

 * On first loading a given message list, it should start out
   scrolled to the end, just as before.

 * When already scrolled to the end, the message list should stay
   there when a new message arrives, or a message is edited, etc.,
   even if the (new) latest message is taller than it was.
   This commit adds a test to confirm that.

Subtle differences include:

 * When scrolled up from the bottom and a new message comes in,
   the behavior is slightly different from before.  The current
   exact behavior is something we probably want to change anyway,
   and I think the new behavior isn't particularly better or worse.

 * The behavior upon overscroll might be slightly different;
   I'm not sure.

 * When a new message arrives, the previously-latest message gets a
   fresh element in the tree, and any UI state on it is lost.  This
   happens because it moves between one sliver-list and the other,
   and the `findChildIndexCallback` mechanism only works within a
   single sliver-list.

   This causes a couple of visible glitches, but they seem tolerable.
   This will also naturally get fixed in the next PR or two toward
   zulip#82: we'll start adding new messages to the bottom sliver, rather
   than having them push anything from the bottom to the top sliver.

   Known symptoms of this are:

   * When the user has just marked messages as read and a new message
     arrives while the unread markers are fading, the marker on the
     previously-latest message will (if it was present) abruptly
     vanish while the others smoothly continue fading.

     We have a test for the smooth fading, and it happened to test
     the latest message, so this commit adjusts the test to avoid
     triggering this issue.

   * If the user had a spoiler expanded on the previously-latest
     message, it will reset to collapsed.
gnprice added a commit to gnprice/zulip-flutter that referenced this issue May 1, 2025
Thanks to all the preparatory changes we've made in this commit
series and those that came before it, this change should have only
subtle effects on user-visible behavior.

This therefore serves as a testing ground for all the ways that the
message list's scrolling behavior can become more complicated when
two (nontrivial) slivers are involved.  If we find a situation where
the behavior does change noticeably (beyond what's described below),
that will be something to investigate and fix.

In particular:

 * The sticky headers should behave exactly as they did before,
   even when the sliver boundary lies under the sticky header,
   thanks to several previous commit series.

 * On first loading a given message list, it should start out
   scrolled to the end, just as before.

 * When already scrolled to the end, the message list should stay
   there when a new message arrives, or a message is edited, etc.,
   even if the (new) latest message is taller than it was.
   This commit adds a test to confirm that.

Subtle differences include:

 * When scrolled up from the bottom and a new message comes in,
   the behavior is slightly different from before.  The current
   exact behavior is something we probably want to change anyway,
   and I think the new behavior isn't particularly better or worse.

 * The behavior upon overscroll might be slightly different;
   I'm not sure.

 * When a new message arrives, the previously-latest message gets a
   fresh element in the tree, and any UI state on it is lost.  This
   happens because it moves between one sliver-list and the other,
   and the `findChildIndexCallback` mechanism only works within a
   single sliver-list.

   This causes a couple of visible glitches, but they seem tolerable.
   This will also naturally get fixed in the next PR or two toward
   zulip#82: we'll start adding new messages to the bottom sliver, rather
   than having them push anything from the bottom to the top sliver.

   Known symptoms of this are:

   * When the user has just marked messages as read and a new message
     arrives while the unread markers are fading, the marker on the
     previously-latest message will (if it was present) abruptly
     vanish while the others smoothly continue fading.

     We have a test for the smooth fading, and it happened to test
     the latest message, so this commit adjusts the test to avoid
     triggering this issue.

   * If the user had a spoiler expanded on the previously-latest
     message, it will reset to collapsed.
gnprice added a commit to gnprice/zulip-flutter that referenced this issue May 1, 2025
Thanks to all the preparatory changes we've made in this commit
series and those that came before it, this change should have only
subtle effects on user-visible behavior.

This therefore serves as a testing ground for all the ways that the
message list's scrolling behavior can become more complicated when
two (nontrivial) slivers are involved.  If we find a situation where
the behavior does change noticeably (beyond what's described below),
that will be something to investigate and fix.

In particular:

 * The sticky headers should behave exactly as they did before,
   even when the sliver boundary lies under the sticky header,
   thanks to several previous commit series.

 * On first loading a given message list, it should start out
   scrolled to the end, just as before.

 * When already scrolled to the end, the message list should stay
   there when a new message arrives, or a message is edited, etc.,
   even if the (new) latest message is taller than it was.
   This commit adds a test to confirm that.

Subtle differences include:

 * When scrolled up from the bottom and a new message comes in,
   the behavior is slightly different from before.  The current
   exact behavior is something we probably want to change anyway,
   and I think the new behavior isn't particularly better or worse.

 * The behavior upon overscroll might be slightly different;
   I'm not sure.

 * When a new message arrives, the previously-latest message gets a
   fresh element in the tree, and any UI state on it is lost.  This
   happens because it moves between one sliver-list and the other,
   and the `findChildIndexCallback` mechanism only works within a
   single sliver-list.

   This causes a couple of visible glitches, but they seem tolerable.
   This will also naturally get fixed in the next PR or two toward
   zulip#82: we'll start adding new messages to the bottom sliver, rather
   than having them push anything from the bottom to the top sliver.

   Known symptoms of this are:

   * When the user has just marked messages as read and a new message
     arrives while the unread markers are fading, the marker on the
     previously-latest message will (if it was present) abruptly
     vanish while the others smoothly continue fading.

     We have a test for the smooth fading, and it happened to test
     the latest message, so this commit adjusts the test to avoid
     triggering this issue.

   * If the user had a spoiler expanded on the previously-latest
     message, it will reset to collapsed.
gnprice added a commit to gnprice/zulip-flutter that referenced this issue May 1, 2025
Thanks to all the preparatory changes we've made in this commit
series and those that came before it, this change should have only
subtle effects on user-visible behavior.

This therefore serves as a testing ground for all the ways that the
message list's scrolling behavior can become more complicated when
two (nontrivial) slivers are involved.  If we find a situation where
the behavior does change noticeably (beyond what's described below),
that will be something to investigate and fix.

In particular:

 * The sticky headers should behave exactly as they did before,
   even when the sliver boundary lies under the sticky header,
   thanks to several previous commit series.

 * On first loading a given message list, it should start out
   scrolled to the end, just as before.

 * When already scrolled to the end, the message list should stay
   there when a new message arrives, or a message is edited, etc.,
   even if the (new) latest message is taller than it was.
   This commit adds a test to confirm that.

Subtle differences include:

 * When scrolled up from the bottom and a new message comes in,
   the behavior is slightly different from before.  The current
   exact behavior is something we probably want to change anyway,
   and I think the new behavior isn't particularly better or worse.

 * The behavior upon overscroll might be slightly different;
   I'm not sure.

 * When a new message arrives, the previously-latest message gets a
   fresh element in the tree, and any UI state on it is lost.  This
   happens because it moves between one sliver-list and the other,
   and the `findChildIndexCallback` mechanism only works within a
   single sliver-list.

   This causes a couple of visible glitches, but they seem tolerable.
   This will also naturally get fixed in the next PR or two toward
   zulip#82: we'll start adding new messages to the bottom sliver, rather
   than having them push anything from the bottom to the top sliver.

   Known symptoms of this are:

   * When the user has just marked messages as read and a new message
     arrives while the unread markers are fading, the marker on the
     previously-latest message will (if it was present) abruptly
     vanish while the others smoothly continue fading.

     We have a test for the smooth fading, and it happened to test
     the latest message, so this commit adjusts the test to avoid
     triggering this issue.

   * If the user had a spoiler expanded on the previously-latest
     message, it will reset to collapsed.
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 beta feedback Things beta users have specifically asked for
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants