Skip to content

cmux-next: resolve rapid bottom placement from current sidebar rows - #26947

Closed
teamleaderleo wants to merge 3 commits into
feat-cmux-nextfrom
lane/nx-sidebar-rapid-placement-1028
Closed

teamleaderleo wants to merge 3 commits into
feat-cmux-nextfrom
lane/nx-sidebar-rapid-placement-1028

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

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 ab1b863 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, and python3 scripts/verify-local.py --swift-changed origin/feat-cmux-next pass (four selected checks, including Swift syntax). Native compilation and tests are separate.
  • Red-before fleet job b4ab52a6c07eba48b1328ab0 targets a0ff494dca01ef4a9c95592824504e9e55479d22, 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 Autofix with [code]smith
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 PlacementStaleRowsTests covers partial and empty rendered rows with both legacy and mixed personal order.

Written for commit 4e296e7. Summary will update on new commits.

View guided diff Turn on auto-fix

teamleaderleo and others added 2 commits October 28, 2026 13:36
…sidebar rows

No fix: the test fails on today's code. For the sidebar placement owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-cc8bff1c3ddb4ec353c5
Refresh through the existing sidebar rows writer before resolving a pending slot so bottom includes store rows the observation has not drawn. Keep pending edits and the empty-drawn-row regression.

Validation: git diff --check, prepush-gate.py and verify-local.py passed. Fleet red-before job b4ab52a6c07eba48b1328ab0 queued; native green-after pending.

Sidebar-Look: no visual change
Agent-Session: https://cmux.com/deeplink/agent?id=aid-44bbb863b6011d354138
Independent review found resync uses the legacy pin projection. Run the registered rows observation instead, preserving current layout, decorations and pending edits without rendering before placement.

Sidebar-Look: no visual change
Agent-Session: https://cmux.com/deeplink/agent?id=aid-44bbb863b6011d354138
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (independent Astra high): SHIP at 4e296e7.

Reviewed full diff from base 3a7653b. The first implementation's legacy-pins projection defect is fixed by running the registered rows observation through SidebarSameTurn.syncRows() before calculating placement. Pending edits and normal document/window/profile projection remain on the production path. Both stale-row cases, including bottomWhenTheDrawnRowsListNoLooseRow, remain covered in both order modes. Primary static inspection agrees; git diff --check, prepush gate and four verify-local checks pass.

This is static review only. Native red-before job b4ab52a6c07eba48b1328ab0 is running at a0ff494. Superseded after-fix job 4855a30630edefc68de8b1bc was cancelled; no result is carried to the repaired head. Native execution, performance measurements, and WindowManager command/document dispatch remain verification gaps.

HOLD: the overlap helper found existing #26153 implementing the same fix with request-order batching and additional burst/gallery guards. nx-sidebar has been asked to reconcile the canonical owner before another native dispatch or landing. Neither PR should be treated as ready from this comment.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-ih6z3l created for this PR by the cmux coordinator.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Superseded by canonical #26153, now updated at 36748d9 and independently reviewed by Astra high (static SHIP). The canonical repair preserves stable drop gaps and serializes placement writes against confirmed store order. Native red/green verification remains pending there. Closing this duplicate without landing; #26153 remains owned by nx-sidebar for the final verification and guarded merge loop.

Agent session: agent session

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 4e296e7: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr26947 -f ref=lane/nx-sidebar-rapid-placement-1028 -f platform=macos -f backend_mode=local

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 4e296e7a Deployed Oct 28, 2026 by teamleaderleo via cmux-tui tree preflight #72768
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant