Skip to content

feat(ui): add a personal external browser preference - #159887

Merged
roboclaw-bot merged 3 commits into
mainfrom
openclaw/personal-link-browser-preference
Sep 28, 2026
Merged

roboclaw-bot merged 3 commits into
mainfrom
openclaw/personal-link-browser-preference

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #159884

Additional instructions

Maintainers can edit this same-repository branch.

What Problem This Solves

People who prefer their regular browser currently have to bypass OpenClaw's built-in link readers or native browser panel one link at a time. The existing Control UI browser preference does not override those paths.

Why This Change Was Made

Add Open links outside OpenClaw under Settings → Appearance → Chat, using the existing browser-local preference storage. It overrides automatic reader and browser-panel routing without erasing the existing browser-panel preference. The default stays off, so upgrades retain current behavior.

The setting does not change shared Gateway configuration, change Gateway profile or database schemas, or sync across devices. A small extraction of the local Chat preference bindings keeps the existing settings page within its line-growth limit.

User Impact

Enable the switch to use ordinary browser navigation on the web or the system-default browser in a native host. Disable it to restore the existing reader/panel behavior. The choice survives reloads in the same browser or app webview and is scoped per Gateway. Internal navigation, downloads, modifier-click behavior, and explicit context-menu choices remain unchanged.

Evidence

  • Real Chromium flow with a mocked Gateway: default reader → enable switch → reload → external opening → disable switch → reader restored. Verified both the ordinary browser popup and the native-link bridge handoff; no shared configuration writes. This is not physical-device native-app proof.
  • New routing cases fail against the original implementation and pass with the change. Routing, native/browser sibling behavior, preference persistence, shared-config isolation, settings search, and rendered-switch tests passed.
  • Changed-surface validation passed: formatting, line-growth guards, i18n, selected core-test type graphs, UI typecheck, dead-export scans, lint, and styles. The first lint pass found an unbound test-cleanup callback; binding it and rerunning the routing tests and affected lint/style checks resolved it.
  • UI build passed, including the bundle performance gate.
  • test-audit: each changed test covers a distinct routing, persistence, isolation, search, or rendered-control contract; no duplicate coverage or test-only production seam added.
  • deslop: reviewed the complete diff; no unnecessary defensive branches, casts, compatibility paths, or comment cleanup remained.
  • autoreview: scoped-clean at P0–P2; no actionable findings. The only subsequent change was binding a test-cleanup callback for lint.
  • Flake triage: no product-test flakes observed. Initial proof-script failures came from the standalone TSX serialization helper, switch targeting, and an incorrect assumption that existing panels should disappear; the capture fixture was corrected without changing product behavior or increasing timeouts.
  • Current-head CI passed on 375ab9b: CI run 36355269004. Required CI, security, and dependency-review checks are successful. No failures occurred in the feature PR's CI run; separate native-proof attempts are reported below.

Approved wording revision

The switch now reads Open links outside OpenClaw, with Use your browser instead of the OpenClaw built-in browser. and Saved in this browser only. Defaults, storage, and link routing are unchanged.

The existing rendered-control and settings-search tests passed (28 tests); i18n verification, formatting, lint, and whitespace checks passed. Test-audit: only existing copy/discovery expectations changed, with no new cases or test seams. Deslop: no cleanup needed. Copy-only autoreview was scoped-clean at P0–P2. The After screenshot below shows the new wording.

Review follow-up

