Skip to content

Commit 26a14e5

Browse files
authored
🤖 feat: add file icons to tool call headers (#635)
## Summary - render FileIcon in file_read tool call headers - render FileIcon in file_edit tool call headers for consistent visuals ## Testing - make typecheck _Generated with mux_
1 parent 76daeda commit 26a14e5

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/browser/components/tools/FileEditToolCall.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from "react";
2+
import { FileIcon } from "@/browser/components/FileIcon";
23
import { parsePatch } from "diff";
34
import type {
45
FileEditInsertToolArgs,
@@ -138,7 +139,10 @@ export const FileEditToolCall: React.FC<FileEditToolCallProps> = ({
138139
<span>✏️</span>
139140
<Tooltip>{toolName}</Tooltip>
140141
</TooltipWrapper>
141-
<span className="text-text font-monospace max-w-96 truncate">{filePath}</span>
142+
<div className="text-text flex max-w-96 min-w-0 items-center gap-1.5">
143+
<FileIcon filePath={filePath} className="text-[15px] leading-none" />
144+
<span className="font-monospace truncate">{filePath}</span>
145+
</div>
142146
</div>
143147
{!(result && result.success && result.diff) && (
144148
<StatusIndicator status={status}>{getStatusDisplay(status)}</StatusIndicator>

src/browser/components/tools/FileReadToolCall.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from "react";
2+
import { FileIcon } from "@/browser/components/FileIcon";
23
import type { FileReadToolArgs, FileReadToolResult } from "@/common/types/tools";
34
import {
45
ToolContainer,
@@ -82,7 +83,10 @@ export const FileReadToolCall: React.FC<FileReadToolCallProps> = ({
8283
<span>📖</span>
8384
<Tooltip>file_read</Tooltip>
8485
</TooltipWrapper>
85-
<span className="text-text font-monospace max-w-96 truncate">{filePath}</span>
86+
<div className="text-text flex max-w-96 min-w-0 items-center gap-1.5">
87+
<FileIcon filePath={filePath} className="text-[15px] leading-none" />
88+
<span className="font-monospace truncate">{filePath}</span>
89+
</div>
8690
{result && result.success && parsedContent && (
8791
<span className="text-secondary ml-2 text-[10px] whitespace-nowrap">
8892
<span className="hidden @sm:inline">read </span>

0 commit comments

Comments
 (0)