diff --git a/src/lib/components/Terminal.svelte b/src/lib/components/Terminal.svelte index 1d1f665..19135b6 100644 --- a/src/lib/components/Terminal.svelte +++ b/src/lib/components/Terminal.svelte @@ -7,6 +7,7 @@ import Markdown from "./Markdown.svelte"; import HighlightedText from "./HighlightedText.svelte"; import ThinkingBlock from "./ThinkingBlock.svelte"; + import ToolCallBlock from "./ToolCallBlock.svelte"; import { searchState, searchQuery } from "$lib/stores/search"; import { clipboardStore } from "$lib/stores/clipboard"; import { shouldHidePaths, maskPaths, showThinkingBlocks } from "$lib/stores/config"; @@ -208,22 +209,6 @@ if (!currentConversationId) return; await invoke("send_prompt", { conversationId: currentConversationId, message: "/compact" }); } - - // Collapsible tool lines - const TOOL_COLLAPSE_THRESHOLD = 60; - let expandedToolLines: Record = {}; - - function isToolContentLong(content: string): boolean { - return content.length > TOOL_COLLAPSE_THRESHOLD; - } - - function truncateToolContent(content: string): string { - return content.slice(0, TOOL_COLLAPSE_THRESHOLD) + "…"; - } - - function toggleToolLine(id: string) { - expandedToolLines = { ...expandedToolLines, [id]: !expandedToolLines[id] }; - }
{/if} + {:else if line.type === "tool"} +
+ +
{:else}
{getLinePrefix(line.type)} {/if} - {#if line.toolName} - [{line.toolName}] - {/if} {#if line.type === "compact-prompt"}
- {:else if line.type === "tool" && isToolContentLong(maskPaths(line.content, hidePaths))} - - - - {:else} diff --git a/src/lib/components/ToolCallBlock.svelte b/src/lib/components/ToolCallBlock.svelte new file mode 100644 index 0000000..78c996b --- /dev/null +++ b/src/lib/components/ToolCallBlock.svelte @@ -0,0 +1,141 @@ + + +
+ + + {#if isExpanded} +
+ {content} +
+ {/if} +
+ +