microsoft / BotFramework-WebChat

A highly-customizable web-based client for Azure Bot Services.
https://www.botframework.com/
MIT License
1.58k stars 1.53k forks source link

Add activities to webchat when user scrolls to top of message list (Infinite Scrolling) #3395

Closed adamayoung closed 2 days ago

adamayoung commented 4 years ago

Feature Request

Is your feature request related to a problem? Please describe.

Yes - related to a problem.

Initially loading webchat with a large number of activities causes the browser to freeze until it has rendered them all. I therefore want to load webchat with the last ~20 activities I have stored, and dynamically add more previous activities when the user scrolls to the top of the message list.

Describe the suggestion or request in detail

Provide a callback for when the user has scrolled to the top of the message list, and provide a way of adding activities to the message list without having to reload all of webchat.

Describe alternatives you have considered

I've tried getting a reference to the scrollable message list element and attaching a scroll event listener to detect when the user has scrolled to the top of the message list. But adding new activities to webchat without reloading all of webchat doesn't seem possible. Reloading all of webchat with a larger set of activities defeats the purpose of loading 'pages' of activities in when you need them.

[Enhancement]

carlosscastro commented 4 years ago

Thanks for your request. We think this would be a valuable addition and we added it to the backlog, to be considered in the planning for the upcoming releases. Thanks!