Skip to content

feat(ui): click the desktop to take control - #123096

Merged
steipete merged 4 commits into
mainfrom
steipete/desktop-ui-auto-control-178c07
Aug 13, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/desktop-ui-auto-control-178c07

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Control UI Desktop panel connects view-only and requires a separate "Take control" toolbar button to get an input-capable connection. That is an extra, easy-to-miss step: the natural operator instinct is to click into the desktop and start driving.

Why This Change Was Made

Clicking the desktop stage is now the take-control affordance. While a connection is view-only, a transparent overlay button covers the stage — clicking anywhere on the desktop reconnects with control: true. The overlay is a real <button> with the same "Take control" accessible name and a :focus-visible outline, so keyboard and assistive-tech access are preserved. Once controlling, the overlay is gone and input flows to the remote desktop as before. The toolbar button is deleted; the toolbar keeps app launchers and Disconnect.

The connecting status overlay (.desktop-connecting) becomes pointer-events: none so it cannot swallow clicks aimed at the desktop below — this preserves the pre-change ability to request control while a view-only connection is still connecting.

The control-taken recovery path is unchanged: if another operator takes control, the panel downgrades to view-only and shows the notice; clicking the desktop deliberately retakes control.

User Impact

Operators take control of a cloud-worker/host/node desktop by clicking into it, instead of finding a toolbar button. One less concept in the toolbar; the view-only default and single-controller semantics are unchanged.

Evidence

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/desktop-panel.e2e.test.ts — 12/12 pass. The existing take-control e2e now exercises the overlay (same accessible name) plus a new assertion that the overlay spans the desktop stage.
  • Autoreview (Codex, gpt-5.6-sol, high): clean, no accepted/actionable findings.
  • Before/after screenshots (mocked gateway + fake RFB client, connected view-only): below.

Production LOC delta: net ≈ +9 (overlay button replaces toolbar button; CSS for overlay + pointer-events line; docs updated). Tests +18.

Before (view-only, toolbar "Take control") After (view-only, click the desktop)
before after

View-only desktop connections now escalate to control by clicking
anywhere on the desktop stage (transparent overlay button, keyboard
accessible, same 'Take control' accessible name). The toolbar button is
removed; the connecting status overlay becomes click-through so control
can still be requested mid-connect.
@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Aug 13, 2026
@steipete
steipete marked this pull request as ready for review August 13, 2026 09:14
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 5:20 AM ET / 09:20 UTC.

ClawSweeper review

What this changes

Moves the Desktop panel’s existing view-only “Take control” action from the toolbar to an accessible button overlay covering the remote desktop stage.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for maintainer review: current main still has the toolbar control, and this maintainer-owned PR changes the active desktop interaction. Real noVNC-surface proof is still needed before merge.

Priority: P3
Reviewed head: fae228d382fb2f1e3b2c1b7e360b60f76da2c810
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation is focused and behaviorally covered, but confidence remains limited until it is shown above a real RFB desktop surface.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer PR is outside the external-contributor proof gate, but its mocked-gateway/fake-RFB screenshots do not replace the repository-requested real Control UI verification.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer PR is outside the external-contributor proof gate, but its mocked-gateway/fake-RFB screenshots do not replace the repository-requested real Control UI verification.
Evidence reviewed 7 items Current-main behavior: Current main still renders the visible toolbar “Take control” button while not controlling, so the PR’s central interaction change is not already implemented.
Control owner boundary: The panel owns the control transition: it disconnects the existing client, requests desktop observation with control enabled, and reconnects with the returned control state.
Branch interaction change: The branch preserves the same accessible action name and control request while placing it over the view-only desktop stage; the connecting status layer is click-through.
Findings None None.
Security None None.

How this fits together

The Control UI opens a remote desktop through the Gateway in view-only mode, then reconnects with input control for one operator. The panel translates that state into the remote-desktop surface, connection status, and control request.

flowchart LR
A[Operator opens Desktop panel] --> B[View-only desktop connection]
B --> C[Desktop-stage control overlay]
C --> D[Gateway control request]
D --> E[Input-capable remote desktop]
E --> F[Single active controller]
Loading

Decision needed

Question Recommendation
Before merge, should this desktop-stage interaction be accepted only after a real noVNC-backed Control UI run confirms that the overlay receives the click and escalates to control? Capture real desktop proof: Run a redacted Control UI session against an actual RFB desktop and show that clicking the view-only stage sends the control request and restores input.

Why: The available browser test and screenshots use a fake desktop client, while the actual production surface mounts noVNC into the element beneath the new overlay.

Before merge

  • Resolve merge risk (P1) - The changed E2E substitutes a fake desktop client, so it does not prove that the overlay remains above an actual noVNC-mounted surface and receives the first click.
  • Resolve merge risk (P1) - The local noVNC package source was unavailable and GitHub was unreachable during review, so its DOM-layering contract could not be directly inspected.
Agent review details

Security

None.

PR surface

Source +13, Tests +17, Docs 0. Total +30 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 25 12 +13
Tests 1 18 1 +17
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 44 14 +30

Review metrics

