Auto-scrolling transcript (with jump-to-latest button)

You
Can you walk me through how the message scroller keeps things anchored?
9:41 AM
AI
Assistant
Of course. Each row is wrapped in a MessageScrollerItem so the viewport can measure and preserve its position.
9:41 AM
AI
Assistant
When you mark an item with scrollAnchor, it's treated as a conversation turn — the viewport parks it near the top.
9:42 AM
You
So the last thing I sent stays pinned while the reply streams in?
9:43 AM
AI
Assistant
Exactly. With autoScroll on, streamed replies stay in view as long as you're at the live edge.
9:43 AM
AI
Assistant
If you scroll up to read older messages, auto-scroll pauses so you aren't yanked back down.
9:44 AM
You
Nice. And the floating button?
9:45 AM
AI
Assistant
MessageScrollerButton appears when there's content below (or above). Tap it to jump back to the latest message.
9:45 AM
You
What about really long threads — does it render everything?
9:46 AM
AI
Assistant
It uses content-visibility so rows far off-screen skip layout work, but stay in the DOM for search and accessibility.
9:47 AM
You
Great — that covers it. Let me scroll up to double-check the anchoring.
9:48 AM
AI
Assistant
Go for it. Notice the previous turn peeks above the anchored row so you keep your context.
9:48 AM

External controls (useMessageScroller + useMessageScrollerVisibility)

Active turn:
You
Can you walk me through how the message scroller keeps things anchored?
9:41 AM
AI
Assistant
Of course. Each row is wrapped in a MessageScrollerItem so the viewport can measure and preserve its position.
9:41 AM
AI
Assistant
When you mark an item with scrollAnchor, it's treated as a conversation turn — the viewport parks it near the top.
9:42 AM
You
So the last thing I sent stays pinned while the reply streams in?
9:43 AM
AI
Assistant
Exactly. With autoScroll on, streamed replies stay in view as long as you're at the live edge.
9:43 AM
AI
Assistant
If you scroll up to read older messages, auto-scroll pauses so you aren't yanked back down.
9:44 AM
You
Nice. And the floating button?
9:45 AM
AI
Assistant
MessageScrollerButton appears when there's content below (or above). Tap it to jump back to the latest message.
9:45 AM
You
What about really long threads — does it render everything?
9:46 AM
AI
Assistant
It uses content-visibility so rows far off-screen skip layout work, but stay in the DOM for search and accessibility.
9:47 AM
You
Great — that covers it. Let me scroll up to double-check the anchoring.
9:48 AM
AI
Assistant
Go for it. Notice the previous turn peeks above the anchored row so you keep your context.
9:48 AM