Repository navigation
fix(e2e): wait for terminal remount after golden worktree switch - #21837
Conversation
Mac release goldens failed after switching back to the original worktree: sidebar aria-current landed while the store still pointed at the child tab, so waitForActiveTerminalManager timed out. Wait for activeWorktreeId, force the terminal tab visible, and restore this spec from the workflow ref so older cut SHAs pick up the harness.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe golden tests now restore the expected active worktree after sidebar closure and wait for store activation and terminal visibility during worktree switching. The release workflow also restores the worktree-switching golden spec from the workflow ref, and its contract test verifies that command. Priority: ⬇️ Low 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the failure and fix, but it omits several required template sections, including the linked issue, visual proof or an explicit N/A explanation, testing checklist details, AI disclosure, review, boundary, notes, and the final checklist. Resolution Add the missing required sections. Include a linked issue after “Fixes #”, provide before-and-after visual proof or write
✨ 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.
ℹ️ No critical issues — one minor comment/behaviour mismatch inline.
Reviewed changes
- Golden worktree-switch remount wait — after clicking back to the original worktree, poll the store for the original
activeWorktreeIdand callensureTerminalVisiblebefore waiting on the PaneManager, so the isolation assertion runs against the remounted tab. - File-link sidebar-close recovery — after closing the sidebars, re-assert the source worktree and terminal before the
terminal.cols > 120poll, guarding against the mac CI drop that remounts Landing. - Release-cut harness restore — adds
golden-worktree-create-switch.spec.tsto the workflow-ref restore list and pins it in the dispatch-contract test.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| // Why: closing the left sidebar can drop activeWorktreeId on mac CI, | ||
| // which remounts Landing and leaves terminal.cols at 0. | ||
| if (state && state.activeWorktreeId !== sourceWorktreeId) { | ||
| state.setActiveWorktree(sourceWorktreeId) | ||
| } |
There was a problem hiding this comment.
This guard reads the state snapshot captured before setSidebarOpen/setRightSidebarOpen, so it evaluates the pre-close activeWorktreeId and cannot observe a drop caused by the close — the ensureTerminalVisible call below is what actually recovers. Consider re-reading window.__store.getState() after the setters, or adjusting the comment, so the stated rationale matches the behavior.

Problem
Mac release-cut golden
creates a worktree, keeps its terminal isolated, and switches backfailed withActive terminal PaneManager did not finish mounting. The sidebararia-currentupdate can land beforeactiveWorktreeIdand the original worktree's PaneManager remount.A sibling golden also remounted Landing on mac after closing the left sidebar (
terminal.colsstayed 0).Fix
ensureTerminalVisiblebefore waiting on the PaneManager.golden-worktree-create-switch.spec.tsfrom the workflow ref so older cut SHAs pick up the harness.Linux and Windows goldens on the cut already passed; only mac hit this.