From 644db56d9cc9fd9ad81a0a5c09d24ff655f5db0f Mon Sep 17 00:00:00 2001 From: Roo Code Date: Tue, 15 Jul 2025 12:29:22 +0000 Subject: [PATCH 1/3] feat: add jump icon for newly created files - Add jump icon to newFileCreated tool case in ChatRow.tsx - Matches existing pattern from readFile case for consistent UX - Allows users to quickly open newly created files - Fixes issue #5736 --- webview-ui/src/components/chat/ChatRow.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index c508f7e9065..4aeaea6e654 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -496,6 +496,20 @@ export const ChatRowContent = ({ : t("chat:fileOperations.wantsToCreate")} + + vscode.postMessage({ type: "openFile", text: tool.path })}> + {tool.path?.startsWith(".") && .} + + {removeLeadingNonAlphanumeric(tool.path ?? "") + "\u200E"} + +
+ +
+
Date: Tue, 15 Jul 2025 20:06:11 +0000 Subject: [PATCH 2/3] fix: remove duplicate file path display in newFileCreated case - Removed redundant ToolUseBlock that was showing file path twice - Added onJumpToFile prop to CodeAccordian component to support jump icon - Jump icon now appears in CodeAccordian header for newFileCreated files - Maintains consistent UX with existing file operations while avoiding duplication Fixes feedback from @daniel-lxs about duplicate elements being shown --- webview-ui/src/components/chat/ChatRow.tsx | 15 +-------------- .../src/components/common/CodeAccordian.tsx | 12 ++++++++++++ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index 4aeaea6e654..acb1e57e220 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -496,20 +496,6 @@ export const ChatRowContent = ({ : t("chat:fileOperations.wantsToCreate")} - - vscode.postMessage({ type: "openFile", text: tool.path })}> - {tool.path?.startsWith(".") && .} - - {removeLeadingNonAlphanumeric(tool.path ?? "") + "\u200E"} - -
- -
-
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 b07461c70e2..ea73aa2f561 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,6 +70,16 @@ const CodeAccordian = ({ )} + {onJumpToFile && path && ( + { + e.stopPropagation() + onJumpToFile() + }} + /> + )} )} From fe0e482e5dc6dbe1c7726cf7cd0c5bc0154f3b9a Mon Sep 17 00:00:00 2001 From: Daniel Riccio Date: Tue, 22 Jul 2025 12:18:13 -0500 Subject: [PATCH 3/3] fix: address PR feedback for jump icon on new files - Fix openFile message to use correct path format with './' prefix - Remove duplicate chevron icon when jump icon is present - Add aria-label for accessibility - Fix styling: use mr-1 to match progressStatus icon - Remove redundant margin style from jump icon --- webview-ui/src/components/chat/ChatRow.tsx | 2 +- webview-ui/src/components/common/CodeAccordian.tsx | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index acb1e57e220..1961091cb18 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -503,7 +503,7 @@ export const ChatRowContent = ({ isLoading={message.partial} isExpanded={isExpanded} onToggleExpand={handleToggleExpand} - onJumpToFile={() => vscode.postMessage({ type: "openFile", text: tool.path })} + 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 ea73aa2f561..7dcef11e108 100644 --- a/webview-ui/src/components/common/CodeAccordian.tsx +++ b/webview-ui/src/components/common/CodeAccordian.tsx @@ -72,15 +72,16 @@ const CodeAccordian = ({ )} {onJumpToFile && path && ( { e.stopPropagation() onJumpToFile() }} + aria-label={`Open file: ${path}`} /> )} - + {!onJumpToFile && } )} {(!hasHeader || isExpanded) && (