Message scroller
A headless scroller that sticks a thread to its newest message. Scroll up and it stops following; a floating outline icon-smbutton appears to jump back to the bottom and counts what arrived meanwhile. Only the reader's own sends are scroll anchors: an assistant reply never moves a reader who has scrolled up.
<MessageScrollerProvider autoScroll>
<MessageScroller className="h-96 rounded-md border">
<MessageScrollerViewport>
<MessageScrollerContent>
<MessageScrollerItem scrollAnchor={isOwnLatestSend}>
<Message>…</Message>
</MessageScrollerItem>
</MessageScrollerContent>
</MessageScrollerViewport>
<MessageScrollerButton />
</MessageScroller>
</MessageScrollerProvider>