Skip to content
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: On event-queue refresh, re-fetch the position you were reading; control scroll position #1273

Open
chrisbobbe opened this issue Jan 11, 2025 · 3 comments
Labels
a-msglist The message-list screen, except what's label:a-content

Comments

@chrisbobbe
Copy link
Collaborator

When we learn that our connection to the server ("event queue") has expired, after we get a new one, we re-fetch messages in any open message lists because the old data may be out-of-date.

When possible, after the re-fetch, we want to show the user the same messages, in their same positions onscreen, as before. This issue is for doing that.

Currently, after the re-fetch, we always put the user at the latest messages in the view, regardless of what messages they were looking at before.


First, the code should choose a message to anchor to; see #1008: "But a simple algorithm would be […]".

The re-fetch should be done at that anchor; this requires

We should also try to put the fetched "anchor" message in the same position onscreen as it was before the re-fetch.

Related issues

@chrisbobbe chrisbobbe added the a-msglist The message-list screen, except what's label:a-content label Jan 11, 2025
@chrisbobbe chrisbobbe added this to the M6: Post-launch milestone Jan 11, 2025
@E-m-i-n-e-n-c-e
Copy link

Can't we take a different approach to solve this issue. Instead of anchoring and re fetching. Can't we just preserve the state of the messageList so that it only loads once when you open the app for the first time

@chrisbobbe

@chrisbobbe
Copy link
Collaborator Author

No:

we re-fetch messages […] because the old data may be out-of-date.

@E-m-i-n-e-n-c-e
Copy link

No:

we re-fetch messages […] because the old data may be out-of-date.

I see . I thought we could try preserving the state of just the scroll controller but that wouldn't work if there are new messages. So we need a message to anchor to (preferably bottom most) and then set scroll position so that the anchored msg is just visible.

Can i take this issue?

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
Projects
Status: No status
Development

No branches or pull requests

2 participants