cmux NEXT browser: files dragged in from Finder drop into the Chromium page

Merged
AU
15d ago
+169-0

Summary

Dragging a PDF or any other file from Finder onto a Chromium browser tab in cmux NEXT showed the tab drop zones and never reached the page, so uploads failed.

Cause: the CEF fork's page window ignores the mouse once the pointer leaves it (routeMouseAt: in chrome_child_window_mac.mm) and does not change that while a button is down. A drag that starts in another app therefore always lands in cmux's main window. Since d8b16b922c9e8, LayoutRootView takes every URL drag (file URLs included) as a link drop, so it showed the drop zones and opened the file as a background tab. Before that change, nothing took the drop at all.

Fix: the pane's CEFHostView, which sits under the page window, registers for file drags and replays them to the shown tab with DevTools Input.dispatchDragEvent (CEFFileDragRelay): dragEnter, coalesced dragOver, then drop, or a dragOver off the page plus dragCancel when the drag leaves. Chromium's handler runs FilterDropData, which grants the page the dropped paths, so <input type=file> drop zones and upload sites get the real File objects. Because the host view is deeper than the layout root, file drags over a browser page no longer show the split zones, which matches Chrome. WebKit tabs and terminals are unchanged: their own views already take file drags.

Changelog

Fixed: Files dragged from Finder onto a Chromium browser tab now drop into the page (uploads work) instead of showing the tab drop zones.

Observed / Not run

  • Observed (head 06fa4897162be093548ee05db66997de047c6e18, fleet job 22fcd2371977dfca42adb04a, tag 23790-browser-file-drop-fix-v2): in the tagged app, a person dragged a PDF from Finder onto an HTML drop zone in a Chromium tab, and the page received the file (confirmed by the person). The base had shown the tab drop-zone highlight and no upload (user report).
  • Observed: scripts/cmux-next/prepush-gate.py reported no new violations; the fleet build compiled the head. Subagent review of fa49cb7 returned FIX; findings resolved in 06fa489 (comment above). Re-review of 06fa489: PASS.
  • Not run: an automated behavior test (a real cross-app drag into the fork's page window needs a GUI host with real input; none was reachable from this laptop, and the leased GUI Mac was not on its tailnet). Not separately checked: drag-off-page without dropping (synthetic dragleave) and drops at page zoom other than 100%.

🤖 Generated with Claude Code