A function that determines if a received message is pinned. The last one that matches is pinned.
OptionalpinOpts: PinOptsPinOpts options for the pinned message
ScrollToItemOpts options for the scroll to the other messages
A callback that performs the pin or the scroll action.
Pins a new message that matches the condition to the top of the viewport and leaves room under it. The content that comes after the message fills the room, so it does not move the list. This is the typical behavior of AI chat apps: the question of the user goes to the top, and the streamed answer grows under it. Other new messages scroll the chat to the bottom when the chat is at the bottom. While a message is pinned, the follow strategies do not scroll the chat.