Latest ClawSweeper review accepted the saved-state compatibility evidence and reports no actionable code findings. Revision 7 reviewed this exact head and accepted the native handoff proof: Ready for maintainer review, no actionable findings, and Before merge: None. Ordinary maintainer review is still required; the PR has not been merged.

  • Product direction: this is a maintainer-requested implementation for @VACInc, with the chosen browser-local opt-in approved in the linked work session. The linked issue tracks implementation, not an unresolved product proposal.
  • Saved-state compatibility: the persistence test now seeds an older settings blob with the existing browser-panel preference enabled and no external-link field. Enabling the new switch, reading the saved state again, and disabling it preserve both that preference and an unrelated sidebar-width setting; another Gateway keeps its default. All 29 persistence tests passed. The actual Chromium flow also passed with this older saved preference, including toggle → reload → external opening → toggle off → reader restored, without shared configuration writes. No migration is needed for this optional field.
  • Review receipts: test-audit confirmed that this extends the existing persistence contract rather than adding duplicate coverage. Deslop found no cleanup needed. Independent P0–P2 autoreview of the test-only follow-up was scoped-clean; focused tests, formatting, lint, and whitespace checks passed. That compatibility-only follow-up did not change production logic; the later copy-only revision is described above.

Native Mac proof — passed

Successful macOS run 36362385849 exercised the production DashboardWindowController and WKWebView in an isolated Swift test process. With the preference enabled, the real native link handler opened the link through the system-default browser, Safari. The loopback server received the matching unique URL from Safari; its process was running, no embedded browser tabs were created, and the desktop capture shows the external page. The native window and document were verified visible before the click.

The Gateway and page data were synthetic, and the DOM click was programmatic. The native bridge, NSWorkspace handoff, and Safari were real. This is native Mac-host proof, not a physical-device or packaged-app installation test. The runner reported macOS 26.6.2, and the browser reported Safari 26.6.2.

Actual Safari window after the native Mac link handoff

  • Exact-source binding: the workflow verified that production UI, native app sources, shared app sources, package manifest, and lockfile were unchanged from feature head 375ab9b. The separate proof branch is openclaw/native-link-proof-159887 at ff6a5f4; no proof harness or runner change is included in this PR.
  • Failure diagnosis: after repairing the fixture's AppKit event-loop setup, a precise Blacksmith diagnostic identified a locked runner screen and a hidden document. Changing only the runner from Blacksmith macOS to GitHub-hosted macos-26 let the same native test pass. Visibility checks, native-handler assertions, browser verification, and timeouts were not weakened. This diagnoses those failed runner sessions, not all Blacksmith offerings.
  • Scope and cost: one native Swift test passed in 28.812 s; the complete one-off Mac job took 17 min 2 s including checkout, setup, and build. Earlier failed native executions took 64.558 s, 64.625 s, 3.356 s, and 3.503 s. The isolated proof adds no recurring PR test cost. Test-audit retained distinct real-native boundary assertions with no production seams; deslop found no required cleanup; independent P0–P2 harness and diagnostic/lifecycle reviews were scoped-clean. The final change was only the runner label.
Changed-test costs

Measured separately with pnpm test <file> --maxWorkers=1; wall time includes runner startup. Tests use the existing fixtures, not new per-test processes or timers.

Test file Local wall time CI test execution
ui/src/app/link-reader-routing.test.ts 4.75 s 0.018 s
ui/src/app/settings.preferences.node.test.ts 10.43 s 0.126 s
ui/src/app/server-prefs.test.ts 5.39 s 0.318 s
ui/src/pages/config/settings-search.test.ts 2.24 s 0.499 s
ui/src/pages/config/view-link-preferences.browser.test.ts 2.25 s 0.018 s

CI values sum the reported test-case durations for current head 375ab9b, excluding import/setup overhead; they are not whole-job wall times. Sources: checks-ui (3/3) and checks-ui (1/3).

Before

Appearance Chat preferences before the new switch

After

Appearance Chat preferences with the approved shorter wording

Captures show the actual Control UI with synthetic data at 1280 × 900 in dark mode. The new switch is enabled in the After capture to demonstrate the opt-in; it defaults off.

Worked on by:

Work sessions


View the OpenClaw team session

Keep current link behavior by default and let each browser opt out of automatic readers and browser panels.

Co-authored-by: VACInc <[email protected]>
@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: S labels Sep 27, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 27, 2026 21:08
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 Sep 27, 2026
@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 9:27 PM ET / September 28, 2026, 01:27 UTC (Revision 8).

ClawSweeper review

What this changes

The branch adds a browser-local Control UI switch that sends eligible chat links to the regular browser instead of automatic plugin readers or in-app browser panels.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main lacks the requested preference, and the linked issue remains open. The branch is coherent and cleanly mergeable; this review found no introduced correctness blocker, and the browser and native behavior evidence supports the change.

Priority: P3
Reviewed head: 375ab9bc5a63e55e9639c7ee4a68e8bf24716880

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused patch has strong browser and native proof, saved-state coverage, and no actionable finding in this review.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The changed Control UI routers were exercised by the reported Chromium toggle-and-reload flow, and an exact-source-bound macOS proof job used the production WKWebView bridge and Safari, observing the target URL and no embedded tab. An older saved preference blob is covered through opt-in and opt-out, supporting compatibility without a migration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The changed Control UI routers were exercised by the reported Chromium toggle-and-reload flow, and an exact-source-bound macOS proof job used the production WKWebView bridge and Safari, observing the target URL and no embedded tab. An older saved preference blob is covered through opt-in and opt-out, supporting compatibility without a migration.
Evidence reviewed 10 items Introduced reader routing: The new preference check lets eligible clicks bypass automatic plugin-reader interception.
Introduced native and panel routing: The external preference exits before the in-app panel branch; the existing native link poster handles eligible primary clicks.
Local stored-state contract: Only an explicit true value is loaded or persisted, leaving older settings blobs and the default route unchanged.
Findings None None.
Security None None.

How this fits together

The Control UI receives links rendered in chat and chooses whether a plugin reader, an in-app panel, or the browser handles a click. A local preference feeds that choice, while the macOS host receives external-link requests through its WebKit bridge.

flowchart LR
  A[Chat web link] --> B[Control UI click routing]
  C[Browser-local preference] --> B
  B --> D{Open externally?}
  D -->|No| E[Plugin reader or in-app panel]
  D -->|Yes| F{Native host?}
  F -->|Yes| G[System browser]
  F -->|No| H[Browser navigation]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +60, Tests +103, Docs +14. Total +177 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 10 73 13 +60
Tests 5 106 3 +103
Docs 1 14 0 +14
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 16 193 16 +177

Review metrics

Metric Value Why it matters
Preference contract 1 new browser-local boolean; 0 Gateway config fields The opt-in stays on the device and does not change shared settings.
Net line growth production +60, tests +103, docs +14 The production growth covers the setting, its two existing routing paths, and UI wiring; focused tests cover routing and saved-state behavior.

Stored data model

Persistent data-model change detected: serialized state: ui/src/app/settings.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #159884
Summary: The open PR explicitly implements the linked open feature request.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep the default-off choice in the existing browser-local settings owner, preserve the earlier panel preference, and land the focused branch through normal maintainer review.

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

Not applicable as a defect reproduction: this PR adds an opt-in setting. Current-main source confirms the choice is absent.

Is this the best way to solve the issue?

Yes. Reusing the browser-local settings owner and checking the preference in the existing link routers is a narrow fit for the requested behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is an optional convenience preference with unchanged defaults and working per-link alternatives.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The changed Control UI routers were exercised by the reported Chromium toggle-and-reload flow, and an exact-source-bound macOS proof job used the production WKWebView bridge and Safari, observing the target URL and no embedded tab. An older saved preference blob is covered through opt-in and opt-out, supporting compatibility without a migration.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed Control UI routers were exercised by the reported Chromium toggle-and-reload flow, and an exact-source-bound macOS proof job used the production WKWebView bridge and Safari, observing the target URL and no embedded tab. An older saved preference blob is covered through opt-in and opt-out, supporting compatibility without a migration.

Evidence

What I checked:

Likely related people:

  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • VACInc: 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.

History

Review history (7 earlier review cycles)
  • reviewed 2026-09-27T21:16:11.270Z sha dbe87e8 :: blocked before merge. :: none
  • reviewed 2026-09-27T21:30:19.543Z sha 7cc1243 :: blocked before merge. :: none
  • reviewed 2026-09-27T21:44:49.555Z sha 7cc1243 :: blocked before merge. :: none
  • reviewed 2026-09-27T22:33:05.941Z sha 375ab9b :: blocked before merge. :: none
  • reviewed 2026-09-27T22:46:43.543Z sha 375ab9b :: blocked before merge. :: none
  • reviewed 2026-09-28T00:12:26.649Z sha 375ab9b :: blocked before merge. :: none
  • reviewed 2026-09-28T01:15:13.910Z sha 375ab9b :: needs maintainer review before merge. :: none

Seed a pre-change browser-local settings blob and verify the existing panel choice survives enabling, reloading, and disabling external links.

Co-authored-by: VACInc <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

The current head adds saved-state compatibility coverage: an older browser-local blob with the existing in-app browser preference enabled survives external opt-in, reload, and opt-out. The extended persistence suite (29 tests), lint, and independent review pass. The real Chromium flow also passed with that older saved preference; details and timings are in the PR body. Production code is unchanged from the initially green CI run.

The feature and browser-local/default-off approach were requested and approved by maintainer @VACInc in the linked work session; the issue now explicitly tracks that authorized implementation rather than a pending product proposal.

Actual native-app proof remains unavailable: no approved Mac test host is connected and the configured Mac-pool preflight denied access. The PR distinguishes the simulated bridge check and unchanged native-handler source inspection from actual native-app execution. Please reassess the updated compatibility and product-direction evidence while retaining any genuinely remaining proof gap.

@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Sep 27, 2026
Use the approved short label and explanation without changing link behavior or defaults.

Co-authored-by: VACInc <[email protected]>
@clawsweeper clawsweeper Bot removed the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Sep 28, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review please. The remaining native handoff evidence is now complete for unchanged PR head 375ab9b.

Native macOS test passed: production DashboardWindowController + WKWebView, real native bridge/NSWorkspace, and actual Safari. The loopback server observed the unique target URL with Safari's user agent, the browser process was running, and no embedded browser tabs were created. The visible native window/document check passed before the click. Desktop capture showing Safari.

Synthetic Gateway data and a programmatic DOM click; this is an isolated native Swift test host, not a packaged-app/physical-device claim. Workflow verifies production sources match this feature head. Blacksmith diagnostics identified a locked desktop; switching only the proof workflow runner to GitHub-hosted macos-26 passed with assertions and timeouts unchanged. No harness/CI changes added to this PR. Full scope, failure diagnosis, test costs, and evidence are now in the PR body. Feature CI remains green on this exact head.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Sep 28, 2026
@roboclaw-bot
roboclaw-bot merged commit cff990a into main Sep 28, 2026
160 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/personal-link-browser-preference branch September 28, 2026 01:43
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
Add a browser-local, per-Gateway preference to open eligible links outside OpenClaw. Keep the switch off by default so existing reader and browser-panel behavior stays unchanged. Preserve saved preferences and explicit link actions.

Validated with routing and persistence regressions, rendered settings tests, Chromium toggle/reload flows, exact-head CI, and a source-bound native Mac-to-Safari handoff.

Co-authored-by: VACInc <[email protected]>
@VACInc

VACInc commented Sep 28, 2026

Copy link
Copy Markdown
Member

PR #160410 has merged as a follow-up to this preference implementation. Browser-preview images and Open buttons now honor "Open links outside OpenClaw," and the overflow menu offers "Open in OpenClaw" when the preference is enabled, preserving access to the original managed tab.

This extends the existing preference to a previously uncovered consumer; it does not replace this PR's setting, persistence, or ordinary-link routing. This PR remains merged.

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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

[Feature]: Personal preference to open links in an external browser

2 participants