Metric Value Why it matters
Production vs test LOC production +25/-12 (net +13); tests +18/-1 (net +17); docs +1/-1 The production growth is the accessible full-stage action and its styling; the test addition covers the intended control request but not a real RFB mount.

Merge-risk options

Maintainer options:

  1. Verify against a real RFB surface (recommended)
    Capture a redacted real Control UI/noVNC run proving the stage overlay receives the click and reconnects with control before merging.
  2. Hold the UX change
    Pause this PR if real desktop proof cannot be obtained, because the mocked client does not establish production input layering.

Technical review

Best possible solution:

Keep the single stage-wide control action and attach redacted proof from a real Control UI connection showing a view-only desktop click requests control without blocking recovery or input.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR changes an existing interaction rather than reporting a current-main defect; the supplied E2E exercises a mocked Gateway and fake desktop client.

Is this the best way to solve the issue?

Unclear: relocating the existing action is a coherent owner-boundary change, but it is only the best solution once a real noVNC-backed desktop confirms the overlay and input transition work together.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a bounded Control UI ergonomics change rather than a current user-facing outage or regression.
  • add merge-risk: 🚨 other: A production noVNC surface may layer differently from the fake desktop client used by the changed E2E.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. This maintainer PR is outside the external-contributor proof gate, but its mocked-gateway/fake-RFB screenshots do not replace the repository-requested real Control UI verification.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer PR is outside the external-contributor proof gate, but its mocked-gateway/fake-RFB screenshots do not replace the repository-requested real Control UI verification.

Label justifications:

  • P3: This is a bounded Control UI ergonomics change rather than a current user-facing outage or regression.
  • merge-risk: 🚨 other: A production noVNC surface may layer differently from the fake desktop client used by the changed E2E.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer PR is outside the external-contributor proof gate, but its mocked-gateway/fake-RFB screenshots do not replace the repository-requested real Control UI verification.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. This maintainer PR is outside the external-contributor proof gate, but its mocked-gateway/fake-RFB screenshots do not replace the repository-requested real Control UI verification.

Evidence

What I checked:

Likely related people:

  • steipete: The current main desktop-panel history identifies this person on the original desktop-panel change, and the same area is the subject of this PR. (role: feature introducer and recent area contributor; confidence: high; commits: 2464c17ab560; files: ui/src/components/desktop/desktop-panel.ts, ui/src/e2e/desktop-panel.e2e.test.ts, docs/gateway/cloud-workers.md)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach a redacted real Control UI/noVNC capture showing view-only stage click, the control request, and usable input afterward.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

In-page RFB 3.8 fake server (security None) lets the production
DesktopClient drive the real noVNC client; the overlay click must
hit-test above the mounted canvas and reconnect with control.
@steipete

Copy link
Copy Markdown
Contributor Author

Both P1 items from the ClawSweeper review are addressed on the current head.

Real noVNC-surface proof. Added ui/src/e2e/desktop-panel.e2e.test.ts › "takes control by clicking a real noVNC-mounted desktop". It does not fake the desktop client: the production DesktopClient lazy-imports the real @novnc/novnc RFB client, which connects through an in-page WebSocket that speaks the actual RFB 3.8 server handshake (version → security None → SecurityResult → ServerInit). The test waits for the real noVNC canvas inside .desktop-surface, then clicks the take-control overlay — Playwright refuses clicks intercepted by another element, so a passing click proves the overlay hit-tests above the mounted canvas — and asserts the desktop.observe reconnect with control: true plus a second real mount. Runs green locally: 13/13 in the desktop e2e file.

noVNC DOM-layering contract. Inspected directly in @novnc/novnc 1.7.0 (the installed dependency): core/rfb.js:219-232 creates _screen as a plain div with display:flex; width:100%; height:100%; overflow:auto and a canvas child with only margin:auto/outline:none — no position, no z-index, nothing that creates a stacking context — and core/rfb.js:573 appends _screen into the target (.desktop-surface). The overlay is an absolutely-positioned later sibling of .desktop-surface in the same stacking context; per CSS painting order, positioned elements paint (and hit-test) above non-positioned in-flow content, so the overlay stays above the RFB surface by contract, not by luck.

Also fixed on this head: the checks-ui failure was the repo cursor policy (hardcoded cursor: pointer on a control); the overlay now uses var(--cursor-action, pointer).

@steipete
steipete merged commit 2278ca6 into main Aug 13, 2026
99 checks passed
@steipete
steipete deleted the steipete/desktop-ui-auto-control-178c07 branch August 13, 2026 10:07
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 14, 2026
* feat(ui): click the desktop to take control

View-only desktop connections now escalate to control by clicking
anywhere on the desktop stage (transparent overlay button, keyboard
accessible, same 'Take control' accessible name). The toolbar button is
removed; the connecting status overlay becomes click-through so control
can still be requested mid-connect.

* fix(ui): use cursor-action token for desktop take-control overlay

* test(ui): prove take-control click above a real noVNC surface

In-page RFB 3.8 fake server (security None) lets the production
DesktopClient drive the real noVNC client; the overlay click must
hit-test above the mounted canvas and reconnect with control.

* fix(ui): narrow fake RFB socket payload to ArrayBuffer-backed bytes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant