Lazy render tool-call bodies
This commit is contained in:
@@ -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,14 +1208,14 @@ 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()}
|
||||||
|
|
||||||
{renderError()}
|
{renderError()}
|
||||||
|
|
||||||
{renderPermissionBlock()}
|
{renderPermissionBlock()}
|
||||||
|
|
||||||
<Show when={status() === "pending" && !pendingPermission()}>
|
<Show when={status() === "pending" && !pendingPermission()}>
|
||||||
<div class="tool-call-pending-message">
|
<div class="tool-call-pending-message">
|
||||||
<span class="spinner-small"></span>
|
<span class="spinner-small"></span>
|
||||||
@@ -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(),
|
||||||
|
|||||||
Reference in New Issue
Block a user