cmux NEXT: clear rejected tab-drop phantoms

Merged
AU
3d ago
+249-8

Summary

A tab drop creates an optimistic insertion gap before its move is accepted. If the source tab or destination disappears, the move can fail before a pane callback runs, leaving that gap behind. The destination now returns a completion owned by the committed drop; the session calls it on every terminal result. A failed move clears its own preview and order/group overrides while preserving newer hover and commit state.

Part of #22287. This addresses failed-drop cleanup; it does not claim the entire parity tracker is complete.

Testing

Seven TabDropRollbackTests cover the real session's missing-source failure, pane resync during hover, successful arrival, an overlapping hover, a newer commit, same-strip order/group restoration, and a whole-group drop. The two integration regressions were committed before the repair and run unchanged on both versions.

Current head: ea7d6bf78c25b3308fc1a0c05558a3b6f2c10552. Native validation is on c7623792dd5269b7302c335a7c1f4eed1fda8797; the sole later change adds the validated release-note documentation link, with identical Swift sources and tests. Rebased without code conflicts onto 99ce141c88e.

  • Static checks passed: full pre-push gate, Swift syntax, localization defaults, package groups, feature flags, and git diff --check. The Git batch reader was given file-backed input to avoid the documented local pipe deadlock; no checker was changed or disabled.
  • Audit red job: 334c57eb3972d1b45665d09d at 4db95dbadb0 (queued).
  • Current-head regression/parity job: 9128cf21cde156aca8629ccd (queued). Command: scripts/ci/package-test-lane.sh suite Packages/macOS/CmuxNext TabDropRollbackTests,BonsplitDropParityTests,TabDropPointerSlotTests,PaneSwapDragTests.
  • Nightly-train Release compilation: d69eefe1c1d18ac9793e975a (arm64), f933662c05c50b7544a26bb1 (x86_64), both queued. These run scripts/cmux-next/check-release-compile.sh, the workflow's Release compile script.
  • Native tagged app build: 9852d564e8b75a8b2a080b7a, tag issue-22287-tab-drop-rollback (queued).

Observed / Not run

Independent correctness review passed the final diff, including the whole-group test. Native tests and builds of these exact Swift sources and tests have not finished; readiness is pending those results. The prior narrow test passed on the previous implementation but is not claimed as evidence for this repair. No local app build or live pointer dogfood was run.

The PR’s release-note validation error was fixed by adding its required documentation link; its entry now passes the same validator. Eleven unchanged baseline highlights still fail that repository-wide test. The selector-table CI failure is unrelated: OmnibarFieldEditor.swift, DividerHandleView.swift, the checker, and its table are unchanged from base 99ce141c88e. The same two failures reproduce locally. Localization audit found no changed UI strings; the repository-wide catalog validator remains red on unchanged translation debt.

Changelog

Fixed: Failed tab moves clear their insertion preview without disturbing a newer drag.

Proof

No capture: this change handles rejected asynchronous drops. The tests exercise the real session completion and AppKit strip state, including overlapping gestures.