stream-chat-android
stream-chat-android copied to clipboard
Feature/3929 bidirectional pagination
🎯 Goal
Rerevert of #3818
🛠 Implementation details
Updated ChannelLogic which determines if the pagination has reached either end or start of the messages list. Also added checks when receiving or sending new messages, so that the new message isn't added to the list if the newest messages are not loaded to avoid breaking pagination of newer messages.
Introduced new pagination handler for reaching the end of new messages to MessageList composable. Added scroll to bottom handler to MessagesList.
🎨 UI Changes
| Before | After |
|---|---|
🧪 Testing
- Build this branch and enter a channel that has more than one page
- Scroll n number of pages and reply to a message
- Exit the channel and enter it again, the message history will be reset
- Click on the quoted message which should load the message and a page that surrounds the message
- Scroll up and down to ensure that the bi directional pagination is working
- Try sending messages from the current user and from a different device, messages shouldn't be added to the bottom of the list, otherwise pagination will break
- Try adding reactions to messages you are scrolled to, replying to them and deleting them to insure that the messages are properly updated
- Click on scroll to bottom button, if the newest messages aren't present they should be loaded and the list should scroll to the bottom
- Background the app when newest messages are not loaded and send new messages from another device, the messages should not be added to the list.
☑️Contributor Checklist
General
- [x] Assigned a person / code owner group (required)
- [x] Thread with the PR link started in a respective Slack channel (#android-chat-core or #android-chat-ui) (required)
- [x] PR targets the
developbranch - [x] PR is linked to the GitHub issue it resolves
Code & documentation
- [ ] Changelog is updated with client-facing changes
- [ ] New code is covered by unit tests
- [ ] Comparison screenshots added for visual changes
- [ ] Affected documentation updated (KDocs, docusaurus, tutorial)
☑️Reviewer Checklist
- [ ] UI Components sample runs & works
- [ ] Compose sample runs & works
- [ ] UI Changes correct (before & after images)
- [ ] Bugs validated (bugfixes)
- [ ] New feature tested and works
- [ ] Release notes and docs clearly describe changes
- [ ] All code we touched has new or updated KDocs
🎉 GIF

Not related to this PR. Message highlight animation in Compose is broken
There's a small problem with paginating to newer messages. The scroll instantly jumps to the bottom of the new chunk
- Scroll up until scroll to bottom FAB is displayed
- Enter thread
- FAB remains in the screen