Performs a scroll to the bottom of the chat viewer when a new message is added.
It returns a generic OnMessagesCallback that can be used with the chat viewer.
This function handles layout shifts that may occur after scrolling (e.g., when content
like delimiters is rendered asynchronously). It monitors scrollSize changes and re-scrolls
until the content stabilizes, ensuring the bottom remains visible.
Performs a scroll to the bottom of the chat viewer when a new message is added. It returns a generic OnMessagesCallback that can be used with the chat viewer.
This function handles layout shifts that may occur after scrolling (e.g., when content like delimiters is rendered asynchronously). It monitors scrollSize changes and re-scrolls until the content stabilizes, ensuring the bottom remains visible.