Skip to content

fix(desktop): nested hidden files not showing when toggle enabled#1220

Closed
de1mat wants to merge 1 commit into
superset-sh:mainfrom
de1mat:fix/nested-hidden-files
Closed

fix(desktop): nested hidden files not showing when toggle enabled#1220
de1mat wants to merge 1 commit into
superset-sh:mainfrom
de1mat:fix/nested-hidden-files

Conversation

@de1mat
Copy link
Copy Markdown
Contributor

@de1mat de1mat commented Feb 5, 2026

Summary

Fixes an issue where nested hidden folders/files don't appear when "Show Hidden Files" is enabled in the file browser.

Root cause: The toggle only invalidated the root directory's children cache, so nested expanded folders kept their stale children (fetched with includeHidden: false).

Fix:

  • Update the ref synchronously before invalidation so getChildren uses the correct includeHidden value
  • Invalidate all expanded directories on toggle, not just root

Test plan

  1. Open a workspace with nested folders containing hidden items (e.g., .github/ inside a subfolder)
  2. Expand the folder tree to show nested folders
  3. Toggle "Show Hidden Files" on
  4. Verify hidden folders/files appear at all levels, not just root

Closes #1193

Summary by CodeRabbit

  • Bug Fixes
    • Fixed hidden file visibility toggle to properly refresh all nested directories, ensuring hidden files within subdirectories display correctly when visibility settings are changed.

- 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 superset-sh#1193
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

Modified the hidden files toggle functionality in FilesView to synchronously update the showHiddenFilesRef with a computed value. Expanded invalidation logic to iterate through all items and invalidate children IDs for directories, ensuring nested hidden files load correctly when visibility is toggled.

Changes

Cohort / File(s) Summary
Hidden Files Toggle Enhancement
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/FilesView/FilesView.tsx
Enhanced state management by synchronously updating showHiddenFilesRef.current with computed newValue. Expanded invalidation logic to iterate through all items and invalidate children IDs for directories, replacing previous behavior that only invalidated the root item.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰✨ A toggle so neat, a ref that's true,
Hidden files dance when we say "show, don't stew!"
Nested directories bloom in the light,
One little change makes everything right. 🌿

🚥 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 accurately and specifically describes the main change: fixing nested hidden files not showing when the toggle is enabled.
Description check ✅ Passed The pull request description covers all required template sections with clear explanations of the root cause, fix, and test plan, fully meeting repository standards.

✏️ 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

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/FilesView/FilesView.tsx`:
- Around line 270-284: The state updater in handleToggleHiddenFiles mutates
showHiddenFilesRef inside the setShowHiddenFiles functional updater which can
run later and causes invalidation to see the old value; instead compute the new
value first, synchronously assign showHiddenFilesRef.current = newValue, call
the invalidation logic (tree.getItemInstance("root")?.invalidateChildrenIds()
and iterating tree.getItems() to call invalidateChildrenIds on directories)
using that newValue, and only then call setShowHiddenFiles(newValue); remove
side effects from the updater to avoid Strict Mode double-invocation and ensure
invalidation uses the correct includeHidden state.

@Kitenite
Copy link
Copy Markdown
Collaborator

Kitenite commented Feb 5, 2026

Superseded by #1230 which merges cleanly with main. Thank you @de1mat for the original fix!

@Kitenite Kitenite closed this Feb 5, 2026
@Kitenite
Copy link
Copy Markdown
Collaborator

Kitenite commented Feb 5, 2026

For whatever reason i couldn't push to this PR to fix the merge conflict so i opened another one and attributed it to you.

@Kitenite
Copy link
Copy Markdown
Collaborator

Kitenite commented Feb 5, 2026

Thanks @de1mat !

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

2 participants