Repository navigation
Keep sidebar position when deleting active worktree - #16040
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe change preserves sidebar context when a successor worktree becomes active after deletion. It adds virtual row removal animation that tracks row identities, layout changes, scroll offsets, and lineage rekeys. The animation skips reduced-motion and sticky-header cases. The row measurement hook invokes the animation logic. Unit tests cover motion calculations. End-to-end tests validate positioning, active-worktree reassignment, removal timing, complete removal, and reduced-motion behavior. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1027c99a-1096-4ef1-898b-8285ed14a578
📒 Files selected for processing (6)
src/renderer/src/components/sidebar/active-worktree-focus-after-delete.test.tssrc/renderer/src/components/sidebar/active-worktree-focus-after-delete.tssrc/renderer/src/components/sidebar/worktree-list/viewport/use-row-measurement.tssrc/renderer/src/components/sidebar/worktree-list/viewport/use-row-removal-animation.test.tssrc/renderer/src/components/sidebar/worktree-list/viewport/use-row-removal-animation.tstests/e2e/worktree-active-delete-scroll-position.spec.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.
…rktree-jump-to-top-no-good
…rktree-jump-to-top-no-good
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: af3ea757-ac83-4505-9eed-4e0432547718
📒 Files selected for processing (2)
src/renderer/src/components/sidebar/worktree-list/viewport/use-row-removal-animation.tstests/e2e/worktree-active-delete-scroll-position.spec.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
…rktree-jump-to-top-no-good
…rktree-jump-to-top-no-good
(cherry picked from commit c83499f)
ELI5
Deleting the worktree you are viewing still opens Orca's existing most-recently-used successor, but the sidebar stays where you were instead of jumping to that successor near the top. The surrounding rows smoothly close the deleted row's gap.
What Changed
Why
Active-worktree deletion previously activated the correct successor but also revealed it in the sidebar. When that MRU successor was far away, the sidebar jumped away from the deleted row and destroyed the user's spatial context. This keeps the existing successor policy and changes only its sidebar navigation side effect.
Linked Issue
No linked issue was provided for this task.
Visual Proof
Active worktree selected → Delete menu → stable animated collapse. The final-head recording holds on the selected row and open Delete menu, then shows the row removed without changing the sidebar scroll position. The active terminal after deletion is expected: Orca keeps the existing MRU-successor behavior.
page@78ef11762e80e1ac0b79c60cdeaff799.webm
Testing
Final-head evidence:
oxlint,oxfmt --check, and changed-lines React Doctor passedpnpm run lint,pnpm run typecheck,pnpm run typecheck:web, andpnpm buildpassed during the final review passpnpm test: 57,539 passed; 9 failures reproduce independently in three untouched current-main test files (worktree-base-directory-poller.test.ts,filesystem-watcher-real.test.ts, andssh-connection-host-key-store-wiring.test.ts)Platform scope: rendered behavior was inspected on macOS Electron. Linux changed-spec E2E and Windows packaging are covered by PR CI. The implementation uses platform-neutral Chromium DOM and Web Animations APIs.
AI Disclosure
Review
Please focus on the post-delete successor reveal suppression, virtual-row motion planning, scroll-anchor interaction, and the bounded frame sampler.
Agent skill upstream boundary
Notes
Renderer-only scope. No dependency, persistence, IPC/RPC, remote-wire, mobile-facing, network, shell, path, Git/provider, or SSH execution-boundary changes. Runtime-owned SSH successor filtering remains unchanged.
Checklist