Fix terminal portal tab drop routing
Merged
LA
6mo ago+1204+1204+0123456789012345678901234567890123456789-430-430-012345678901234567890123456789
Summary
- Route Bonsplit tab drops over portal-hosted terminal panes through pane-local drop targets.
- Keep Bonsplit tab-strip drag and reorder events passing through terminal/browser portal overlays.
- Keep the Bonsplit tab drag E2E using XCTest native drag gestures on CI.
Tests
- Local:
xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux-unit -configuration Debug -destination "platform=macOS" -derivedDataPath /tmp/cmux-dropfix-unit -only-testing:cmuxTests/WindowTerminalHostViewTests/testHostViewPassesThroughUnderlyingTabStripDuringMouseDrag -only-testing:cmuxTests/WindowTerminalHostViewTests/testTabStripPassThroughTreatsAppKitDragRoutingAsPointerEvents -only-testing:cmuxTests/WindowTerminalHostViewTests/testTerminalPaneDropTargetDefersToUnderlyingTabStrip test - Local:
xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux -configuration Debug -destination "platform=macOS" -derivedDataPath /tmp/cmux-dropfix-ui-build -only-testing:cmuxUITests/BonsplitTabDragUITests/testMinimalModeKeepsTabReorderWorking build-for-testing - CI: https://github.com/manaflow-ai/cmux/actions/runs/25104895502
- CI artifact issue: https://github.com/manaflow-ai/cmux-dev-artifacts/issues/1126
Dogfood
- Tagged build:
dropfix5
Summary by cubic
Fixes Bonsplit tab drop routing over portal-hosted terminal panes by adding a pane-local drop target and unifying minimal tab-strip pass-through across terminal and browser portals. Switches the Bonsplit tab drag E2E to XCTest native drag for CI stability.
-
Bug Fixes
- Added
TerminalPaneDropTargetViewto capture internal tab drags, render zones, and delegate moves/splits viaWorkspace.performPortalPaneDrop. - Terminal and browser portals (and drop targets) defer to the minimal tab strip; AppKit drag‑routing events count as pointer input; terminal host returns the drop overlay when hit.
- External drags (
.fileURL/.URL/.png/.tiff/.html) bypass portal overlays;WKWebViewkeeps these types registered and receives the full drag lifecycle. - Normalized edge‑adjacent drops and same‑pane center no‑ops; E2E uses XCTest drag gestures instead of raw CGEvents.
- Added
-
Refactors
- Extracted pass‑through helpers to
BonsplitTabBarPassThrough; moved terminal helpers toGhosttyTerminalViewSupport; split portal debug utils toTerminalWindowPortalDebug. - Centralized pane‑drop logic in
WorkspacePortalPaneDropand exposedWorkspace.handleExternalTabDrop;GhosttyTerminalViewnow hosts the drop‑target overlay and wires its context. - Split drag‑routing tests into
PortalTabDragRoutingTests,BrowserPaneDropRoutingTests, andCmuxWebViewDragRoutingTests.
- Extracted pass‑through helpers to
Summary by CodeRabbit
Release Notes
-
Bug Fixes
- Improved pointer event routing and drag-and-drop handling between terminal panes and browser windows.
- Enhanced tab bar interaction detection to more accurately identify when drag operations should target the tab bar.
-
Refactor
- Reorganized pass-through decision logic for improved maintainability and consistency.
-
Tests
- Added comprehensive test coverage for drag-and-drop routing behavior and event sequencing.
- Expanded external pasteboard handling tests for browser drag operations.