Repository navigation
Fix reordering workspaces with collapsed children - #25302
Conversation
|
This run was cancelled 🛑 The workflow was cancelled before completion. Please check the link below for details. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughManual sort mode now preserves lineage-parent positions when visible worktrees are computed. The change adds unit tests for local and SSH hosts and an end-to-end test for reordering a collapsed parent in both worktree card styles. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The collapsed-parent reorder change is ready to merge after normal checks; no actionable issue remains from this review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |

ELI5
A workspace with collapsed children could start dragging, but dropping it lower in the sidebar appeared to do nothing. Its hidden children kept pulling the parent back above the destination. Manual order now honors the parent’s saved position.
What Changed
In Manual mode, the visibility pipeline adds required ancestor cards before applying saved order. Previously it added ancestors afterward, placing a parent at its highest-ranked child’s position. The sidebar and the shared visibility inputs used by keyboard navigation now select the same policy. Parents still appear when a visible child needs them, and expanding their children preserves the hierarchy.
Why
The parent controls its manual placement. Fixing the ordering pipeline avoids rewriting every hidden descendant’s rank on each drag and preserves activity-based parent promotion in automatic sort modes. This applies to local and remote workspaces; it changes no host operations or wire messages.
Linked Issue
Reported directly by a maintainer; no existing issue.
Visual Proof
Same downward drag, with 53 children collapsed. Before: the parent remains above Last workspace. After: the parent lands below Last workspace. Captured from hidden Electron renderers on macOS; the original code fails the regression assertion and the fixed code passes.
Testing
All app launches used
ORCA_BACKGROUND_LAUNCH=1.worktree-parent-reorder.spec.ts --repeat-each=3: 6 passed on macOS, covering downward/upward drags and child expansion in both card styles. The same test fails against the original code. Synthetic rows skip IPC persistence; unit tests cover the real write action.pnpm tc,pnpm run check:code-quality:changed, andpnpm exec electron-vite build --mode e2epassed.Windows/Linux UI and live SSH were not exercised locally. Full lint, full suite, and release build are left to CI.
Review
Self-reviewed ancestor injection, saved ordering, filtered parents, child hierarchy, and shortcut visibility inputs.
Agent skill upstream boundary
Notes
No new paths, shortcuts, provider-specific behavior, persistence fields, or remote protocol changes. Folder workspace rows retain their existing ordering. The same filtering and sorting passes are reused; no per-child writes are added.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) — targeted local checks above; remaining coverage in CI.