Skip to content

Commit 08cacea

Browse files
committed
fix: add tooltips to truncated file paths in chat UI
- Add StandardTooltip wrapper to truncated file paths in ChatRow.tsx - Add StandardTooltip wrapper to truncated file paths in BatchFilePermission.tsx - Shows full file path on hover when text is truncated with ellipsis - Fixes #8278
1 parent 8dbd8c4 commit 08cacea

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

webview-ui/src/components/chat/BatchFilePermission.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { memo } from "react"
33
import { ToolUseBlock, ToolUseBlockHeader } from "../common/ToolUseBlock"
44
import { vscode } from "@src/utils/vscode"
55
import { removeLeadingNonAlphanumeric } from "@src/utils/removeLeadingNonAlphanumeric"
6+
import { StandardTooltip } from "@src/components/ui"
67

78
interface FilePermissionItem {
89
path: string
@@ -35,10 +36,13 @@ export const BatchFilePermission = memo(({ files = [], onPermissionResponse, ts
3536
<ToolUseBlockHeader
3637
onClick={() => vscode.postMessage({ type: "openFile", text: file.content })}>
3738
{file.path?.startsWith(".") && <span>.</span>}
38-
<span className="whitespace-nowrap overflow-hidden text-ellipsis text-left mr-2 rtl">
39-
{removeLeadingNonAlphanumeric(file.path ?? "") + "\u200E"}
40-
{file.lineSnippet && ` ${file.lineSnippet}`}
41-
</span>
39+
<StandardTooltip
40+
content={`${file.path}${file.lineSnippet ? ` ${file.lineSnippet}` : ""}`}>
41+
<span className="whitespace-nowrap overflow-hidden text-ellipsis text-left mr-2 rtl">
42+
{removeLeadingNonAlphanumeric(file.path ?? "") + "\u200E"}
43+
{file.lineSnippet && ` ${file.lineSnippet}`}
44+
</span>
45+
</StandardTooltip>
4246
<div className="flex-grow"></div>
4347
<span className="codicon codicon-link-external text-[13.5px] my-[1px]" />
4448
</ToolUseBlockHeader>

webview-ui/src/components/chat/ChatRow.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { findMatchingResourceOrTemplate } from "@src/utils/mcp"
1616
import { vscode } from "@src/utils/vscode"
1717
import { removeLeadingNonAlphanumeric } from "@src/utils/removeLeadingNonAlphanumeric"
1818
import { getLanguageFromPath } from "@src/utils/getLanguageFromPath"
19+
import { StandardTooltip } from "@src/components/ui"
1920

2021
import { ToolUseBlock, ToolUseBlockHeader } from "../common/ToolUseBlock"
2122
import UpdateTodoListToolBlock from "./UpdateTodoListToolBlock"
@@ -600,10 +601,12 @@ export const ChatRowContent = ({
600601
className="group"
601602
onClick={() => vscode.postMessage({ type: "openFile", text: tool.content })}>
602603
{tool.path?.startsWith(".") && <span>.</span>}
603-
<span className="whitespace-nowrap overflow-hidden text-ellipsis text-left mr-2 rtl">
604-
{removeLeadingNonAlphanumeric(tool.path ?? "") + "\u200E"}
605-
{tool.reason}
606-
</span>
604+
<StandardTooltip content={`${tool.path}${tool.reason ? ` ${tool.reason}` : ""}`}>
605+
<span className="whitespace-nowrap overflow-hidden text-ellipsis text-left mr-2 rtl">
606+
{removeLeadingNonAlphanumeric(tool.path ?? "") + "\u200E"}
607+
{tool.reason}
608+
</span>
609+
</StandardTooltip>
607610
<div style={{ flexGrow: 1 }}></div>
608611
<SquareArrowOutUpRight
609612
className="w-4 codicon codicon-link-external opacity-0 group-hover:opacity-100 transition-opacity"

0 commit comments

Comments
 (0)