Repository navigation
Fix Files pane refresh after filesystem changes - #9589
teamleaderleo merged 6 commits into
Conversation
|
Warning Review limit reachedNext included review available in 21 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe File Explorer coordinator now detects content revisions, refreshes stale nested rows, and processes newly revealed descendants during expansion restoration. Regression tests verify row replacement, expansion preservation, and retained file selection. ChangesFile Explorer refresh
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 25✅ Passed checks (25 passed)
✨ 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 |
|
All contributors have signed the CLA ✍️ ✅ |
|
Thank you for this, @jiancui-research! Having the Files pane pick up changes inside expanded folders (and keep them expanded) is really nice. It's reviewed, up to date with main and CI is running. The one thing left before we can merge is the CLA: just comment the line below and we'll land it :D
|
|
I have read the CLA Document v2.2 and I hereby sign the CLA |
|
Merged, thank you @jiancui-research! The Files pane now keeps up with changes inside expanded folders :D |
|
Merge receipt for |
1348db7 test: stop asserting SwiftUI rows in the sidebar AX walk again (manaflow-ai#14625) 2e269cd Fix Files pane refresh after filesystem changes (manaflow-ai#9589)
Summary
FileExplorerStore.contentRevisionchanges, even when the root item count stays the same.Why
FileExplorerStore.reload()replaces the tree with newFileExplorerNodeinstances and incrementscontentRevision. The outline coordinator previously calledreloadData()only when the root node count changed. Adding or removing a file inside an expanded directory leaves that count unchanged, soNSOutlineViewcontinued displaying the pre-reload node instances.The coordinator now treats a content revision change as a full outline invalidation. Expansion restoration uses a dynamic row-count loop because expanding a parent reveals additional descendant rows during the same pass.
References
NSOutlineView-based file explorer and expansion-state restoration behavior.FileExplorerStoreto the sharedFileWatcherinfrastructure.Testing
Added to
cmuxTests/FileExplorerStoreTests.swift:testOutlineReplacesNestedRowsWhenContentRevisionChangesWithoutCountChangestestRevisionReloadRestoresNestedExpansionAndSelectionAvailable local checks:
swiftc -frontend -parse Sources/FileExplorerView.swift cmuxTests/FileExplorerStoreTests.swiftpassed../scripts/lint-pbxproj-test-wiring.shpassed (651test files checked).Local verification limitations on this workstation:
cmux-unittest execution is unavailable because no full Xcode installation is present;xcode-selectpoints to CommandLineTools.Demo Video
Pending a tagged build and manual dogfood verification.
Checklist
Summary by CodeRabbit
Bug Fixes
Tests