cmux NEXT multi-view: a drop on a workspace shown beside goes to that workspace (Debug toggle)

Merged
TE
16d ago
+247-35

Summary

With the Debug toggle sidebar.multiView on, a window can show workspaces side by side (#23651). Until now, every drop target only looked at the focused workspace. A drop on a workspace shown beside it was pulled onto the focused workspace's layout, or did nothing. Now the drop goes to the workspace under the pointer:

  • A sidebar row dropped on a pane edge of a workspace beside goes on that side of that workspace. The focused workspace keeps the focus.
  • A sidebar row over one of its panes previews a merge into that pane.
  • A tab over one of its panes or tab strips targets that pane. Releasing the tab focuses that workspace first, the way a press does. With Option, which files the tab away, the focus stays where it was and the tab still lands there.

How it works: WindowController.content(atScreen:) picks the workspace on screen under a point. LayoutTabDropTarget, the drag's strip targets, WorkspaceMerge.hit, placeBeside and the commit's strip, column and dock lookups all use it, or onScreenContents. With the toggle off, only the focused workspace is on screen, so every lookup behaves as before.

The test helpers that turn the toggle on now put back the value they found. Before, a test in one multi-view suite could reset the toggle while a test in the other was waiting on an await.

Testing

Five new tests are in SidebarMultiViewDropTests.swift, an extension of the serialized SidebarMultiViewWindowTests. The suite needs a display, so both runs are pinned to aws-m4pro-9, as #23651's were.

Red, on the test commit:

cmux-ci run --class light --script scripts/ci/package-test-lane.sh --ref d28a98044089f3e43a151cc9dee956971e7d3a8e --key mv1-before-d28a98044089 --target-worker aws-m4pro-9 --arg=suite --arg=Packages/macOS/CmuxNext --arg=SidebarMultiViewWindowTests --env CMUX_CI_XCODE_APP=/Applications/Xcode_26.6.app

Step cc0d866f2bbc1eab584be831 on aws-m4pro-9 failed. All five new tests fail: the outcome is .cancel, the focus stays on k0, and paneController(stripID:) finds no pane in the workspace beside. The suite's eight existing tests pass.

Green, at the head, with the neighbor suites:

cmux-ci run --class light --script scripts/ci/package-test-lane.sh --ref 08cc004c538e09c62aa803b7fcc5b4ebe42653db --key mv1-after-08cc004c538e --target-worker aws-m4pro-9 --arg=suite --arg=Packages/macOS/CmuxNext --arg=SidebarMultiViewWindowTests,SidebarMultiViewPressTests,DragGlassTests,WindowCloseNeighborTests --env CMUX_CI_XCODE_APP=/Applications/Xcode_26.6.app

Step 2cb052def9034063f5c84904 on aws-m4pro-9 passed: SidebarMultiViewWindowTests (13 tests), SidebarMultiViewPressTests (6), DragGlassTests (6) and WindowCloseNeighborTests (9).

Compile checks at the head:

  • cmux-ci compile-check --app passed (job 5424a170110d7ccce0564590).
  • The merge-compile-guard fleet-compile-check.yml run 39699938872 passed on attempt 2. Attempt 1 failed in runner setup: python3 is missing on the runner. That is infrastructure, not this change.

Observed / Not run

Observed:

  • The fleet runs above.
  • prepush-gate.py: no new violations.
  • check-no-godfiles.sh: the Swift part of the output matches the base's exactly, so TabDragSession is still at 1014 lines. On this loaded Mac the Rust tail of the check timed out. This change touches no Rust.

Not run:

  • A dogfood pass in a tagged build. The feature is behind an off-by-default Debug toggle.
  • A real tab move landing. The fixture's daemon is fake, so the tab tests check where the drop resolves and which workspace is focused, not the move itself.

Remaining limits:

  • A link drag still targets only the focused workspace.
  • A sidebar tab drop on a row shown beside takes the workspace but not its slot index.
  • A point over the title bar above a workspace beside resolves to the focused workspace. The preview and the drop still agree.
  • If a drop into a workspace beside is refused, that workspace stays focused, the same as after a press there.
  • A pane too narrow to split, such as one of two panes in a half-width workspace, takes a row on its edge as a merge, not a beside. This is the layout's room rule for splits.

Changelog

none

Proof

No capture: behind the off-by-default sidebar.multiView Debug toggle.

Agent session: cosmic-gray

🤖 Generated with Claude Code