Repository navigation
fix(macos): drag the window from split-view pane headers - #104048
Conversation
In the macOS app, split-screen pane header rows (session title strip) now start a native window drag instead of selecting the title text. The Control UI posts an openclawWindowDrag script message on mousedown over passive header chrome; the dashboard window validates the trusted main-frame source and the in-flight left-mouse press before calling NSWindow.performDrag. Pane headers are chrome, so they are also no longer text-selectable.
|
Codex review: needs real behavior proof before merge. Reviewed July 10, 2026, 10:04 PM ET / July 11, 2026, 02:04 UTC. Summary PR surface: Source +57, Tests +92, Other +56. Total +205 across 7 files. Reproducibility: yes. at source level: current main has only fixed-geometry native drag overlays, while the web-rendered split-pane header has no native drag path and remains selectable. There is no actual-app before/after reproduction artifact. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the guarded per-pane bridge, restrict the native handoff to the captured original Do we have a high-confidence way to reproduce the issue? Yes at source level: current main has only fixed-geometry native drag overlays, while the web-rendered split-pane header has no native drag path and remains selectable. There is no actual-app before/after reproduction artifact. Is this the best way to solve the issue? No, not yet: the web-to-native ownership boundary is appropriate, but the native call must receive the original mouse-down event required by AppKit and the integrated behavior still needs actual-app proof. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f50293c9e73b. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +57, Tests +92, Other +56. Total +205 across 7 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
…ntroller SwiftLint type_body_length: the drag-message handler pushed DashboardWindowController past 800 lines; the failure-page HTML is presentation-only and now lives in DashboardFailurePage.
…4048) * fix(macos): drag the window from split-view pane headers In the macOS app, split-screen pane header rows (session title strip) now start a native window drag instead of selecting the title text. The Control UI posts an openclawWindowDrag script message on mousedown over passive header chrome; the dashboard window validates the trusted main-frame source and the in-flight left-mouse press before calling NSWindow.performDrag. Pane headers are chrome, so they are also no longer text-selectable. * refactor(macos): move the dashboard failure page out of the window controller SwiftLint type_body_length: the drag-message handler pushed DashboardWindowController past 800 lines; the failure-page HTML is presentation-only and now lives in DashboardFailurePage.
What Problem This Solves
Fixes an issue where users of the macOS app in split-screen chat would try to drag the window by a pane's top header row (the strip showing the session title) and instead start a text selection of the title. The pane header sits at the very top of the window where a titlebar is expected, but WKWebView swallows the mouse gesture: the window never moves and a meaningless title selection appears instead.
Why This Change Was Made
WKWebView honors neither
isMovableByWindowBackgroundnor Electron-styleapp-region: drag, and the existing native drag-region strips in the dashboard window are fixed-geometry overlays that cannot follow per-pane split layout or avoid each pane's header buttons. The fix mirrors the existingopenclawLinkbridge: the Control UI posts anopenclawWindowDragscript message on mousedown over passive pane-header chrome, and the dashboard window validates the source (main frame, trusted control path, typed body) plus the in-flight gesture (NSApp.currentEventmust be a left-mouse press in this window) before handing the event toNSWindow.performDrag(with:). The header row is also markeduser-select: nonesince it is chrome, not content. Browsers and other hosts see no behavior change: without the native handler, the mousedown keeps its default behavior.User Impact
In the macOS app, split-screen pane headers now behave like a titlebar: press-and-drag on the title or any empty header area moves the window, and the header no longer starts a pointless text selection. Header buttons (workspace toggle, split down/right, close) keep working as before. Browser users only lose the accidental selectability of the pane title.
Evidence
performDragfrom the left-mouse-down current event and moved the window frame exactly from (200,300) to (500,400).swift build --package-path apps/macos: Build complete.swift test --filter DashboardWindowSmokeTests(local macOS): 24 tests passed, including the newdashboard accepts only typed window drag requests.pnpm test ui/src/app/native-window-drag.test.ts ui/src/pages/chat/chat-pane.test.ts ui/src/pages/chat/chat-page.test.ts(Testbox): 27 passed.pnpm check:changed -- <touched files>(Testbox): exit 0 (format, lint, typecheck core/test lanes, guards).