stream-chat-android icon indicating copy to clipboard operation
stream-chat-android copied to clipboard

Feature/3929 bidirectional pagination

Open TGazica opened this issue 3 years ago • 3 comments

🎯 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

  1. Build this branch and enter a channel that has more than one page
  2. Scroll n number of pages and reply to a message
  3. Exit the channel and enter it again, the message history will be reset
  4. Click on the quoted message which should load the message and a page that surrounds the message
  5. Scroll up and down to ensure that the bi directional pagination is working
  6. 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
  7. Try adding reactions to messages you are scrolled to, replying to them and deleting them to insure that the messages are properly updated
  8. 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
  9. 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 develop branch
  • [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

giphy

TGazica avatar Jul 26 '22 10:07 TGazica

Not related to this PR. Message highlight animation in Compose is broken

bychkovdmitry avatar Oct 04 '22 12:10 bychkovdmitry

There's a small problem with paginating to newer messages. The scroll instantly jumps to the bottom of the new chunk

bychkovdmitry avatar Oct 04 '22 12:10 bychkovdmitry

  1. Scroll up until scroll to bottom FAB is displayed
  2. Enter thread
  3. FAB remains in the screen

bychkovdmitry avatar Oct 04 '22 16:10 bychkovdmitry