diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx
index edbb1e147a..fc3c32e66b 100644
--- a/webview-ui/src/components/chat/ChatRow.tsx
+++ b/webview-ui/src/components/chat/ChatRow.tsx
@@ -16,7 +16,7 @@ import { useExtensionState } from "../../context/ExtensionStateContext"
import { findMatchingResourceOrTemplate } from "../../utils/mcp"
import { vscode } from "../../utils/vscode"
import { CheckpointControls, CheckpointOverlay } from "../common/CheckpointControls"
-import CodeAccordian, { cleanPathPrefix } from "../common/CodeAccordian"
+import CodeAccordian, { removeLeadingNonAlphanumeric } from "../common/CodeAccordian"
import CodeBlock, { CODE_BLOCK_BG_COLOR } from "../common/CodeBlock"
import MarkdownBlock from "../common/MarkdownBlock"
import SuccessButton from "../common/SuccessButton"
@@ -427,7 +427,7 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi
direction: "rtl",
textAlign: "left",
}}>
- {cleanPathPrefix(tool.path ?? "") + "\u200E"}
+ {removeLeadingNonAlphanumeric(tool.path ?? "") + "\u200E"}
void
@@ -67,7 +67,7 @@ const ContextMenu: React.FC = ({
direction: "rtl",
textAlign: "left",
}}>
- {cleanPathPrefix(option.value || "") + "\u200E"}
+ {removeLeadingNonAlphanumeric(option.value || "") + "\u200E"}
>
)
diff --git a/webview-ui/src/components/common/CodeAccordian.tsx b/webview-ui/src/components/common/CodeAccordian.tsx
index cb0c02bb42..36f8fbc1f9 100644
--- a/webview-ui/src/components/common/CodeAccordian.tsx
+++ b/webview-ui/src/components/common/CodeAccordian.tsx
@@ -20,7 +20,7 @@ We need to remove leading non-alphanumeric characters from the path in order for
[^a-zA-Z0-9]+: Matches one or more characters that are not alphanumeric.
The replace method removes these matched characters, effectively trimming the string up to the first alphanumeric character.
*/
-export const cleanPathPrefix = (path: string): string => path.replace(/^[^\u4e00-\u9fa5a-zA-Z0-9]+/, "")
+export const removeLeadingNonAlphanumeric = (path: string): string => path.replace(/^[^a-zA-Z0-9]+/, "")
const CodeAccordian = ({
code,
@@ -90,7 +90,7 @@ const CodeAccordian = ({
direction: "rtl",
textAlign: "left",
}}>
- {cleanPathPrefix(path ?? "") + "\u200E"}
+ {removeLeadingNonAlphanumeric(path ?? "") + "\u200E"}
>
)}