diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx
index c508f7e906..1961091cb1 100644
--- a/webview-ui/src/components/chat/ChatRow.tsx
+++ b/webview-ui/src/components/chat/ChatRow.tsx
@@ -503,6 +503,7 @@ export const ChatRowContent = ({
isLoading={message.partial}
isExpanded={isExpanded}
onToggleExpand={handleToggleExpand}
+ onJumpToFile={() => vscode.postMessage({ type: "openFile", text: "./" + tool.path })}
/>
>
)
diff --git a/webview-ui/src/components/common/CodeAccordian.tsx b/webview-ui/src/components/common/CodeAccordian.tsx
index b07461c70e..7dcef11e10 100644
--- a/webview-ui/src/components/common/CodeAccordian.tsx
+++ b/webview-ui/src/components/common/CodeAccordian.tsx
@@ -17,6 +17,7 @@ interface CodeAccordianProps {
isFeedback?: boolean
onToggleExpand: () => void
header?: string
+ onJumpToFile?: () => void
}
const CodeAccordian = ({
@@ -29,6 +30,7 @@ const CodeAccordian = ({
isFeedback,
onToggleExpand,
header,
+ onJumpToFile,
}: CodeAccordianProps) => {
const inferredLanguage = useMemo(() => language ?? (path ? getLanguageFromPath(path) : "txt"), [path, language])
const source = useMemo(() => code.trim(), [code])
@@ -68,7 +70,18 @@ const CodeAccordian = ({
>
)}
-
+ {onJumpToFile && path && (
+ {
+ e.stopPropagation()
+ onJumpToFile()
+ }}
+ aria-label={`Open file: ${path}`}
+ />
+ )}
+ {!onJumpToFile && }
)}
{(!hasHeader || isExpanded) && (