Skip to content

fix(desktop): show nested hidden files/folders when toggle is enabled#1214

Closed
Kitenite wants to merge 1 commit into
mainfrom
kitenite/bug-nested-hidden-folders-do-not-show-even-when-sh
Closed

fix(desktop): show nested hidden files/folders when toggle is enabled#1214
Kitenite wants to merge 1 commit into
mainfrom
kitenite/bug-nested-hidden-folders-do-not-show-even-when-sh

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Feb 5, 2026

Summary

  • Fixes [bug] nested hidden folders do not show even when "Show Hidden Files" is enabled #1193
  • When toggling "Show Hidden Files" in the file browser, only root-level hidden items appeared. Nested hidden folders/files inside expanded directories remained invisible because only the root's children cache was invalidated.
  • Now invalidates the headless-tree children cache for all expanded items (via tree.getState().expandedItems), not just root, so hidden entries appear at every directory level.

Note on #1213

PR #1213 attempts to fix this by clearing childrenCache in the useFileTree hook, but that hook is not imported or used by FilesView.tsx. The active file tree uses @headless-tree/react's useTree with asyncDataLoaderFeature directly, which has its own internal cache. This PR targets the correct code path.

Test plan

  • Enable "Show Hidden Files" toggle in file browser
  • Expand a non-hidden folder that contains hidden subfolders/files (e.g. folder/.hidden-subfolder)
  • Verify nested hidden items appear at all levels
  • Toggle off — verify nested hidden items disappear at all levels
  • Collapse a folder, toggle hidden files, re-expand — verify correct state

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where toggling hidden files didn't update visibility across all expanded items in the file tree, ensuring consistent display throughout.

Invalidate children cache for all expanded items (not just root) when
toggling "Show Hidden Files", so nested hidden entries appear at every
directory level.

Fixes #1193
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

The handleToggleHiddenFiles function in FilesView.tsx has been enhanced to expand its invalidation scope. Beyond invalidating the root node's children, the function now iterates through all currently expanded nodes in the tree and invalidates their children as well, ensuring consistent hidden file visibility across the entire expanded tree structure.

Changes

Cohort / File(s) Summary
Tree Invalidation Enhancement
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/FilesView/FilesView.tsx
Extended handleToggleHiddenFiles to invalidate children of all expanded tree nodes, not just the root, ensuring hidden file visibility updates propagate across the entire expanded tree structure.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 Files hidden, files shown,
Through every branch, the change is known,
Each expanded node now understands,
The toggle spreads through all the lands! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: fixing nested hidden files/folders visibility when the toggle is enabled.
Description check ✅ Passed The PR description is comprehensive, covering the issue fixed, the technical approach, comparison to an alternative PR, and a detailed test plan with checkboxes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kitenite/bug-nested-hidden-folders-do-not-show-even-when-sh

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Kitenite
Copy link
Copy Markdown
Collaborator Author

Kitenite commented May 6, 2026

Closing as stale: created in Jan-Mar with no recent activity. If still relevant, re-open or re-create from a fresh branch. Bulk audit 2026-05-06.

@Kitenite Kitenite closed this May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] nested hidden folders do not show even when "Show Hidden Files" is enabled

1 participant