Skip to content

Fetch older messages on scrolling to top #78

@gnprice

Description

@gnprice

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.

Metadata

Metadata

Assignees

Labels

a-msglistThe message-list screen, except what's label:a-content

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions