Skip to content

Commit 08e64a0

Browse files
committed
fix: normalize tooltip content to match displayed text exactly
Update StandardTooltip content in BatchFilePermission, ChatRow, and CodeAccordian to use removeLeadingNonAlphanumeric() and include the same formatting as the visible text, ensuring tooltips display consistently with what users see.
1 parent 643090c commit 08e64a0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const BatchFilePermission = memo(({ files = [], onPermissionResponse, ts
3636
<ToolUseBlockHeader
3737
onClick={() => vscode.postMessage({ type: "openFile", text: file.content })}>
3838
{file.path?.startsWith(".") && <span>.</span>}
39-
<StandardTooltip content={file.path} side="top" align="start" className="text-wrap max-w-[min(300px,100vw)]">
39+
<StandardTooltip content={removeLeadingNonAlphanumeric(file.path ?? "") + "\u200E" + (file.lineSnippet ? ` ${file.lineSnippet}` : "")} side="top" align="start" className="text-wrap max-w-[min(300px,100vw)]">
4040
<span className="whitespace-nowrap overflow-hidden text-ellipsis text-left mr-2 rtl">
4141
{removeLeadingNonAlphanumeric(file.path ?? "") + "\u200E"}
4242
{file.lineSnippet && ` ${file.lineSnippet}`}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ export const ChatRowContent = ({
601601
className="group"
602602
onClick={() => vscode.postMessage({ type: "openFile", text: tool.content })}>
603603
{tool.path?.startsWith(".") && <span>.</span>}
604-
<StandardTooltip content={tool.path} side="top" align="start" className="text-wrap max-w-[min(300px,100vw)]">
604+
<StandardTooltip content={removeLeadingNonAlphanumeric(tool.path ?? "") + "\u200E" + (tool.reason || "")} side="top" align="start" className="text-wrap max-w-[min(300px,100vw)]">
605605
<span className="whitespace-nowrap overflow-hidden text-ellipsis text-left mr-2 rtl">
606606
{removeLeadingNonAlphanumeric(tool.path ?? "") + "\u200E"}
607607
{tool.reason}

webview-ui/src/components/common/CodeAccordian.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const CodeAccordian = ({
5959
) : (
6060
<>
6161
{path?.startsWith(".") && <span>.</span>}
62-
<StandardTooltip content={path} side="top" align="start" className="text-wrap max-w-[min(300px,100vw)]">
62+
<StandardTooltip content={removeLeadingNonAlphanumeric(path ?? "") + "\u200E"} side="top" align="start" className="text-wrap max-w-[min(300px,100vw)]">
6363
<span className="whitespace-nowrap overflow-hidden text-ellipsis text-left mr-2 rtl">
6464
{removeLeadingNonAlphanumeric(path ?? "") + "\u200E"}
6565
</span>

0 commit comments

Comments
 (0)