Skip to content

feat: view your machine's screen from the iOS and Android apps - #123097

Merged
steipete merged 6 commits into
mainfrom
mobile-desktop-land
Aug 13, 2026
Merged

steipete merged 6 commits into
mainfrom
mobile-desktop-land

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Operators could already watch a machine's screen from the Control UI in a desktop browser, but not
from their phone. The desktop surface was a dock panel with a 380px minimum width, bottom/right
docking, and no touch affordances — desktop chrome that does not fit a 390pt phone — and neither
the iOS nor the Android app had any entry point to it at all. If you were away from your desk and
wanted to see what your gateway host or one of your nodes was actually doing, there was no way to
do it.

Why This Change Was Made

This adds a desktop-only document mode to the Control UI (/?view=desktop, or /desktop), mirroring
the existing terminal document mode, and gives the iOS and Android apps entry points that load it in
their existing authenticated Control UI webview. The route renders full-bleed with no app shell and a
compact four-action touch toolbar (view-only/control, keyboard, fit, back); noVNC's built-in
GestureHandler already provides two-finger scroll, long-press right-click and pinch, so no gestures
are reimplemented. View-only is the default and control is an explicit toggle.

This is a client and presentation change only. The gateway side already ships desktop.observe with
host/environment/node sources, the RFB relay, and protocol-level view-only enforcement; none of that
is touched. Credentials never enter a URL — the native apps inject them with their existing
document-start script, and VNC passwords stay in memory.

Each app places the standalone entry where that platform already keeps Terminal: a sidebar Page on
iOS, and Settings → Agents & automation on Android, whose sidebar is a curated five-item set that
does not include Terminal either. Both also add a per-session action. Both entry points are hidden
unless the gateway advertises desktop.observe.

User Impact

You can now open your machine's screen from your phone. On iOS it is a Desktop page in the sidebar
plus a toolbar button on a session; on Android it is Settings → Agents & automation → Desktop plus a
session action. Both open a full-screen viewer that starts view-only, with a touch toolbar for taking
control, raising the keyboard, and toggling fit-to-screen. Gateway hosts, cloud environments, and
paired nodes all appear in the viewer's source picker.

Two blank-screen defects found while testing this on a real device are fixed as part of it. One of
them also fixes the already-shipped ?view=terminal document mode, which could be redirected into
model setup on a gateway with no provider configured.

Evidence

End-to-end on a real desktop, not a mock. A TigerVNC + XFCE container (RFB 003.008, VncAuth)
behind a gateway on an isolated loopback port, viewed through the Android app's Desktop screen: the
source picker lists the machine, connecting streams live XFCE pixels, and the VNC server log
independently records SConnection: Client requests security type VncAuth(2) with negotiated pixel
formats. The same flow verified in a 375x812 browser viewport, where the toolbar reports
aria-pressed="false" on "Take control" (view-only default) and flips to "Switch to view only" when
toggled.

Two defects found live and fixed at the root.

Android WebView collapses viewport height units. The viewer sized itself with height: 100dvh and
rendered as a blank page. Measured in the WebView: dvh, vh, svh and lvh all resolve to 0
while 100% and innerHeight correctly report 708. The fixed inset already sizes the element, so
the height is removed with a comment so it does not come back.

The first-run model-setup redirect hijacked document modes. A ?view= document mode still lands on
the chat path, so isDefaultChatLanding matched it and a gateway without a configured provider
redirected the viewer into model setup. Only the redirect is gated — firstRunDefaultLanding keeps
its previous value because it also drives deferInitialLocationUntilGateway. Verified against the
shipped terminal mode, which reproduced the same redirect before the fix.

Android System Back left the session. The per-session viewer replaces the dashboard in place rather
than pushing a nav destination, so Back fell through to the shell handler and popped the whole tab.
Reproduced on the emulator against a pre-fix build — Back landed on Chat, skipping the dashboard —
and returns to the dashboard with the fix.

Gates. Full UI suite green (8673 unit tests), both e2e suites including main's expanded
desktop-panel.e2e.test.ts from #122992, pnpm ui:i18n:verify, knip dead-export scan at 0 entries,
oxfmt, git diff --check, and pnpm ui:build — startup JS stayed within budget, confirming the
viewer remains lazily loaded. Android assemblePlayDebug, unit tests, ktlint, and lint pass; iOS
builds for the simulator with its unit tests green.

Known follow-ups, not addressed here. The Control UI webview renders in light theme while the
native app is dark — a pre-existing theme-sync gap that affects the Terminal screen identically.
TigerVNC's default blacklist threshold can trip on probe-plus-attach arriving from one NAT'd source
address, which is worth watching for real Linux hosts.

Android: before and after the WebView sizing fix

Same build, same gateway, same Desktop screen. Before, every viewport height unit resolved to 0 and
the viewer collapsed to a blank page; after, the picker connects and streams the real XFCE desktop
with the touch toolbar overlaid.

Before After

Re-verification note

The Control UI reconciliation onto current main (which landed #122992 refactoring the same panel)
was re-verified in a browser at phone viewport and, more directly, by driving the Android app's own
authenticated WebView — it returns the source picker with the host machine listed. The native
Android Settings row was verified end-to-end before the reconciliation; after it, repeated test
gateway restarts left the emulator unpaired, so that specific surface was not re-demonstrated
against the reconciled build. Nothing in the reconciliation touches apps/android.

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

@steipete
steipete marked this pull request as ready for review August 13, 2026 09:17
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Aug 13, 2026
@steipete
steipete force-pushed the mobile-desktop-land branch from d64b358 to e7fa7cf Compare August 13, 2026 09:24
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed August 13, 2026, 6:14 AM ET / 10:14 UTC.

ClawSweeper review

What this changes

Adds a shell-free Control UI desktop document with touch controls and iOS/Android entry points for viewing a Gateway or node desktop.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open: the new native availability checks omit the existing operator.admin requirement, so limited-scope mobile connections can see Desktop only to have the Gateway reject it. The mobile document-mode design otherwise fits the companion-app direction.

Priority: P2
Reviewed head: 14033a09c6cc4e11eaf52827526f77d1645d2132

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The feature has meaningful real-device evidence, but the native authorization gate is a P1 correctness blocker.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body nonetheless reports a real Android RFB session and browser-viewport verification.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body nonetheless reports a real Android RFB session and browser-viewport verification.
Evidence reviewed 7 items Current web availability contract: The existing Control UI exposes Desktop only when the connection is active, has operator.admin, and advertises desktop.observe; the native addition should preserve that same gate.
Gateway authorization contract: desktop.observe is registered with operator.admin, so a method advertisement alone does not authorize the native WebView request.
Published desktop contract: Current Cloud Worker Desktop documentation states that operators need operator.admin access to watch and control the desktop.
Findings 1 actionable finding [P1] Gate mobile Desktop on operator.admin
Security None None.

How this fits together

The native apps load an authenticated, Gateway-served Control UI document in a WebView. That document requests desktop sources and a short-lived RFB stream from the Gateway, which remains the authorization and relay owner.

flowchart LR
  A[Mobile app] --> B[Authenticated Control UI]
  B --> C[Desktop availability check]
  C --> D[Gateway desktop observer]
  D --> E[Authorization and source selection]
  E --> F[Remote desktop stream]
Loading

Before merge

  • Gate mobile Desktop on operator.admin (P1) - The new availability state checks only whether desktop.observe is advertised. A paired device with only operator.read can therefore see Desktop, but the Gateway registers that RPC as operator.admin; the existing web gate checks both. Combine the method check with each app's existing admin-scope state and cover the limited-scope case so the entry is hidden instead of leading to an authorization failure.
  • Resolve merge risk (P1) - The direct @novnc/novnc keyboard-forwarding change could not be checked against installed dependency source because node_modules is absent and the partial-clone fetch could not resolve GitHub; inspect that contract before merge.
  • Complete next step (P2) - A narrow, mechanical repair can align both native availability checks with the already-established Gateway and Control UI access contract.

Findings

  • [P1] Gate mobile Desktop on operator.admin — apps/ios/Sources/Model/NodeAppModel.swift:5285-5307
Agent review details

Security

None.

PR surface

Source +603, Tests +312, Other +611. Total +1526 across 34 files.

View PR surface stats
Area Files Added Removed Net
Source 10 843 240 +603
Tests 4 315 3 +312
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 20 1241 630 +611
Total 34 2399 873 +1526

Review metrics

Metric Value Why it matters
Production versus test delta production +1,220/-246 (net +974); tests +445/-5; generated native catalog +734/-622 The feature adds substantial cross-platform UI surface; its production growth is attributable to the new mobile desktop capability, but the authorization gate must be corrected before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Gate both native entry points on a connected operator.admin session as well as desktop.observe, with focused limited-scope visibility coverage, while keeping Gateway-side authorization authoritative.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Gate both native entry points on a connected operator.admin session as well as desktop.observe, with focused limited-scope visibility coverage, while keeping Gateway-side authorization authoritative.

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

Yes, from source: connect either native app with operator.read but not operator.admin to a Gateway advertising desktop.observe; the new entry appears, while the Gateway contract rejects desktop.observe.

Is this the best way to solve the issue?

No: reusing the Control UI document is appropriate, but its native availability checks must match the existing operator.admin-plus-method gate before this is the best solution.

Full review comments:

  • [P1] Gate mobile Desktop on operator.admin — apps/ios/Sources/Model/NodeAppModel.swift:5285-5307
    The new availability state checks only whether desktop.observe is advertised. A paired device with only operator.read can therefore see Desktop, but the Gateway registers that RPC as operator.admin; the existing web gate checks both. Combine the method check with each app's existing admin-scope state and cover the limited-scope case so the entry is hidden instead of leading to an authorization failure.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.93

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded but user-visible mobile feature whose current scope-gating defect blocks limited-access operators from using its advertised entry point.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body nonetheless reports a real Android RFB session and browser-viewport verification.

Label justifications:

  • P2: This is a bounded but user-visible mobile feature whose current scope-gating defect blocks limited-access operators from using its advertised entry point.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body nonetheless reports a real Android RFB session and browser-viewport verification.

Evidence

Acceptance criteria:

  • [P1] pnpm android:test.
  • [P1] Run the focused iOS OpenClawTests target containing the new Desktop availability coverage on an iOS simulator.
  • [P1] node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/desktop-document-mode.e2e.test.ts.

What I checked:

Likely related people:

  • joshavant: Current-main blame attributes the shared desktop availability predicate, including its operator.admin check, to this area of work. (role: introduced current web access gate; confidence: high; commits: 0901efe3dd; files: ui/src/app/app-shell-chrome.ts)
  • steipete: Authored the merged desktop direct-routing work and this mobile extension, connecting them to the active desktop-viewer surface. (role: recent desktop feature contributor; confidence: high; commits: 2464c17ab560, 14033a09c6cc; files: ui/src/components/desktop/desktop-panel.ts, apps/ios/Sources/Model/NodeAppModel.swift, apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt)

Rank-up moves

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

  • Require both operator.admin and desktop.observe before exposing Desktop in iOS and Android.
  • Add focused native coverage for a method-advertised connection without operator.admin.
  • Inspect the installed noVNC keyboard-event contract before merge.

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.

Add a shell-free mobile desktop route that reuses the dock panel controller and lazy noVNC client, with source preselection, touch controls, keyboard input, and retryable inventory failures.
The per-session viewer replaces SessionDashboardScreen in place instead of
pushing a shell tab, so System Back fell through to the shell-level handler
and popped the whole Dashboard tab, stranding the operator on Chat. Claim
Back while the viewer is showing.

Also carry over TerminalSettingsScreen's imePadding: the viewer's own touch
toolbar hosts the keyboard affordance, so the soft keyboard would cover it.

Proof (emulator, Medium_Phone_API_36.0, stub control UI on 18789):
pre-fix Back from the viewer lands on Chat; post-fix it returns to Dashboard.
No Robolectric regression test — no existing screen test constructs
MainViewModel, and BackHandler under Robolectric would need new scaffolding
for weaker evidence than the live repro.
…ment

`ui/vitest.config.ts` runs the unit project with `isolate: false`, so test files
share one jsdom document inside a worker. `view.pairing.test.ts` appends a
container to `document.body` for every case and never tears down, unlike its
sibling `channels-page.test.ts`, so whichever suite the worker scheduled next
inherited a mounted pairing dialog.

That surfaced on this PR's first CI run as ten failures in the untouched
`input-dialog.test.ts`, which found "Approve DM access" where it expected
"Rename session". A rerun went green, so the ordering is scheduler-dependent
rather than deterministic; this removes the contamination source rather than
leaving the next suite to lose the race.

Not a proven fix for that specific run — the leak reproduces only under CI's
file scheduling, and the full suite passes locally either way — but the missing
teardown is a real violation of the shared-environment contract.
@steipete
steipete force-pushed the mobile-desktop-land branch from 14033a0 to f036030 Compare August 13, 2026 10:33
The rail e2e captured the main transcript's text before opening a task detail
and required it to be byte-identical afterwards. A running task renders a live
elapsed label, so the assertion failed whenever a second ticked over between
the two reads — twice while landing this PR, both times "12s" against "13s"
with no other difference.

Normalize elapsed labels on both sides instead of weakening the assertion. The
invariant it protects, that opening a detail leaves the main transcript alone,
still holds: a real content change is still caught, and only complete duration
tokens collapse, so diffstat figures like +14/-3 and phrases like "5 messages"
are untouched.
@steipete
steipete merged commit 2a8b322 into main Aug 13, 2026
106 checks passed
@steipete
steipete deleted the mobile-desktop-land branch August 13, 2026 11:10
@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
…law#123097)

* feat(ui): add mobile desktop document mode

Add a shell-free mobile desktop route that reuses the dock panel controller and lazy noVNC client, with source preselection, touch controls, keyboard input, and retryable inventory failures.

* feat(ios): add desktop viewer entry points

* feat(android): add desktop viewer

* fix(android): keep System Back inside the desktop viewer

The per-session viewer replaces SessionDashboardScreen in place instead of
pushing a shell tab, so System Back fell through to the shell-level handler
and popped the whole Dashboard tab, stranding the operator on Chat. Claim
Back while the viewer is showing.

Also carry over TerminalSettingsScreen's imePadding: the viewer's own touch
toolbar hosts the keyboard affordance, so the soft keyboard would cover it.

Proof (emulator, Medium_Phone_API_36.0, stub control UI on 18789):
pre-fix Back from the viewer lands on Chat; post-fix it returns to Dashboard.
No Robolectric regression test — no existing screen test constructs
MainViewModel, and BackHandler under Robolectric would need new scaffolding
for weaker evidence than the live repro.

* test(ui): stop the pairing views leaking dialogs into the shared document

`ui/vitest.config.ts` runs the unit project with `isolate: false`, so test files
share one jsdom document inside a worker. `view.pairing.test.ts` appends a
container to `document.body` for every case and never tears down, unlike its
sibling `channels-page.test.ts`, so whichever suite the worker scheduled next
inherited a mounted pairing dialog.

That surfaced on this PR's first CI run as ten failures in the untouched
`input-dialog.test.ts`, which found "Approve DM access" where it expected
"Rename session". A rerun went green, so the ordering is scheduler-dependent
rather than deterministic; this removes the contamination source rather than
leaving the next suite to lose the race.

Not a proven fix for that specific run — the leak reproduces only under CI's
file scheduling, and the full suite passes locally either way — but the missing
teardown is a real violation of the shared-environment contract.

* test(ui): stop the background-tasks rail asserting on a ticking clock

The rail e2e captured the main transcript's text before opening a task detail
and required it to be byte-identical afterwards. A running task renders a live
elapsed label, so the assertion failed whenever a second ticked over between
the two reads — twice while landing this PR, both times "12s" against "13s"
with no other difference.

Normalize elapsed labels on both sides instead of weakening the assertion. The
invariant it protects, that opening a detail leaves the main transcript alone,
still holds: a real content change is still caught, and only complete duration
tokens collapse, so diffstat figures like +14/-3 and phrases like "5 messages"
are untouched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android app: ios App: ios app: web-ui App: web-ui maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant