Fix spinner showing on aborted tool calls in javascript-repl and artifacts renderers
When isStreaming is false and there's no result (aborted state), show 'complete' state instead of 'inprogress' to avoid showing the spinner.
This commit is contained in:
@@ -55,7 +55,7 @@ export class ArtifactsToolRenderer implements ToolRenderer<ArtifactsParams, unde
|
|||||||
result: ToolResultMessage<undefined> | undefined,
|
result: ToolResultMessage<undefined> | undefined,
|
||||||
isStreaming?: boolean,
|
isStreaming?: boolean,
|
||||||
): TemplateResult {
|
): TemplateResult {
|
||||||
const state = result ? (result.isError ? "error" : "complete") : isStreaming ? "inprogress" : "inprogress";
|
const state = result ? (result.isError ? "error" : "complete") : isStreaming ? "inprogress" : "complete";
|
||||||
|
|
||||||
// Create refs for collapsible sections
|
// Create refs for collapsible sections
|
||||||
const contentRef = createRef<HTMLDivElement>();
|
const contentRef = createRef<HTMLDivElement>();
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ export const javascriptReplRenderer: ToolRenderer<JavaScriptReplParams, JavaScri
|
|||||||
isStreaming?: boolean,
|
isStreaming?: boolean,
|
||||||
): TemplateResult {
|
): TemplateResult {
|
||||||
// Determine status
|
// Determine status
|
||||||
const state = result ? (result.isError ? "error" : "complete") : isStreaming ? "inprogress" : "inprogress";
|
const state = result ? (result.isError ? "error" : "complete") : isStreaming ? "inprogress" : "complete";
|
||||||
|
|
||||||
// Create refs for collapsible code section
|
// Create refs for collapsible code section
|
||||||
const codeContentRef = createRef<HTMLDivElement>();
|
const codeContentRef = createRef<HTMLDivElement>();
|
||||||
|
|||||||
Reference in New Issue
Block a user