cmux-next: resolve rapid bottom placement from current sidebar rows
Rapid creates at the bottom could resolve against sidebar rows from an earlier observation pass. With rendered rows [k1] and store order [k3, k1, k2], the new k3 could land before k2; an empty rendered list could resolve bottom to index zero.
Requested behavior: “.bottom resolves against store order when rendered sidebar rows lag”; keep the empty-rendered-row case2 guard.
applyPendingPlacements now refreshes through the existing sidebar rows writer before resolving the slot. That writer retains pending local edits and uses the existing placement/drag path. The deterministic regression from ab1b86379264de2bfde94a1945ddd6ed8ce7fd56 remains a separate first commit and covers partial and empty rendered rows with legacy and mixed personal order.
Validation at 820bdfc4076db3c0dfcf980bfea9521fe683c94c:
git diff --check,python3 scripts/cmux-next/prepush-gate.py, andpython3 scripts/verify-local.py --swift-changed origin/feat-cmux-nextpass (four selected checks, including Swift syntax). Native compilation and tests are separate.- Red-before fleet job
b4ab52a6c07eba48b1328ab0targetsa0ff494dca01ef4a9c95592824504e9e55479d22,PlacementStaleRowsTests; pending, no native verdict yet. - Green-after fleet request targets the exact final head with
PlacementStaleRowsTests,ModelMatrixPersonalOrderTests,NewWorkspaceInGroupTests; receipt will follow. - Independent Astra high correctness review requested on this exact head. No landing before review and exact-head check/base-red reconciliation.
Base: 3a7653b054ed0407e8fb0b62ad7e79b5229643c8. Owner: nx-sidebar rapid-placement worker. Sidebar-Look: no visual change. No live-app capture or performance result is claimed.
Agent session: agent session
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes rapid bottom placement so workspaces created in quick succession land in creation order even when the sidebar's rendered rows lag behind the store.
Previously, pending placements resolved their bottom slot against the last drawn sidebar rows. Under load those rows could miss workspaces created since, so a new workspace could land before one already in the store, or at index 0 when no loose row was drawn. applyPendingPlacements now refreshes rows through the registered observation pass — the canonical projection — before resolving the slot, preserving layout, decorations, pending edits, and the empty-drawn-row guard without rendering first.
Tests
- New
PlacementStaleRowsTestscovers partial and empty rendered rows with both legacy and mixed personal order.