Skip to content

feat(ui): add This Mac settings backed by the native device bridge - #137971

Merged
steipete merged 2 commits into
mainfrom
steipete/ui-this-mac-settings
Sep 4, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/ui-this-mac-settings

Conversation

@steipete

@steipete steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Related: #115999 (native/dashboard ownership doctrine)

What Problem This Solves

The macOS app has two settings surfaces: a native Settings window (General, Permissions, Voice & Talk, Updates plus legacy gateway panes) and the Dashboard's Settings. Users have to know which window owns which setting, and the native panes drift from the Dashboard every time it evolves. Some settings exist only in the native window (voice-wake trigger words, app-local preferences), so they are unreachable from any browser.

Why This Change Was Made

This is part 1 of 2 of retiring the native Settings window. The doctrine from #115999 is: native owns device-local capability, the Dashboard owns settings UI. This PR adds the Control UI half: a This Mac settings group rendered by the web and backed by a WKWebView bridge (openclawDeviceSettings) that exists only inside the Mac app on that Mac. In a plain browser nothing changes: no bridge, no group, no sections. The companion macOS PR implements the bridge in Swift, removes the native Settings window, and keeps only a small native Connection window (mode, remote/SSH, saved Gateways) because that must work when the Gateway is unreachable.

Bridge contract: the app publishes a validated snapshot (window.__OPENCLAW_NATIVE_DEVICE_SETTINGS__ + openclaw:native-device-settings-changed) and receives status / set / request-permission / open-system-settings / open / check-for-updates messages. Native remains the source of truth; the web never writes openclaw.json for these. Exec approvals for this Mac need no bridge: the Devices page already edits them through exec.approvals.node.*, which shares the node's SQLite store with the app.

Non-goals: no gateway or protocol changes, no new config keys, no gateway-version compatibility code.

User Impact

Inside the Mac app, Settings gains a This Mac group: This Mac (/settings/device: app behavior, capabilities, browser login import, cookie sync, developer tools) and Permissions (/settings/device/permissions: all eight macOS permissions with Grant / Open System Settings actions, location mode, precise location, active computer presence). Talk gains a This Mac section (Voice Wake, push-to-talk, sounds, microphone, languages, microphone test) plus a Trigger words editor that now works from every browser through voicewake.get/voicewake.set. Updates gains the app version/build, the automatic-updates preference, and Check for Updates…. Settings search and the command palette include the new pages only when the bridge exists. Browsers see no change.

Evidence

Mocked bridge (Playwright e2e with a stubbed webkit.messageHandlers.openclawDeviceSettings and seeded snapshot):

This Mac page
Permissions page

Live before/after screenshots from the Mac app land with the companion macOS PR.

  • node scripts/check-changed.mjs green (format, assertion ratchet, typecheck core tests + UI, i18n, coercion guard, dead-export scan, UI styles).
  • pnpm test ui/src/app/native-device-settings.test.ts ui/src/pages/device ui/src/pages/config/talk.test.ts ui/src/pages/config/updates.test.ts ui/src/app-navigation-groups.test.ts ui/src/app-navigation.test.ts ui/src/components/settings-sidebar.test.ts ui/src/pages/config/settings-search.test.ts ui/src/components/command-palette-catalog-search.test.ts → 9 files, 253 tests passed.
  • pnpm test:ui:e2e ui/src/e2e/native-device-settings.e2e.test.ts → passed (group visibility for admin and non-admin, exact bridge messages, snapshot re-render, permission request).
  • pnpm ui:i18n:verify, pnpm lint:ui:styles, pnpm ui:build green; startup JS gzip 349,409 B (below the 350,141 B limit and 156 B under the committed baseline) because device pages, their copy, and bridge parsing stay out of the boot path.
  • Codex autoreview (branch vs origin/main, P2): scoped-clean.
  • Follow-up commit aca9742d504: the settings-search manifest test enumerates targets in order and now includes the two device targets (pnpm test ui/src/pages/config/settings-targets.test.ts → 19 passed).
  • Unrelated CI noise seen on this PR: test/scripts/pnpm-audit-prod.test.ts stalled-body timing flake from fix(ci): reject malformed advisories and bound audit delays #137960, fixed separately in test(ci): make stalled audit budget tests deterministic #137983; ui/src/e2e/external-session-catalogs.e2e.test.ts sidebar-click timeout on one hosted e2e shard, rerun.

