From 50a88c155fb0465c8b08556bfc4c6005470e42c5 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sat, 23 Nov 2024 02:46:55 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- examples/experimental/nodes/frontend/src/App.tsx | 2 +- .../nodes/frontend/src/hooks/useFileSystems.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/experimental/nodes/frontend/src/App.tsx b/examples/experimental/nodes/frontend/src/App.tsx index 3e69db9a..6c718a9c 100644 --- a/examples/experimental/nodes/frontend/src/App.tsx +++ b/examples/experimental/nodes/frontend/src/App.tsx @@ -101,7 +101,7 @@ const App: React.FC = () => { } // Check if it's a command output else if (messageData.data?.data_type === "text" && - messageData.data.text.includes("CmdOutputObservation") && + messageData.data.text.includes("CmdOutputObservation") && !messageData.data.text.includes("**FILE_SYSTEM_REFRESH**")) { // Extract command output from the message const parts = messageData.data.text.split("**CmdOutputObservation (source=None, exit code=0)**"); diff --git a/examples/experimental/nodes/frontend/src/hooks/useFileSystems.ts b/examples/experimental/nodes/frontend/src/hooks/useFileSystems.ts index 26c96e7e..ce3735d6 100644 --- a/examples/experimental/nodes/frontend/src/hooks/useFileSystems.ts +++ b/examples/experimental/nodes/frontend/src/hooks/useFileSystems.ts @@ -132,11 +132,11 @@ export const useFileSystem = () => { const updateFileSystemFromList = (fileList: string[]) => { // Initialize root workspace folder - const newTree: FileNode[] = [{ - name: 'workspace', - type: 'folder', - path: '/workspace', - children: [] + const newTree: FileNode[] = [{ + name: 'workspace', + type: 'folder', + path: '/workspace', + children: [] }]; // Create a set of existing file paths for quick lookup @@ -147,7 +147,7 @@ export const useFileSystem = () => { // Clean up the file path const cleanedPath = filePath.replace(/^\/workspace\//, '').trim().replace(/\\r/g, ''); // Remove \r const segments = cleanedPath.split('/').filter(Boolean); - + if (segments.length === 0) return; // Skip if it's just the workspace folder let currentLevel = newTree[0].children!; @@ -156,7 +156,7 @@ export const useFileSystem = () => { // Process each segment of the path segments.forEach((segment, index) => { currentPath += '/' + segment; - + // If we're at the last segment, it's a file if (index === segments.length - 1) { // Check if the file already exists @@ -166,7 +166,7 @@ export const useFileSystem = () => { type: 'file', path: currentPath }); - } + } } else { // It's a folder let folder = currentLevel.find(