Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
12 changes: 12 additions & 0 deletions 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,6 +70,16 @@ const CodeAccordian = ({
</span>
</>
)}
{onJumpToFile && path && (
<span
className="codicon codicon-link-external mr-2 cursor-pointer"
style={{ fontSize: 13.5, margin: "1px 0" }}
onClick={(e) => {
e.stopPropagation()
onJumpToFile()
}}
/>
)}
<span className={`codicon codicon-chevron-${isExpanded ? "up" : "down"}`}></span>
</ToolUseBlockHeader>
)}
Expand Down