From d6a9f07af916980885f8e23482865e33b5ece48f Mon Sep 17 00:00:00 2001 From: Matthew Delmarter Date: Thu, 5 Feb 2026 16:09:53 +1300 Subject: [PATCH] fix(desktop): nested hidden files not showing when toggle enabled - Update ref synchronously before invalidation so getChildren uses correct includeHidden value - Invalidate all expanded directories on toggle, not just root, so nested hidden files appear when setting is enabled Closes #1193 --- .../RightSidebar/FilesView/FilesView.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/FilesView/FilesView.tsx b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/FilesView/FilesView.tsx index 8f3e95a78eb..d22151f3449 100644 --- a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/FilesView/FilesView.tsx +++ b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/FilesView/FilesView.tsx @@ -268,8 +268,20 @@ export function FilesView() { }, [tree]); const handleToggleHiddenFiles = useCallback(() => { - setShowHiddenFiles((v) => !v); + setShowHiddenFiles((prev) => { + const newValue = !prev; + // Update ref synchronously so invalidation uses correct value + showHiddenFilesRef.current = newValue; + return newValue; + }); + // Invalidate root explicitly (getItems() may not include it) tree.getItemInstance("root")?.invalidateChildrenIds(); + // Also invalidate expanded directories so nested hidden files appear + for (const item of tree.getItems()) { + if (item.getItemData()?.isDirectory) { + item.invalidateChildrenIds(); + } + } }, [tree]); const searchResultEntries = useMemo(() => {