diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx
index b01b3a2775..6a8a4d685c 100644
--- a/webview-ui/src/components/chat/ChatRow.tsx
+++ b/webview-ui/src/components/chat/ChatRow.tsx
@@ -742,51 +742,12 @@ export const ChatRowContent = ({
>
)
}
- case "listFilesTopLevel": {
- // Check if this is a batch directory listing request
- const isBatchDirRequest = message.type === "ask" && tool.batchDirs && Array.isArray(tool.batchDirs)
-
- if (isBatchDirRequest) {
- return (
- <>
-
-
-
- {t("chat:directoryOperations.wantsToViewMultipleDirectories")}
-
-
-
- >
- )
- }
-
- return (
- <>
-
-
-
- {message.type === "ask"
- ? tool.isOutsideWorkspace
- ? t("chat:directoryOperations.wantsToViewTopLevelOutsideWorkspace")
- : t("chat:directoryOperations.wantsToViewTopLevel")
- : tool.isOutsideWorkspace
- ? t("chat:directoryOperations.didViewTopLevelOutsideWorkspace")
- : t("chat:directoryOperations.didViewTopLevel")}
-
-
-
-
-
- >
- )
- }
+ case "listFilesTopLevel":
case "listFilesRecursive": {
+ const isRecursive = tool.tool === "listFilesRecursive"
+ const DirIcon = isRecursive ? FolderTree : ListTree
+ const dirIconLabel = isRecursive ? "Folder tree icon" : "List files icon"
+
// Check if this is a batch directory listing request
const isBatchDirRequest = message.type === "ask" && tool.batchDirs && Array.isArray(tool.batchDirs)
@@ -794,7 +755,7 @@ export const ChatRowContent = ({
return (
<>
-
+
{t("chat:directoryOperations.wantsToViewMultipleDirectories")}
@@ -804,25 +765,33 @@ export const ChatRowContent = ({
)
}
+ const labelKey = isRecursive
+ ? message.type === "ask"
+ ? tool.isOutsideWorkspace
+ ? "chat:directoryOperations.wantsToViewRecursiveOutsideWorkspace"
+ : "chat:directoryOperations.wantsToViewRecursive"
+ : tool.isOutsideWorkspace
+ ? "chat:directoryOperations.didViewRecursiveOutsideWorkspace"
+ : "chat:directoryOperations.didViewRecursive"
+ : message.type === "ask"
+ ? tool.isOutsideWorkspace
+ ? "chat:directoryOperations.wantsToViewTopLevelOutsideWorkspace"
+ : "chat:directoryOperations.wantsToViewTopLevel"
+ : tool.isOutsideWorkspace
+ ? "chat:directoryOperations.didViewTopLevelOutsideWorkspace"
+ : "chat:directoryOperations.didViewTopLevel"
+
return (
<>
-
-
- {message.type === "ask"
- ? tool.isOutsideWorkspace
- ? t("chat:directoryOperations.wantsToViewRecursiveOutsideWorkspace")
- : t("chat:directoryOperations.wantsToViewRecursive")
- : tool.isOutsideWorkspace
- ? t("chat:directoryOperations.didViewRecursiveOutsideWorkspace")
- : t("chat:directoryOperations.didViewRecursive")}
-
+
+ {t(labelKey)}