fix: Cmd+Y crash โ Base pop-up overflowed the New Machine sheet
Summary
Cmd+Y (New Cloud Machine) crashes nightly 0.64.25-nightly.3731595686301 (853ecd1). The crash report shows abort() from an AppKit exception, raised during the sheet-open animation that beginSheetModal starts for the New Machine sheet. The exception comes from -[NSWindow _postWindowNeedsUpdateConstraints], which AppKit raises when a window keeps asking for another Update Constraints pass.
Cause: #17330 added a Base pop-up pinned with .fixedSize(). A pop-up's ideal width is its widest row, here the longest machine name, so long names push the grid wider than the sheet's fixed width. 5e7aacdb2a2 fixed the same overflow for the Size pop-up with .fixedSize(horizontal: false, vertical: true). This PR gives the Base pop-up that treatment: it narrows to the space it has and AppKit truncates the title.
Regression guard
cmuxTests/NewMachineSheetLayoutTests hosts the sheet for every layout, with the default base and with a fork selected, using long machine names. It asserts that every AppKit control stays inside the sheet's bounds. It also requires that the Base pop-up was actually rendered, so the test can't pass without checking anything. It covers every control in the sheet, not just this pop-up, so a future .fixedSize() pop-up that overflows fails it too.
Verification
- Red at 8e3c729 (test only) and green at eacdd05 (fix) with
./scripts/run-e2e.sh cmuxTests/NewMachineSheetLayoutTests. Run links follow in a comment. - I couldn't symbolicate the crash because the nightly ships no dSYM. The cmux frames are the async new-machine presenter calling
beginSheet. #17330 is the only change to this sheet between the last good nightly and 853ecd1.
Changelog
Fixed: Cmd+Y (New Cloud Machine) no longer crashes when a machine has a long name.
๐ค Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Fixes Cmd+Y crashing when a machine has a long name. The Base pop-up from #17330 was pinned to its ideal width, its longest machine name, which overflowed the fixed-width New Machine sheet and sent AppKit into an Update Constraints loop during the sheet-open animation. It now narrows to the sheet like the existing Size pop-up and truncates the selected title instead.
applySourceMachines skips reassigning the machine list when the picker rows are unchanged, so a cache refresh landing mid-animation no longer rebuilds the Base pop-up while the sheet opens.
Adds NewMachineSheetLayoutTests, which hosts the sheet in every layout with long machine names and asserts every control stays inside the sheet, plus a test that an unchanged machine list doesn't invalidate the model.