Skip to content

Keep the main window floor on the animating setFrame path - #15368

Merged
teamleaderleo merged 2 commits into
mainfrom
fix/pane-min-size
Sep 28, 2026
Merged

teamleaderleo merged 2 commits into
mainfrom
fix/pane-min-size

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Split down, split up, then resize the window to 800x200: one of the three stacked panes ended at 0x0 (#15347).

The main window has a 400 pt minimum height, and CmuxMainWindow enforces it by overriding setFrame(_:display:). setFrame(_:display:animate:) is a separate entry point that does not route through that override, so display placement, UI-test placement and the debug resize verb could size the window below the floor. The workspace content cannot shrink past its own 400 pt minimum, so it overflowed the window: the pane area stayed 372 pt tall inside a 200 pt window, and the bottom pane was laid out entirely below the window edge, where the terminal portal collapses it to 0x0.

The fix is to apply the same size policy (cap to the display union, raise to the floor, leave full screen alone) on the animating path too. The window now stops at 800x400, the pane area fits, and each of the three panes keeps a real height.

Pane-level clamping was the other option. bonsplit already keeps both children of every split nonzero within its container; the zero came from the container being taller than the window, so no pane minimum could fix it. Keeping the window at or above its content minimum removes the whole class of overflow, not just this split shape.

Testing

  • Added MainWindowSelfSizingTests.testAnimatingSetFrameRaisesUndersizedFrameToMinimumContentSize: an 800x200 setFrame(_:display:animate:) must keep the width, raise the height to the floor and keep the top edge.
  • Added the fuzzer's repro as dogfood/fuzz/regressions/issue-15347-stacked-panes-short-window.json, so scripts/fuzz regressions --app ... replays it.
  • Replayed the repro on a build mini: main reproduces pane-view-degenerate at step 3; this branch passes (frames below).
  • CI ran cmuxTests/MainWindowSelfSizingTests (with AppDelegateFullScreenFrameRestoreTests and MainWindowZoomPlacementTests) in the app-host changed-suites job on this head: passed. The one red guard test, test_ci_owned_spm_scratch, comes from ci: bound the SwiftPM scratch holder and cache scratch sizes #15366 on main and is unrelated to this change.
  • Five stacked splits leave panes shorter than their tab bar even at full size, before any resize. That is a separate split-sizing problem, filed as [fuzz] Repeated splits shrink a pane below its tab bar, leaving a 0 pt terminal #15371.

Changelog

Fixed: Resizing the main window from a script or a display change can no longer shrink it below its minimum height and leave a split pane with no size

Demo Video

The fuzzer repro (split down, split up, resize to 800x200) replayed on a build Mac against a DEV build of main and one of this branch, with a frame after each step.

Main, after the resize: the window is 200 pt tall, the pane area still lays out at its 400 pt minimum and overflows, and the third pane is off the bottom edge at 0x0 (the replay reports pane-view-degenerate).

main after resize

This branch, after the same resize: the window stops at 800x400 and all three panes keep a real height (the replay passes).

fix after resize

Before the resize, for reference (this branch):

fix before resize

🤖 Generated with Claude Code

setFrame(_:display:animate:) does not route through setFrame(_:display:),
so it could size the main window below the 400 pt layout floor. The
content could not shrink with it, overflowed the window, and a split pane
laid out past the bottom edge ended at 0x0.

Fixes #15347

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 42 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 2acfbbfa-45f4-49d7-8633-367aa6b2f930

📥 Commits

Reviewing files that changed from the base of the PR and between 1a7467a and 781dd46.

📒 Files selected for processing (3)
  • Sources/App/CmuxMainWindow.swift
  • cmuxTests/MainWindowSelfSizingTests.swift
  • dogfood/fuzz/regressions/issue-15347-stacked-panes-short-window.json

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Dogfood build of 781dd46555119425e41cdd561f303d615ec29d7a

cmux DEV pr-15368-781dd465.app

The link opens this exact commit in the cmux dev menu bar app. The build starts on each push and the page waits until it is ready; a newer push replaces it. It signs in against production, so Cloud or backend changes still need a tagged build with a development backend.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

CI failure attribution

CI passes on 781dd46555 (run 36426636081 attempt 3).

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's.

@blacksmith-sh

This comment has been minimized.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@teamleaderleo
teamleaderleo merged commit 20ef7c9 into main Sep 28, 2026
139 of 153 checks passed
@teamleaderleo
teamleaderleo deleted the fix/pane-min-size branch September 28, 2026 14:24
@github-actions

Copy link
Copy Markdown
Contributor

Merge receipt for 781dd46555: every check was green at merge (16 verified; 16 skipped by policy). Full suite runs on main after merge.

rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 28, 2026
1028a08 test: isolate background workspace git probe fixture (manaflow-ai#15388)
41ad40d fix: keep the terminal area when the window is too narrow for the side panels (manaflow-ai#15369)
2890f0b Roll the Base create back when the owner network resolve fails (manaflow-ai#15358)
7b0a15f Keep agent- and script-opened workspaces and panes in the background (manaflow-ai#15281)
4f14fa3 ci: move CLI regressions to CLI product tests and rebalance the seven app-host shards (manaflow-ai#15177)
906926a ci: dogfood builds are opt-in with the dev-build label (manaflow-ai#15380)
2f6716c PR media: classify app changes by CI's build inputs; a reuse error is no refusal (manaflow-ai#15386)
bc28bc4 Release the Base generation when a create is refused for credits (manaflow-ai#15343)
6760c93 iOS: Add Computer never disturbs the active Mac (manaflow-ai#15102)
0f2d3d3 Show Claude sessions that stop on an API error instead of leaving them Running (manaflow-ai#15232)
20ef7c9 Keep the main window floor on the animating setFrame path (manaflow-ai#15368)
b4f5dc5 ci: move UI runs pinned to Blacksmith macOS 26 onto owned Macs (manaflow-ai#15383)
e02c385 PR media: compile once when CI's build cannot load, and say why a tour skipped (manaflow-ai#15378)
ebd1f4f fix(iroh-v2): commit delivery accounting only after the frame is sent (manaflow-ai#15344)

# Conflicts:
#	.github/workflows/ci-guards.yml
#	.github/workflows/ci-macos.yml
#	.github/workflows/ci.yml
#	.github/workflows/pr-media.yml
#	.github/workflows/test-e2e.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant