cmux-next: a new workspace draws at its place from the first frame; add Before Current Workspace
This adds Before Current Workspace (workspaces.newPlacement = "beforeCurrent") alongside Top, After Current Workspace, and Bottom. The app captures the current workspace before asynchronous creation and sends that placement to capable daemons, to align the preview with persisted order. Final-order assertions are strict; four per-frame assertions still document known intermittent row jumps.
Top and Bottom retain the current group's first/last-slot behavior. Before/After Current fall back to the machine section's top when the selected workspace is Home, pinned, absent, or on another machine. Explicit Above/Below placements keep their existing fallback. Failed creates release their placement ledger entries, including agent entrypoints. Before Current also preserves group slots when dense saved positions must be renumbered. Placement calculations and transient ledger state live in the Bridge domain; window/machine wiring stays in the app.
The base's ordered pending-placement queue, cold-sidebar anchor deferral, shared document refresh, indefinite late-terminal-start handling, first-tab chat behavior, and remote-close baseline are preserved.
Size: First-frame placement requires a coordinated app, daemon, protocol-binding, localization, and regression-test change; splitting it would leave those placement rules inconsistent.
Takes back #26153: replaces its inline failed-create pending-placement cleanup in WorkspaceSpawn.swift with the shared NewWorkspacePlacements.forget helper. The helper still removes the pending entry and registration order, and also releases the placement ledger. The ordered queue and shared placement sequencing remain intact.
Validation
- Rust regressions reproduced the group-start, pinned-current and Before Current group-order defects before their repairs. The new dense-position regression also fails against the old implementation and passes after reading both bounds after row moves.
- On rbx at
37869556602714dd37a5d7a9f7cc9d7f1cdd667b, formatting, 45 focused placement tests, and clippy forcmux-tui-core --all-targets -D warningspassed. - Swift red-before: fleet
162aa7637e51a34472460b3breproduced missing-current fallback and failed-first-tab cleanup;e33acb70687a488d0de6252dreproduced trailing-group corruption and two registration leaks at their expected assertions. - Fleet settings export step
4fe8b5d563f4954b500aadbacompiled all native test targets and passed four managed-preference plus six settings-schema tests on2881639c1d62eda40d8226bee48af3a701725f14. Its generated patch restores the base's sidebar text-size entry and theme copy. - Swift fleet
ba3e178df2439353c90dc633passed all 11 requested suites (46 executed tests) atc86bcabdb57ccdf57b83dedd4d6b04c37b6ac709. Exact-head fleet step556201a3433cf1233b755242also passed all 11 suites ataaf91a901c9411ada04d13b63bcc16f38700d647(exit 0). - Head
42aaf9034c2c39e9772ae5a523003539cb514f21merges base5aee3770f46ec7534f81fac338bd549aa3b261b5and applies the fleet-generated schema. Export stepcb6ee59849c1ca5095e4568dcompiled all native test targets and passed all four managed-preference and six settings-export tests at its parent37869556602714dd37a5d7a9f7cc9d7f1cdd667b. The generated delta is one localization key; it does not change the settings reference text. - Exact-head fleet step
fe842e7101806ae9e74da2b6passed all 11 focused Swift suites (46 tests, exit 0) at42aaf9034c2c39e9772ae5a523003539cb514f21; summary artifactsha256:1a5547860c1e4f7aa2f5a79a4c6695b139aaaaf92da201f2707e9e5569b33198. - SDK generation, scoped Swift syntax, diff whitespace and the current-head pre-push static gate pass. Fresh independent exact-head review: SHIP. Automatic exact-head fleet app compile
af95a3fe1965909c4c0b04d8completed successfully. The fleet Release compile check and defaults guard rerun also passed.
Focused Swift command (on the fleet):
cmux-ci run --class light --script scripts/ci/package-test-lane.sh --ref SHA --arg=suite --arg=Packages/macOS/CmuxNext --arg=SidebarDocNewWorkspaceTopTests,CmdNRowSlotSuites,NewWorkspacePositionTests,RapidWorkspaceCreateTests,AgentTeamsLaunchTests,NewWorkspaceGroupIndexTests,NewWorkspaceInSectionTests,ColdCmdNRowSlotTests,ColdCmdNWindowRowsTests,CmdNSlowDaemonKeepsWorkspaceTests,CreateTerminalLateStartTests --env CMUX_CI_XCODE_APP=/Applications/Xcode_26.6.app
Focused Rust command (on rbx):
cargo nextest run --locked -p cmux-tui-core -p cmux-tui-util -E 'test(sidebar_doc_order) | test(personal_order) | test(mixed_order) | test(workspace_create_current) | test(placement)'
Observed / Not run
Observed: red-before regressions; Rust placement tests and clippy at 37869556602714dd37a5d7a9f7cc9d7f1cdd667b; all 11 scoped Swift suites (46 tests) at current head 42aaf9034c2c39e9772ae5a523003539cb514f21; fleet compilation of test targets and passing settings exporters at 378; SDK/syntax/static checks; earlier independent SHIP and visual reviews. The current head adds only the generated localization-key repair after the 378 base merge.
Not run: OS 14/15 interaction checks and controlled placement-latency measurements. Freestyle web validation is unavailable because this Mac lacks its runner configuration; no heavy web checks were run locally for this repair.
Native capture at aaf91a901c9411ada04d13b63bcc16f38700d647, fleet build 4fc178e1d193307352013c50: all eight fixture steps passed. Independent visual review passed light and dark; the stills show Before Two immediately before selected Two. The capture mini's text scan and the trusted main-branch privacy check approved both images before upload. These stills predate the latest base merge and schema-only repair; they do not establish latency or a before/after comparison. No new runtime change followed that base merge, so no recapture was requested for the schema-key repair.
| Light | Dark |
|---|---|
![]() | ![]() |
Inherited failures: base-red evidence covers Chief eval_upsell and the Rust panic-ratchet debt outside this PR. Release-notary fails the same two RunsOnFallbackTests as base run; this PR changes neither workflows nor the routing tests. Only PR-caused failures are repaired here.
Performance
No perf numbers: the frame-order sampling and behavioral regressions establish placement correctness, not an input-to-frame latency distribution. No performance improvement is claimed.
Changelog
Added: Before Current Workspace as a new workspace position, with consistent initial sidebar placement and failure cleanup.

