Skip to content

fix(desktop): refresh button not showing new files in nested folders#1228

Merged
Kitenite merged 1 commit into
superset-sh:mainfrom
de1mat:fix/file-tree-refresh-nested
Feb 5, 2026
Merged

fix(desktop): refresh button not showing new files in nested folders#1228
Kitenite merged 1 commit into
superset-sh:mainfrom
de1mat:fix/file-tree-refresh-nested

Conversation

@de1mat
Copy link
Copy Markdown
Contributor

@de1mat de1mat commented Feb 5, 2026

Fixes #1227

Summary

The refresh button only invalidated the root directory cache, causing new files in nested folders to remain invisible until the panel was reopened.

Changes

Updated handleRefresh to invalidate all expanded directories, matching the pattern already used by handleToggleHiddenFiles.

Test Plan

  1. Open a workspace and expand a nested folder
  2. Create a file externally in that folder
  3. Click refresh - file should now appear

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where newly added or moved files within subdirectories weren't properly reflected in the file view. The file display now correctly refreshes all directory contents during updates.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

The handleRefresh function in FilesView.tsx now explicitly invalidates cache for all directory items, not just the root. This ensures newly created or moved files in expanded nested folders appear immediately after clicking refresh, rather than requiring a side panel close/reopen.

Changes

Cohort / File(s) Summary
File Tree Refresh Cache Invalidation
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/FilesView/FilesView.tsx
Added iteration over all items to invalidate children cache for directories during refresh, complementing root item invalidation to address stale nested folder caches.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 A refresh that hops through folders deep,
No more caches the tree must keep,
Nested files now appear with glee,
When new-born code joins the tree!

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main bug fix: the refresh button not showing new files in nested folders, which matches the primary change in the PR.
Description check ✅ Passed The PR description includes a clear summary, related issue link, specific changes made, and a detailed test plan covering the fixed functionality.
Linked Issues check ✅ Passed The PR successfully addresses issue #1227 by updating handleRefresh to invalidate all expanded directories, enabling proper display of newly created files in nested folders after refresh.
Out of Scope Changes check ✅ Passed All changes in the PR are directly related to the linked issue #1227 regarding the file tree refresh functionality for nested folders, with no out-of-scope modifications.

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

@Kitenite Kitenite left a comment

Choose a reason for hiding this comment

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

Works great, thanks @de1mat !

@Kitenite Kitenite merged commit 6345491 into superset-sh:main Feb 5, 2026
5 checks passed
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] File tree refresh doesn't show new files in nested folders

2 participants