Repository navigation
Investigate split window blank (#3386) - #3923
austinywang wants to merge 14 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughWorkspace centralizes terminal split/surface lifecycle into private helpers and updates call sites to use them. New Python test helpers assert split terminals render output; split-creation tests now invoke those helpers. A new Swift unit test is added and wired into the cmuxTests target. ChangesTerminal Split Lifecycle Refactoring and Rendering Verification
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 16 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (16 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Greptile SummaryThis PR centralizes the terminal split lifecycle into three shared
Confidence Score: 5/5Safe to merge — all three split paths now call beginEventDrivenLayoutFollowUp, the single-tab source-pane guard is restored, and the removed scheduleTerminalGeometryReconcile is fully subsumed by the new lifecycle helpers. The production Swift changes are functionally correct: the version-invalidation mechanism in beginEventDrivenLayoutFollowUp safely handles the double-call that occurs in the newTerminalSplit focus path, and the tab is already selected by createTab before the geometry pass runs in the UI-split path. No bad state is left representable. Test coverage targets the specific invariant that was previously unguarded. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant Workspace
participant commitHelper as commitNewTerminalSplitPane
participant bonsplit as BonsplitController
participant lifecycle as beginTerminalSplitPaneLifecycle
participant followUp as beginEventDrivenLayoutFollowUp
Note over Caller,followUp: Programmatic split path (newTerminalSplit / splitPaneWithNewTerminal)
Caller->>Workspace: newTerminalSplit(from:orientation:focus:)
Workspace->>commitHelper: commitNewTerminalSplitPane(...)
commitHelper->>bonsplit: splitPane(sourcePaneId:orientation:withTab:)
bonsplit-->>commitHelper: newPaneId
commitHelper->>lifecycle: beginTerminalSplitPaneLifecycle(...)
lifecycle->>lifecycle: publishCmuxSplitCreated
lifecycle->>followUp: beginEventDrivenLayoutFollowUp(includeGeometry: true)
followUp->>followUp: scheduleLayoutFollowUpAttempt() [asyncAfter(0)]
commitHelper-->>Workspace: newPaneId
Workspace->>Workspace: suppressReparentFocusUntilLayoutFollowUp / focusPanel
Note over followUp: Layout follow-up runs after sync code completes
Note over Caller,followUp: UI-split path (BonsplitDelegate.didSplit)
bonsplit->>Workspace: didSplit(originalPane:newPane:orientation:)
Workspace->>Workspace: bonsplitController.createTab(inPane: newPane)
Workspace->>lifecycle: beginTerminalSplitPaneLifecycle(origin:"ui_split")
lifecycle->>followUp: beginEventDrivenLayoutFollowUp(includeGeometry: true)
Workspace->>Workspace: DispatchQueue.main.async [selectTab, focusReconcile]
Note over Caller,followUp: Placeholder repair path (drag-to-split)
bonsplit->>Workspace: didSplit — !hasRealSurface
Workspace->>Workspace: reuse placeholder tab → TerminalPanel
Workspace->>Workspace: beginTerminalSplitSurfaceLifecycle(origin:"placeholder_repair")
Workspace->>followUp: beginEventDrivenLayoutFollowUp(includeGeometry: true)
Reviews (10): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 34c0932. Configure here.
…-3386-split-window-blank

Closes #3386
Summary
Workspaceso every new terminal split publishes the split event and immediately schedules the event-driven layout follow-up with geometry and focus.surface.split_offfrom emptying a source pane by preserving the single-tab guard and returninginvalid_statefor that API case.surface.split_offsource-pane invariant.Testing
cmuxTests/TerminalControllerSurfaceSplitOffTests.swift.tests/test_split_flash_and_layout.pyandtests_v2/test_split_flash_and_layout.py, usingtests/split_render_helpers.pyto verify the newly created split panel visibly renders deterministic terminal output.Notes
mainbefore the final CI pass so required checks evaluate the up-to-date integration state.Note
Medium Risk
Touches terminal split/placeholder-repair lifecycle and layout follow-up scheduling, which can impact focus and geometry timing during splits; regressions would show up as blank/incorrectly sized panes.
Overview
Centralizes terminal split creation/repair through new
Workspacehelpers (beginTerminalSplitPaneLifecycle,beginTerminalSplitSurfaceLifecycle,commitNewTerminalSplitPane) so every new terminal pane/surface consistently publishes cmux events and immediately triggers event-driven layout follow-up with geometry (and optional focus).Updates placeholder-repair and UI/programmatic split paths to use the shared lifecycle and ensures layout follow-up runs after creating replacement terminals (reducing split “blank/flash” states).
Adds regression coverage: a Swift unit test ensuring
surface.split_offrejects splitting the only tab in a pane (invalid_state), plus shared Python helpers and enhanced v1/v2 split layout tests that assert newly split terminals actually render output.Reviewed by Cursor Bugbot for commit bf2fb95. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
Tests
surface.split_offAPI validation on terminal panes.Refactor