Skip to content

fix(macos): drag the window from split-view pane headers - #104048

Merged
steipete merged 2 commits into
mainfrom
claude/mac-split-screen-drag-border-699592
Jul 11, 2026
Merged

steipete merged 2 commits into
mainfrom
claude/mac-split-screen-drag-border-699592

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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 isMovableByWindowBackground nor Electron-style app-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 existing openclawLink bridge: the Control UI posts an openclawWindowDrag script 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.currentEvent must be a left-mouse press in this window) before handing the event to NSWindow.performDrag(with:). The header row is also marked user-select: none since 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

  • Live mechanism proof on macOS (standalone WKWebView harness using the exact bridge and guards): synthetic press on the header followed by a +300/+100 drag invoked performDrag from 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 new dashboard 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).
  • Autoreview (Codex gpt-5.5, xhigh): clean, no actionable findings.

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.
@openclaw-barnacle openclaw-barnacle Bot added app: macos App: macos app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Jul 11, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 11, 2026
@clawsweeper

clawsweeper Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 10, 2026, 10:04 PM ET / July 11, 2026, 02:04 UTC.

Summary
The PR adds a guarded WKWebView-to-AppKit drag bridge for passive split-pane headers, disables header title selection, adds focused tests, and extracts dashboard failure-page rendering into a separate Swift file.

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: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Restrict the native drag receiver to the original .leftMouseDown event.
  • Attach a redacted OpenClaw macOS recording showing pane-header dragging and successful header-button interactions.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The standalone WKWebView harness proves the mechanism but not the changed behavior in the actual OpenClaw macOS app; add a redacted recording, update the PR body to trigger review, and if needed ask a maintainer to comment @clawsweeper re-review.

Risk before merge

  • [P1] The integrated OpenClaw macOS window, WKWebView, pane header, and header controls have not been demonstrated together in real behavior proof.

Maintainer options:

  1. Decide the mitigation before merge
    Keep the guarded per-pane bridge, restrict the native handoff to the captured original .leftMouseDown event, and provide a redacted actual-app recording showing window movement plus unaffected header-button interactions.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] The contributor should correct the AppKit event handoff and add actual-app proof; the protected maintainer label then requires explicit human review rather than an automated repair or close path.

Security
Cleared: The new native bridge is constrained to the owning web view, trusted main-frame Control UI source, a closed message type, and the same active window.

Review findings

  • [P2] Pass only the original mouse-down event to performDrag — apps/macos/Sources/OpenClaw/DashboardWindowController.swift:311
Review details

Best possible solution:

Keep the guarded per-pane bridge, restrict the native handoff to the captured original .leftMouseDown event, and provide a redacted actual-app recording showing window movement plus unaffected header-button interactions.

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:

  • [P2] Pass only the original mouse-down event to performDrag — apps/macos/Sources/OpenClaw/DashboardWindowController.swift:311
    Apple's NSWindow.performDrag(with:) contract requires the original mouse-down event, but this guard still accepts .leftMouseDragged. If script-message delivery advances NSApp.currentEvent to a drag event, the native call receives the wrong event and may not start a normal window drag. Restrict this path to .leftMouseDown and pass that captured event. This finding remains from the previous review cycle.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f50293c9e73b.

Label changes

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P2: The PR addresses a bounded macOS split-view interaction defect with limited blast radius and no data, delivery, auth, or availability impact.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The standalone WKWebView harness proves the mechanism but not the changed behavior in the actual OpenClaw macOS app; add a redacted recording, update the PR body to trigger review, and if needed ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +57, Tests +92, Other +56. Total +205 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 3 58 1 +57
Tests 1 92 0 +92
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 166 110 +56
Total 7 316 111 +205

What I checked:

  • Current-main drag limitation: Current main implements fixed-geometry native drag-region views around the dashboard chrome, but has no per-pane bridge for web-rendered split-view headers. (apps/macos/Sources/OpenClaw/DashboardWindowController.swift:442, f50293c9e73b)
  • AppKit event mismatch: The current PR head allows either a left-mouse-down or left-mouse-dragged event to reach performDrag(with:), rather than requiring the original mouse-down event. (apps/macos/Sources/OpenClaw/DashboardWindowController.swift:310, b66a54176989)
  • Dependency contract: Apple's current AppKit documentation states that performDrag(with:) starts a drag from the specified mouse-down event and identifies its parameter as the original mouse-down event received by the application or view.
  • Prior finding continuity: The second commit extracts failure-page HTML but does not change the drag receiver, so the earlier original-mouse-down finding remains applicable on the current head. (apps/macos/Sources/OpenClaw/DashboardWindowController.swift:310, b66a54176989)
  • Controller-size finding resolved: The new commit moves 114 lines of presentation-only failure HTML out of DashboardWindowController, resolving the previous Swift size-gate concern without changing its output. (apps/macos/Sources/OpenClaw/DashboardFailurePage.swift:1, b66a54176989)
  • Proof remains harness-only: The PR body reports a standalone WKWebView mechanism harness plus tests and checks, but no recording or artifact showing the drag in the actual OpenClaw macOS app. (b66a54176989)

Likely related people:

  • steipete: Previously introduced the current background-task controls in the split-pane header through merged commit 4669235, providing direct current-main history in the affected UI surface beyond authoring this PR. (role: recent feature contributor; confidence: high; commits: 46692355c903; files: ui/src/pages/chat/chat-pane.ts)
  • Vincent Koc: The available full-history path trace associates commit e085fa1 with the current dashboard window implementation, making this a secondary routing signal for the native surface. (role: historical dashboard contributor; confidence: low; commits: e085fa1a3ffd; files: apps/macos/Sources/OpenClaw/DashboardWindowController.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-11T01:53:03.731Z sha a60339e :: needs real behavior proof before merge. :: [P2] Pass only the original mouse-down event to performDrag | [P2] Extract the drag handling to restore the Swift size gate

…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.
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 11, 2026
@steipete
steipete merged commit b7156ce into main Jul 11, 2026
84 of 86 checks passed
@steipete
steipete deleted the claude/mac-split-screen-drag-border-699592 branch July 11, 2026 02:07
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 11, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos app: web-ui App: web-ui maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant