Repository navigation
feat(ui): add This Mac settings backed by the native device bridge - #137971
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 5:10 AM ET / 09:10 UTC. ClawSweeper reviewWhat this changesAdds 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 Review scores
Verification
How this fits togetherThe 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +1708, Tests +1305, Docs +16. Total +3029 across 33 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…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
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 receivesstatus/set/request-permission/open-system-settings/open/check-for-updatesmessages. Native remains the source of truth; the web never writesopenclaw.jsonfor these. Exec approvals for this Mac need no bridge: the Devices page already edits them throughexec.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 throughvoicewake.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.openclawDeviceSettingsand seeded snapshot):Live before/after screenshots from the Mac app land with the companion macOS PR.
node scripts/check-changed.mjsgreen (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:buildgreen; 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.origin/main, P2): scoped-clean.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).test/scripts/pnpm-audit-prod.test.tsstalled-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.tssidebar-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
afterapp profile):