fix(ui): preserve root dir state when sibling dir is expanded#2393
fix(ui): preserve root dir state when sibling dir is expanded#2393trivikr wants to merge 4 commits intonpmx-dev:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughChanged FileTree auto-expansion so Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5fb276bf-51e8-4d8d-a8c7-d5b8cd6fdb78
📒 Files selected for processing (3)
app/components/Code/FileTree.vueapp/composables/useFileTreeState.tstest/nuxt/components/CodeFileTree.spec.ts
ghostdevv
left a comment
There was a problem hiding this comment.
Could you take a look at the other review comments too?
- Recompute expanded state after toggling or auto-expanding directories - Only auto-expand ancestors for the top-level tree - Add regression coverage for sibling directory expansion
c4d8f05 to
f13968d
Compare
🔗 Linked issue
resolves #2363
🧭 Context
The package code sidebar was re-expanding a collapsed sibling directory when another directory in the same tree was opened. On
ky@1.14.3, collapsingcore/and then expandingtypes/caused both directories to appear expanded again.This change fixes the tree expansion logic so only the intended directory opens, and adds coverage for the regression.
📚 Description
The root cause was that the code tree auto-expanded the current file path from recursive
CodeFileTreeinstances, not just from the root tree. That meant a subtree remount could re-apply ancestor expansion and reopen a directory the user had just collapsed.This PR:
Setafter mutations