diff --git a/gui/src/pages/gui/ToolCallDiv/ToolCallStatusMessage.tsx b/gui/src/pages/gui/ToolCallDiv/ToolCallStatusMessage.tsx index 4a88fd7cb8..5dddd8882c 100644 --- a/gui/src/pages/gui/ToolCallDiv/ToolCallStatusMessage.tsx +++ b/gui/src/pages/gui/ToolCallDiv/ToolCallStatusMessage.tsx @@ -1,6 +1,9 @@ import { Tool, ToolCallState } from "core"; import Mustache from "mustache"; -import { getStatusIntro } from "./utils"; +import { useContext } from "react"; +import { openContextItem } from "../../../components/mainInput/belowMainInput/ContextItemsPeek"; +import { IdeMessengerContext } from "../../../context/IdeMessenger"; +import { getStatusIntro, toolCallStateToContextItems } from "./utils"; interface ToolCallStatusMessageProps { tool: Tool | undefined; @@ -11,6 +14,14 @@ export function ToolCallStatusMessage({ tool, toolCallState, }: ToolCallStatusMessageProps) { + const ideMessenger = useContext(IdeMessengerContext); + + function handleClick() { + if (contextItems.length > 0) { + openContextItem(contextItems[0], ideMessenger); + } + } + if (!tool) return "Agent tool use"; const toolName = tool.displayTitle ?? tool.function.name; @@ -51,10 +62,16 @@ export function ToolCallStatusMessage({ } } + const contextItems = toolCallStateToContextItems(toolCallState); + const isClickable = contextItems.length > 0; + return (
{`Continue ${intro} ${message}`}
diff --git a/gui/src/pages/gui/ToolCallDiv/utils.tsx b/gui/src/pages/gui/ToolCallDiv/utils.tsx index fe18123f46..0d1c383af8 100644 --- a/gui/src/pages/gui/ToolCallDiv/utils.tsx +++ b/gui/src/pages/gui/ToolCallDiv/utils.tsx @@ -106,4 +106,4 @@ export function toolCallCtxItemToCtxItemWithId( itemId: toolCallId, }, }; -} +} \ No newline at end of file