Live inside the macOS app (companion branch build, isolated dev gateway serving this branch's bundle, fresh after app profile):

This Mac, live
Permissions, live
Talk with the This Mac section and trigger words, live

Move app-local settings, permissions, voice controls, and updates into
native-only Control UI surfaces backed by the frozen WebKit bridge.

Add Gateway trigger-word editing with focused, serialized autosave and
retain pending native edits across page navigation. Keep device pages,
English section copy, and native bridge parsing outside browser startup.
@clawsweeper

clawsweeper Bot commented Sep 4, 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 size: XL maintainer Maintainer-authored PR labels Sep 4, 2026
@steipete
steipete marked this pull request as ready for review September 4, 2026 06:14
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 5:10 AM ET / 09:10 UTC.

ClawSweeper review

What this changes

Adds Control UI pages for Mac-local settings and permissions, a validated optional native WebKit bridge, and Mac-specific sections in Talk and Updates settings.

Merge readiness

✅ Ready for maintainer review

Keep open. The branch implements the Dashboard half of the established macOS settings handoff, and the related native-host implementation remains an open companion PR rather than a merged replacement.

Priority: P2
Reviewed head: aca9742d504e6a8da7904945d45dd3f137d66906

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-covered platform integration that follows the prior ownership handoff and has no actionable patch defect found.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): The PR body records a live paired Mac-app/Gateway run with screenshots, while source E2E and page tests exercise bridge-present behavior, browser fallback, stale acknowledgements, and typed permission actions.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The PR body records a live paired Mac-app/Gateway run with screenshots, while source E2E and page tests exercise bridge-present behavior, browser fallback, stale acknowledgements, and typed permission actions.
Evidence reviewed 7 items Validated native bridge: The bridge is installed only when a callable WebKit message handler exists, validates the initial snapshot, and exposes typed request methods without optimistic snapshot mutation.
Capability-gated navigation: Mac-local routes are included only when the native device-settings capability is present, keeping ordinary browser navigation free of native-only settings.
Browser and native-path coverage: The end-to-end test covers the browser app-only state, hidden native navigation, and continued browser voice-wake editing; the page tests cover typed native toggles, stale acknowledgements, debounced edits, and permission actions.
Findings None None.
Security None None.

How this fits together

The Control UI normally receives settings from the Gateway; inside the Mac app it can also receive a validated snapshot of device-local preferences and send typed requests to the native host. The new pages expose those device-local controls while preserving browser access to Gateway-owned voice-wake settings.

flowchart LR
  A[Mac app WebKit host] --> B[Optional device settings bridge]
  B --> C[Control UI application]
  C --> D[This Mac and Permissions pages]
  C --> E[Talk and Updates pages]
  D --> F[Typed native settings requests]
  E --> G[Gateway voice-wake settings]
  C --> H[Browser app-only state when no bridge exists]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1708, Tests +1305, Docs +16. Total +3029 across 33 files.

View PR surface stats
Area Files Added Removed Net
Source 24 1720 12 +1708
Tests 8 1309 4 +1305
Docs 1 16 0 +16
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 33 3045 16 +3029

Review metrics

Metric Value Why it matters
Production versus test delta production +1,720/-12; tests and test support +1,309/-4; docs +16/-0 The feature adds a bounded Mac-only settings surface with substantial direct coverage rather than a small maintenance change.

Technical review

Best possible solution:

Land this Dashboard-side contract together with the companion native host only after normal maintainer integration review confirms native requests retain their final authorization boundary.

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

Not applicable: this is a feature PR; source tests cover both bridge-present and bridge-absent behavior, and the PR body records a live Mac-app run.

Is this the best way to solve the issue?

Yes: the optional capability-gated bridge keeps device-local controls in the native owner while retaining Gateway-owned voice-wake controls for browser users.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded platform-specific settings capability with meaningful user value but no demonstrated urgent regression.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body records a live paired Mac-app/Gateway run with screenshots, while source E2E and page tests exercise bridge-present behavior, browser fallback, stale acknowledgements, and typed permission actions.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body records a live paired Mac-app/Gateway run with screenshots, while source E2E and page tests exercise bridge-present behavior, browser fallback, stale acknowledgements, and typed permission actions.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body records a live paired Mac-app/Gateway run with screenshots, while source E2E and page tests exercise bridge-present behavior, browser fallback, stale acknowledgements, and typed permission actions.

Label justifications:

  • P2: This is a bounded platform-specific settings capability with meaningful user value but no demonstrated urgent regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body records a live paired Mac-app/Gateway run with screenshots, while source E2E and page tests exercise bridge-present behavior, browser fallback, stale acknowledgements, and typed permission actions.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body records a live paired Mac-app/Gateway run with screenshots, while source E2E and page tests exercise bridge-present behavior, browser fallback, stale acknowledgements, and typed permission actions.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body records a live paired Mac-app/Gateway run with screenshots, while source E2E and page tests exercise bridge-present behavior, browser fallback, stale acknowledgements, and typed permission actions.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@steipete
steipete merged commit 2fc8eb0 into main Sep 4, 2026
251 of 253 checks passed
@steipete
steipete deleted the steipete/ui-this-mac-settings branch September 4, 2026 16:46
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
…penclaw#137971)

* feat(ui): add This Mac settings and native device bridge

Move app-local settings, permissions, voice controls, and updates into
native-only Control UI surfaces backed by the frozen WebKit bridge.

Add Gateway trigger-word editing with focused, serialized autosave and
retain pending native edits across page navigation. Keep device pages,
English section copy, and native bridge parsing outside browser startup.

* test(ui): include device targets in the settings search manifest
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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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