Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions webview-ui/src/components/chat/ChatRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ export const ChatRowContent = ({
isLoading={message.partial}
isExpanded={isExpanded}
onToggleExpand={handleToggleExpand}
onJumpToFile={() => vscode.postMessage({ type: "openFile", text: "./" + tool.path })}
/>
</>
)
Expand Down
15 changes: 14 additions & 1 deletion webview-ui/src/components/common/CodeAccordian.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface CodeAccordianProps {
isFeedback?: boolean
onToggleExpand: () => void
header?: string
onJumpToFile?: () => void
}

const CodeAccordian = ({
Expand All @@ -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])
Expand Down Expand Up @@ -68,7 +70,18 @@ const CodeAccordian = ({
</span>
</>
)}
<span className={`codicon codicon-chevron-${isExpanded ? "up" : "down"}`}></span>
{onJumpToFile && path && (
<span
className="codicon codicon-link-external mr-1"
style={{ fontSize: 13.5 }}
onClick={(e) => {
e.stopPropagation()
onJumpToFile()
}}
aria-label={`Open file: ${path}`}
/>
)}
{!onJumpToFile && <span className={`codicon codicon-chevron-${isExpanded ? "up" : "down"}`}></span>}
</ToolUseBlockHeader>
)}
{(!hasHeader || isExpanded) && (
Expand Down
Loading