diff --git a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx
index 4679c232c..e97c13061 100644
--- a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx
+++ b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx
@@ -1,10 +1,13 @@
import { ChevronDownIcon } from "@heroicons/react/24/outline";
import { inferResolvedUriFromRelativePath } from "core/util/ideUtils";
+import { renderContextItems } from "core/util/messageContent";
import { useContext, useEffect, useMemo, useState } from "react";
import { IdeMessengerContext } from "../../../context/IdeMessenger";
import { useIdeMessengerRequest } from "../../../hooks/useIdeMessengerRequest";
import { useWebviewListener } from "../../../hooks/useWebviewListener";
+import { getStatusIcon } from "../../../pages/gui/ToolCallDiv/utils";
import { useAppSelector } from "../../../redux/hooks";
+import { selectToolCallById } from "../../../redux/selectors/selectToolCalls";
import {
selectApplyStateByStreamId,
selectApplyStateByToolCallId,
@@ -21,6 +24,7 @@ import { InsertButton } from "./InsertButton";
import { RunInTerminalButton } from "./RunInTerminalButton";
export interface StepContainerPreToolbarProps {
+ showToolCallStatusIcon?: boolean;
codeBlockContent: string;
language: string | null;
relativeFilepath?: string;
@@ -37,6 +41,7 @@ export interface StepContainerPreToolbarProps {
}
export function StepContainerPreToolbar({
+ showToolCallStatusIcon,
codeBlockContent,
language,
relativeFilepath,
@@ -81,6 +86,30 @@ export function StepContainerPreToolbar({
selectApplyStateByToolCallId(state, forceToolCallId),
);
+ const toolCallState = useAppSelector((state) =>
+ forceToolCallId ? selectToolCallById(state, forceToolCallId) : undefined,
+ );
+
+ const toolCallStatusIcon =
+ showToolCallStatusIcon &&
+ (toolCallState?.status === "canceled" ||
+ toolCallState?.status === "errored" ||
+ toolCallState?.status === "done") ? (
+
{
+ if (toolCallState.output) {
+ ideMessenger.post("showVirtualFile", {
+ name: "Edit output",
+ content: renderContextItems(toolCallState.output),
+ });
+ }
+ }}
+ >
+ {getStatusIcon(toolCallState.status)}
+
+ ) : null;
+
/**
* In the case where `relativeFilepath` is defined, this will just be `relativeFilepathUri`.
* However, if no `relativeFilepath` is defined, then this will
@@ -269,6 +298,7 @@ export function StepContainerPreToolbar({
style={{ fontSize: `${getFontSize() - 2}px` }}
>
+ {toolCallStatusIcon}
setIsExpanded(!isExpanded)}
diff --git a/gui/src/components/StyledMarkdownPreview/index.tsx b/gui/src/components/StyledMarkdownPreview/index.tsx
index 5b1249cd8..0ccab5df1 100644
--- a/gui/src/components/StyledMarkdownPreview/index.tsx
+++ b/gui/src/components/StyledMarkdownPreview/index.tsx
@@ -123,6 +123,7 @@ const StyledMarkdown = styled.div<{
`;
interface StyledMarkdownPreviewProps {
+ showToolCallStatusIcon?: boolean;
source?: string;
className?: string;
isRenderingInStepContainer?: boolean; // Currently only used to control the rendering of codeblocks
@@ -300,6 +301,7 @@ const StyledMarkdownPreview = memo(function StyledMarkdownPreview(
return (
+
-
-
-
-
-
- {icon}
-
- {tool?.faviconUrl && (
-

- )}
-
-
-
- {!!toolCallState.output && (
-
- )}
- {!!args.length ? (
-
- ) : null}
+
+
+
+
+
+ {icon}
+ {tool?.faviconUrl && (
+

+ )}
+
+
+
+ {!!toolCallState.output && (
+
+ )}
+ {!!args.length ? (
+
+ ) : null}
- {argsExpanded && !!args.length && (
-
- )}
-
{children}
+ {argsExpanded && !!args.length && (
+
+ )}
- >
+
{children}
+
);
}
diff --git a/gui/src/pages/gui/ToolCallDiv/index.tsx b/gui/src/pages/gui/ToolCallDiv/index.tsx
index ca99d8fdd..12556998e 100644
--- a/gui/src/pages/gui/ToolCallDiv/index.tsx
+++ b/gui/src/pages/gui/ToolCallDiv/index.tsx
@@ -56,10 +56,12 @@ export function ToolCallDiv({
// But we'd need a nicer place to put the truncate button and the X icon when tool call fails
if (functionName === BuiltInToolNames.SearchAndReplaceInFile) {
return (
-
+
+
+
);
}
@@ -80,7 +82,7 @@ export function ToolCallDiv({
if (shouldShowGroupedUI) {
return (
-
+
(
-
+
{renderToolCall(toolCallState)}
));