fix(desktop): nested hidden files not showing when toggle enabled#1220
fix(desktop): nested hidden files not showing when toggle enabled#1220de1mat wants to merge 1 commit into
Conversation
- 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
📝 WalkthroughWalkthroughModified 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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.
|
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. |
|
Thanks @de1mat ! |
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:
getChildrenuses the correctincludeHiddenvalueTest plan
.github/inside a subfolder)Closes #1193
Summary by CodeRabbit