fix(ui): stabilize streaming message/tool rendering
Avoid remounting message blocks on part updates so tool call UI state persists. Render tool/message content from store and stabilize tool output scrolling during streaming.
This commit is contained in:
@@ -235,12 +235,16 @@ export default function ToolCall(props: ToolCallProps) {
|
||||
requestAnimationFrame(() => {
|
||||
restoreScrollPosition(autoScroll())
|
||||
if (!expanded()) return
|
||||
scheduleAnchorScroll()
|
||||
scheduleAnchorScroll(true)
|
||||
})
|
||||
}
|
||||
|
||||
const initializeScrollContainer = (element: HTMLDivElement | null | undefined) => {
|
||||
scrollContainerRef = element || undefined
|
||||
const next = element || undefined
|
||||
if (next === scrollContainerRef) {
|
||||
return
|
||||
}
|
||||
scrollContainerRef = next
|
||||
setScrollContainer(scrollContainerRef)
|
||||
if (scrollContainerRef) {
|
||||
restoreScrollPosition(autoScroll())
|
||||
@@ -593,7 +597,7 @@ export default function ToolCall(props: ToolCallProps) {
|
||||
return
|
||||
}
|
||||
previousPartVersion = version
|
||||
scheduleAnchorScroll()
|
||||
scheduleAnchorScroll(true)
|
||||
})
|
||||
|
||||
createEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user