Improvement: Enhance "Load More Newer/Older Messages" UX
Current Behavior: When the onEndReached callback is triggered (e.g., to load items 21-40), the following happens:
-
A loading indicator appears at the top of the chat view.
-
After the new messages are fetched, they are added to the list.
-
The loading indicator disappears abruptly.
-
The viewport remains focused on the original messages (e.g., items 1-20), and the user must scroll up again to see the newly loaded messages (items 21-40).
https://github.com/user-attachments/assets/6efe4724-2895-4e8d-abb7-0e2e6a2bd542
Proposed Behavior: The user experience should be seamless and automatic, as seen in apps like Facebook Messenger. The new messages should replace the loading indicator, and the viewport should immediately show the new content without requiring another scroll action.
For a clear example of the desired behavior, see this demo from stream_chat_flutter package:
https://stream-blog-v2.imgix.net/blog/wp-content/uploads/c6394ba8863774747d8bb552e28200ad/dvg7qhro5044qfvqn3v8.gif