Lazy render tool-call bodies

This commit is contained in:
Shantur Rathore
2025-12-01 23:09:22 +00:00
parent 983c8cc4a3
commit d3dc170e02

View File

@@ -484,6 +484,11 @@ export default function ToolCall(props: ToolCallProps) {
onCleanup(() => document.removeEventListener("keydown", handler)) onCleanup(() => document.removeEventListener("keydown", handler))
}) })
createEffect(() => {
if (!expanded()) {
scrollContainerRef = undefined
}
})
const statusIcon = () => { const statusIcon = () => {
const status = props.toolCall?.state?.status || "" const status = props.toolCall?.state?.status || ""
@@ -1203,7 +1208,7 @@ export default function ToolCall(props: ToolCallProps) {
</span> </span>
</button> </button>
<Show when={expanded()}> {expanded() && (
<div class="tool-call-details"> <div class="tool-call-details">
{renderToolBody()} {renderToolBody()}
@@ -1218,9 +1223,10 @@ export default function ToolCall(props: ToolCallProps) {
</div> </div>
</Show> </Show>
</div> </div>
</Show> )}
<Show when={diagnosticsEntries().length}> <Show when={diagnosticsEntries().length}>
{renderDiagnosticsSection( {renderDiagnosticsSection(
diagnosticsEntries(), diagnosticsEntries(),
diagnosticsExpanded(), diagnosticsExpanded(),