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

Fetch older messages on scrolling to top #78

Closed
gnprice opened this issue Apr 21, 2023 · 0 comments · Fixed by #264
Closed

Fetch older messages on scrolling to top #78

gnprice opened this issue Apr 21, 2023 · 0 comments · Fixed by #264
Assignees
Labels
a-msglist The message-list screen, except what's label:a-content
Milestone

Comments

@gnprice
Copy link
Member

gnprice commented Apr 21, 2023

In the message list, when the user scrolls to the top of the messages we have (or near the top), we should make a request to the server and load the next older batch of messages.

Unless we know we already have the oldest messages for the narrow, that is. So we should track that, based on the found_oldest returned by get-messages (much like in state.caughtUp in zulip-mobile).

This will mean extending MessageListView (the view-model) so that it can add a batch of messages at the beginning of the list, as well as a new message at the end. Probably it should switch from using List for the list of messages to using a deque, like QueueList from package:collection.

If we do this after we have either of

then we should at the same time handle fetching newer messages on scrolling to the bottom, and tracking whether we have the newest already. If we do this before those, then we might leave that direction as a note on those issues.

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: Done
Development

Successfully merging a pull request may close this issue.

1 participant