From 746fbcb130927c19243e6035f5e563be5d7d8045 Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 13 Jun 2025 14:23:18 -0500 Subject: [PATCH] chore: adding opened icon --- src/components/CustomIcon.tsx | 13 +++++++++++-- src/components/Explorer/FileExplorer.tsx | 14 ++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/components/CustomIcon.tsx b/src/components/CustomIcon.tsx index aecea7159..6efd5ff76 100644 --- a/src/components/CustomIcon.tsx +++ b/src/components/CustomIcon.tsx @@ -548,8 +548,17 @@ const CustomIconMap = { ), folderOpen: ( - - + + ), gear: ( diff --git a/src/components/Explorer/FileExplorer.tsx b/src/components/Explorer/FileExplorer.tsx index 5166cd262..dc491e584 100644 --- a/src/components/Explorer/FileExplorer.tsx +++ b/src/components/Explorer/FileExplorer.tsx @@ -179,7 +179,6 @@ export const FileExplorer = ({ const isFile = child.children === null const isKCLFile = isFile && child.name?.endsWith(FILE_EXT) - /** * If any parent is closed, keep the history of open children */ @@ -192,10 +191,13 @@ export const FileExplorer = ({ pathIterator.pop() } - - const amIOpen = openedRows[constructPath({parentPath: child.parentPath, name: child.name})] - const isOpen = (openedRows[child.parentPath] || - parentProject.name === child.parentPath) && + const amIOpen = + openedRows[ + constructPath({ parentPath: child.parentPath, name: child.name }) + ] + const isOpen = + (openedRows[child.parentPath] || + parentProject.name === child.parentPath) && !isAnyParentClosed let icon: CustomIconName = 'file' @@ -203,7 +205,7 @@ export const FileExplorer = ({ icon = 'kcl' } else if (!isFile && !amIOpen) { icon = 'folder' - } else if(!isFile && amIOpen) { + } else if (!isFile && amIOpen) { icon = 'folderOpen' }