Skip to content

feat(dashboard): let widgets run granted actions and open links - #127315

Merged
hannesrudolph merged 9 commits into
openclaw:mainfrom
hannesrudolph:feat/dashboard-widget-actions
Aug 21, 2026
Merged

hannesrudolph merged 9 commits into
openclaw:mainfrom
hannesrudolph:feat/dashboard-widget-actions

Conversation

@hannesrudolph

@hannesrudolph hannesrudolph commented Aug 21, 2026 •

Copy link
Copy Markdown
Member

Closes #127314

What Problem This Solves

Dashboard widgets could read granted data and trigger cron jobs, but they could not invoke plugin-owned dashboard actions through the existing ticket-bound bridge. Rendered widget links also could not open normally in a new tab because popup permissions were missing across the composed outer and nested sandboxes, and widget code did not know the host Control UI base URL.

Why This Change Was Made

This adds openclaw.action.run(actionId, params?) on the widget host API and routes it through the existing ticket-bound board.action method. The host also supplies a canonical openclaw.host.controlUiBaseUrl.

User-clicked links are ordinary widget navigation rather than a granted capability. Popup composition is enabled for rendered none and granted HTML/plugin widget frames, while pending and rejected widgets retain their approval placeholders and stricter sandbox. Data, network, prompt, cron, and plugin-action authority remain governed by their existing ticket and grant checks.

User Impact

Dashboard widgets can provide working links to Control UI sessions or external records without navigating away from the dashboard. Plugin dashboards can also invoke their explicitly granted action verbs without direct Gateway calls or sandbox-origin inference.

Evidence

  • Focused tests: 112 passed across src/canvas/widget-tool.test.ts, src/gateway/mcp-app-sandbox-http.test.ts, ui/src/components/board/board-view.test.ts, ui/src/components/board/board-widget-frame.test.ts, ui/src/lib/board/widget-bridge.test.ts, and ui/src/lib/board/widget-sandbox-host.test.ts.
  • pnpm check:changed passed all runnable lanes, including formatting, lint, dead-code, i18n, import-cycle, dependency, and policy guards. This sparse worktree caused the repository guard to skip full core/UI typecheck shards whose tracked inputs are absent.
  • pnpm ui:build passed, including the production Control UI build and sidecar checks.
  • pnpm docs:list --headings passed and includes tools/show-widget.md and web/dashboard-architecture.md.
  • Integrated board coverage verifies the rendered-frame popup sandbox, pending/rejected no-frame boundary, and Control UI origin-plus-base-path handoff without test-only production exports or private-method access.

This PR was prepared with AI assistance. I reviewed the implementation and validation results.

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@hannesrudolph
hannesrudolph marked this pull request as ready for review August 21, 2026 17:43
@hannesrudolph
hannesrudolph requested a review from a team as a code owner August 21, 2026 17:43
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime docker Docker and sandbox tooling agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Aug 21, 2026
@hannesrudolph
hannesrudolph force-pushed the feat/dashboard-widget-actions branch from 829d66c to 0e0a46c Compare August 21, 2026 17:44
@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 4:33 PM ET / 20:33 UTC.

ClawSweeper review

What this changes

The PR lets dashboard widgets invoke explicitly granted plugin actions, receive the Control UI base URL, and open user-clicked links in a new tab.

Merge readiness

⚠️ Needs maintainer review before merge - 4 items remain

Keep this maintainer-authored PR open: the action bridge preserves Gateway-side ticket, grant, and parameter validation, but its sandbox relaxation touches a restricted security-owned path and needs listed-owner confirmation before merge.

Priority: P2
Reviewed head: d0e99edcf5f02bf81445b1433db6e2cc6e272838
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation is coherent and covered at owner boundaries, while the explicitly accepted non-public proof remains less directly observable than a sanitized dashboard run.
Proof confidence 🦐 gold shrimp (3/6) Override: A maintainer comment explicitly accepts the exact-head source, integrated-test, CI, and production-build evidence without public dashboard media because the exercised dashboard contains private operational data.
Patch quality 🐚 platinum hermit (4/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Overridden Override: A maintainer comment explicitly accepts the exact-head source, integrated-test, CI, and production-build evidence without public dashboard media because the exercised dashboard contains private operational data.
Evidence reviewed 7 items Ticket and grant enforcement: The existing Gateway action handler resolves the widget ticket, requires the exact granted capability, bounds parameters, and dispatches only registered action verbs.
Plugin action owner boundary: Registered action verbs are resolved from the active plugin registry and validate their declared parameter schema before invoking the plugin-owned Gateway handler.
Changed bridge path: The proposed wrapper exposes the action API only through the existing private bridge, and the UI controller maps it to board.action with the view ticket.
Findings None None.
Security Needs attention Confirm shared sandbox relaxation with its listed owner: The new popup escape tokens intentionally broaden what rendered widgets can open; this security-owned path needs explicit listed-owner confirmation before merge.

Live Verification

Command: node scripts/run-vitest.mjs ui/src/lib/board/widget-bridge.test.ts

Result: FAIL (partial) — step 2 expect_output 10 passed: expected terminal output was not visible within 30 seconds: "10 passed"

node scripts/run-vitest.mjs ui/src/lib/board/widget-bridge.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-127315-zldGyE/target$ node scripts/run-vitest.mjs ui/src/lib/board/widget-bridge.test.ts
[test] starting test/vitest/vitest.ui.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-127315-zldGyE/target

node scripts/run-vitest.mjs ui/src/lib/board/widget-bridge.test.ts
 ✓  ui  ui/src/lib/board/widget-bridge.test.ts (12 tests) 15ms

 Test Files  1 passed (1)
      Tests  12 passed (12)
   Start at  20:34:03
   Duration  1.47s (transform 507ms, setup 130ms, import 213ms, tests 15ms, environment 671ms)

[test] passed 1 Vitest shard in 1.96s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-127315-zldGyE/target$ node scripts/run-vitest.mjs ui/src/lib/board/widget-bridge.test.ts
[test] starting test/vitest/vitest.ui.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-127315-zldGyE/target

 ✓  ui  ui/src/lib/board/widget-bridge.test.ts (12 tests) 15ms

 Test Files  1 passed (1)
      Tests  12 passed (12)
   Start at  20:34:05
   Duration  1.04s (transform 168ms, setup 53ms, import 69ms, tests 15ms, environment 608ms)

[test] passed 1 Vitest shard in 1.49s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-127315-zldGyE/target$






















Assertions:

  • FAIL expect_output: 10 passed

How this fits together

Dashboard widgets run inside nested sandboxed frames and use a private ticket-bound bridge to reach the Gateway. The bridge forwards approved action requests while frame sandbox attributes control whether user navigation can leave the embedded widget.

flowchart LR
  Widget[Dashboard widget] --> Bridge[Private widget bridge]
  Bridge --> Ticket[View ticket]
  Ticket --> Grants[Gateway grant checks]
  Grants --> Action[Plugin action]
  Widget --> Link[User-clicked link]
  Link --> Sandbox[Composed sandbox policy]
  Sandbox --> Tab[New browser tab]
Loading

Decision needed

Question Recommendation
Does a listed @openclaw/openclaw-secops owner approve allowing user-clicked dashboard-widget popups to escape the shared sandbox? Record security-owner approval: Have a listed security owner confirm the exact popup-escape behavior, then proceed through normal exact-head checks.

Why: The author recorded the product decision, but CODEOWNERS marks the changed shared sandbox host as a restricted security path and the supplied review context does not identify listed-owner involvement.

Before merge

  • Resolve security concern: Confirm shared sandbox relaxation with its listed owner - The new popup escape tokens intentionally broaden what rendered widgets can open; this security-owned path needs explicit listed-owner confirmation before merge.
  • Resolve merge risk (P1) - Merging enables popup escape for rendered dashboard widgets; the product policy is documented in discussion, but listed security-owner involvement for the restricted shared sandbox path is not evidenced.
  • Complete next step (P2) - The remaining blocker is explicit restricted-path owner confirmation, not a mechanical repair.

Findings

  • [medium] Confirm shared sandbox relaxation with its listed owner — src/agents/sandbox-host.ts:239
Agent review details

Security

Needs attention: The action path preserves Gateway authorization, but the popup escape changes a restricted shared sandbox path without evidenced listed-owner review.

PR surface

Source +36, Tests +36, Docs +7. Total +79 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 7 43 7 +36
Tests 5 46 10 +36
Docs 2 13 6 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 102 23 +79

Review metrics

Metric Value Why it matters
Production versus test delta production +38/-6; tests/support +51/-11; docs +13/-6 The production growth implements a new ticket-bound widget capability and a sandbox-policy change; the tests cover bridge routing and rendered-frame composition.

Stored data model

Persistent data-model change detected: vector/embedding metadata: src/canvas/widget-tool.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #127314
Summary: This PR is the linked implementation candidate for the dashboard widget capability request.

Members:

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

Merge-risk options

Maintainer options:

  1. Record restricted-path approval (recommended)
    A listed security owner should explicitly approve the popup escape before merge because the shared sandbox host is security-owned.
  2. Pause the sandbox relaxation
    If that approval is unavailable, defer the popup-escape portion rather than broadening the shared sandbox by default.

Technical review

Best possible solution:

Retain the ticket-bound action bridge and popup behavior, then land after the restricted-path owner confirms the user-activated sandbox escape policy.

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

Not applicable; this is a new dashboard capability rather than a report of broken established behavior.

Is this the best way to solve the issue?

Yes, subject to restricted-path approval: routing through the existing ticket-bound board action API preserves the established grant and plugin ownership checks, unlike direct Gateway access.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded Control UI feature with a concrete human security-boundary review gate.
  • merge-risk: 🚨 security-boundary: The PR adds allow-popups and allow-popups-to-escape-sandbox to the shared nested-frame policy.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Override: A maintainer comment explicitly accepts the exact-head source, integrated-test, CI, and production-build evidence without public dashboard media because the exercised dashboard contains private operational data.

Evidence

Security concerns:

  • [medium] Confirm shared sandbox relaxation with its listed owner — src/agents/sandbox-host.ts:239
    The new popup escape tokens intentionally broaden what rendered widgets can open; this security-owned path needs explicit listed-owner confirmation before merge.
    Confidence: 0.94

What I checked:

  • Ticket and grant enforcement: The existing Gateway action handler resolves the widget ticket, requires the exact granted capability, bounds parameters, and dispatches only registered action verbs. (src/gateway/server-methods/board.ts:589, 3ea90bdcdb30)
  • Plugin action owner boundary: Registered action verbs are resolved from the active plugin registry and validate their declared parameter schema before invoking the plugin-owned Gateway handler. (src/gateway/board-host-tools.ts:94, 3ea90bdcdb30)
  • Changed bridge path: The proposed wrapper exposes the action API only through the existing private bridge, and the UI controller maps it to board.action with the view ticket. (src/canvas/wrap.ts:154, d0e99edcf5f0)
  • Current-main gap: Current main did not contain the PR-added widget action API, Control UI base URL handoff, or popup sandbox tokens in the affected client files, so the feature is not already implemented. (ui/src/lib/board/widget-bridge.ts, 3ea90bdcdb30)
  • Restricted security path: The popup escape relaxation changes the shared sandbox host, which CODEOWNERS routes to the security team. (.github/CODEOWNERS:47, d0e99edcf5f0)
  • Feature provenance: Dashboard capability and sandbox infrastructure appears to originate in the merged dashboard-capabilities commit, with later UI lifecycle work maintaining the same boundary. (src/agents/sandbox-host.ts:208, 154a49a78b05)

Likely related people:

  • steipete: Authored the merged dashboard-capabilities implementation and the recent UI refactor that owns the current Gateway and sandbox boundary. (role: dashboard capability feature owner and recent area contributor; confidence: high; commits: 154a49a78b05, f9b5693612ed; files: src/gateway/server-methods/board.ts, src/gateway/board-host-tools.ts, src/agents/sandbox-host.ts)
  • fuller-stack-dev: Authored the merged dashboard MCP App lifecycle repair that maintains the same board-frame lifecycle surface. (role: adjacent lifecycle contributor; confidence: medium; commits: 8c1ea03da099; files: ui/src/components/board/board-widget-frame.ts, ui/src/components/mcp-app-view.ts)
  • openclaw/openclaw-secops: CODEOWNERS explicitly assigns src/agents/sandbox-*.ts, including the changed shared sandbox host, to this team. (role: restricted-path owner; confidence: high; files: src/agents/sandbox-host.ts, .github/CODEOWNERS)

Rank-up moves

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

  • Obtain the listed security-owner confirmation for the shared sandbox relaxation.

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 (5 earlier review cycles)
  • reviewed 2026-08-21T17:51:30.738Z sha 0e0a46cb0eb465f7148f1cc7647238ca45ed5666 :: found issues before merge. :: [P1] Advertise the Control UI base URL to widget authors
  • reviewed 2026-08-21T18:47:28.603Z sha 0e0a46cb0eb465f7148f1cc7647238ca45ed5666 :: found issues before merge. :: [P1] Require an explicit navigation grant | [P1] Document the Control UI base URL
  • reviewed 2026-08-21T19:24:09.713Z sha 864bf0294e132c0b59f692f3978641c39206c890 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-21T19:46:57.358Z sha 6b30800 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-21T20:26:13.885Z sha d0e99ed :: found issues before merge. :: [P2] Provide real dashboard proof for the sandbox relaxation

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 21, 2026
@hannesrudolph hannesrudolph changed the title feat(dashboard): let granted widgets run actions and open links feat(dashboard): let widgets run granted actions and open links Aug 21, 2026
@hannesrudolph

Copy link
Copy Markdown
Member Author

Addressed the completed review feedback in 864bf0294e1:

  • Documented openclaw.host.controlUiBaseUrl in the model-facing tool description and public dashboard authoring docs, including its initialization timing and safe new-tab link guidance.
  • Classified the requested explicit navigation grant as not applicable after the maintainer product decision that user-clicked links are ordinary widget behavior, not a privileged capability. Rendered none and granted widget frames now compose popup support; pending and rejected approval placeholders remain strict.
  • Added coverage for all four grant states and the Control UI origin-plus-base-path handoff.

Validation: 73 focused tests passed, pnpm check:changed passed all runnable sparse-worktree lanes, pnpm build passed, and pnpm docs:list --headings passed. The final repair diff also completed a clean independent review.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 21, 2026
@hannesrudolph
hannesrudolph force-pushed the feat/dashboard-widget-actions branch from 864bf02 to 6b30800 Compare August 21, 2026 19:40
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Aug 21, 2026
@hannesrudolph

Copy link
Copy Markdown
Member Author

Maintainer policy decision for current head d0e99edcf5f: I explicitly approve user-clicked links as ordinary navigation for rendered none and granted dashboard widgets, including opening the destination in a sandbox-escaping new tab. Pending and rejected HTML/plugin widgets do not mount their content frame. No separate navigation grant is intended.

The implementation and coverage were simplified in d0e99edcf5f:

  • Rendered frames now use one constant popup-enabled sandbox; the only production caller already gates pending/rejected widgets before frame rendering.
  • The sandbox assertion is folded into the existing shared-sandbox board test.
  • The Control UI base-path assertion is folded into the existing bridge reconnect test.
  • Existing board tests retain direct proof that pending and rejected widgets mount no iframe.
  • The repair removes 69 net lines while preserving the behavior contract.

ClawSweeper's reported live-verification failure is a harness expect_output false negative: its captured terminal output shows board-widget-frame.test.ts passing 9/9 tests twice. The default Vitest reporter did not print the individual test title the wrapper was waiting for.

Validation on the current repair: 112 focused tests passed, pnpm check:changed passed all runnable sparse-worktree lanes, pnpm ui:build passed, and the independent final-diff review found no actionable issue.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 Aug 21, 2026
@hannesrudolph

Copy link
Copy Markdown
Member Author

Maintainer evidence decision for d0e99edcf5f: I explicitly accept the exact-head source, integrated test, CI, and production-build evidence without requiring a public dashboard screenshot or recording. The previously exercised installed dashboard contains private operational data and will not be attached.

This is an intentional acceptance of the remaining evidence gap, not a request for another code path. ClawSweeper's current review reports no action-bridge defect, Security: None, and identifies only the runtime-capture request. The current head has 112 focused tests passing across the Canvas, Gateway, board component, bridge, and sandbox-host paths; pnpm check:changed passed all runnable lanes; and pnpm ui:build passed. Pending and rejected no-frame behavior and rendered-frame popup composition are covered through the production board component boundary.

The earlier ClawSweeper live-verification output also shows board-widget-frame.test.ts passing 9/9 twice; its wrapper failed only because the default reporter did not print the individual test title expected by expect_output.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 21, 2026
@hannesrudolph

Copy link
Copy Markdown
Member Author

Maintainer runtime verification for exact head d0e99edcf5f02bf81445b1433db6e2cc6e272838: I tested the current build in the running Control UI dashboard and activated a widget link. The destination opened successfully in a separate popout/new tab as intended instead of navigating the dashboard frame.

This directly verifies the rendered-widget popup composition in the real application. A screenshot is not attached because the tested dashboard contains private operational data.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@hannesrudolph
hannesrudolph merged commit 5b67b61 into openclaw:main Aug 21, 2026
485 of 487 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 22, 2026
steipete added a commit that referenced this pull request Aug 23, 2026
… popups (#128125)

* fix(dashboard): open widget links through the host instead of sandbox popups

Widget frames granted allow-popups/allow-popups-to-escape-sandbox to every
rendered widget, including grantState "none" widgets that never reach an
operator approval card. CSP has no navigate-to, so a popup bypassed the
connect-src 'none' containment those widgets otherwise run under. Scripted
window.open was blocked only by the document guard's open lock, which is
emitted solely when blockDescendantFrames is set, so two unrelated knobs had
to agree for the boundary to hold.

Restore both sandbox strings and route user-clicked links through the existing
ticket-bound bridge: a trusted click on a ticketed board widget's http(s)
target="_blank" anchor forwards to the Control UI, which opens the tab with
noopener,noreferrer. Links keep working for every rendered widget, the host
owns the scheme filter instead of trusting widget-authored rel attributes, and
scripted popups are impossible by construction rather than by coincidence.

Also collapses the unreachable controlUiBaseUrl branch and corrects both docs
pages, including the claim that links opened for every rendered widget, which
was never true for MCP-App board widgets.

Follow-up to #127315; refs #127314.

* fix(dashboard): open widget links through the Control UI external-url owner

The widget bridge opened links with a local window.open helper, which the
lint:ui:no-raw-window-open boundary guard rejects. Delegate to
openExternalUrlSafe(), the Control UI owner for external navigation: it
applies noopener/noreferrer, detaches the opener handle, and keeps one
canonical open path. The bridge keeps a narrower absolute-http(s) gate,
since widget-supplied links must not reach blob: URLs that the shared
external-link policy permits.

* fix(dashboard): route middle-button widget links and honor canceled clicks

Address ClawSweeper review on #128125.

The wrapper only handled primary click, so with popup permission removed from
both sandbox layers a middle-button activation silently did nothing. It also
listened on capture, so a widget handler's preventDefault could not cancel the
link the wrapper then opened itself.

Match the Control UI activation contract in ui/src/app/native-link-routing.ts:
listen for click and auxclick, gate on !defaultPrevented && !shiftKey &&
!altKey && (click+button 0 || auxclick+button 1), and listen on bubble so
widget cancellation stays effective. A middle click now routes for any widget
link, not just target=_blank, since middle-click always means new tab and
leaving plain links unrouted would keep the same silent-no-op class.

Move the wrapped-document test into src/canvas/wrap.test.ts: it exercises
buildWidgetDocument, so it belongs with its owner, and the added assertions
would otherwise push widget-tool.test.ts past the max-lines cap that AGENTS.md
forbids suppressing.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 24, 2026
… popups (openclaw#128125)

* fix(dashboard): open widget links through the host instead of sandbox popups

Widget frames granted allow-popups/allow-popups-to-escape-sandbox to every
rendered widget, including grantState "none" widgets that never reach an
operator approval card. CSP has no navigate-to, so a popup bypassed the
connect-src 'none' containment those widgets otherwise run under. Scripted
window.open was blocked only by the document guard's open lock, which is
emitted solely when blockDescendantFrames is set, so two unrelated knobs had
to agree for the boundary to hold.

Restore both sandbox strings and route user-clicked links through the existing
ticket-bound bridge: a trusted click on a ticketed board widget's http(s)
target="_blank" anchor forwards to the Control UI, which opens the tab with
noopener,noreferrer. Links keep working for every rendered widget, the host
owns the scheme filter instead of trusting widget-authored rel attributes, and
scripted popups are impossible by construction rather than by coincidence.

Also collapses the unreachable controlUiBaseUrl branch and corrects both docs
pages, including the claim that links opened for every rendered widget, which
was never true for MCP-App board widgets.

Follow-up to openclaw#127315; refs openclaw#127314.

* fix(dashboard): open widget links through the Control UI external-url owner

The widget bridge opened links with a local window.open helper, which the
lint:ui:no-raw-window-open boundary guard rejects. Delegate to
openExternalUrlSafe(), the Control UI owner for external navigation: it
applies noopener/noreferrer, detaches the opener handle, and keeps one
canonical open path. The bridge keeps a narrower absolute-http(s) gate,
since widget-supplied links must not reach blob: URLs that the shared
external-link policy permits.

* fix(dashboard): route middle-button widget links and honor canceled clicks

Address ClawSweeper review on openclaw#128125.

The wrapper only handled primary click, so with popup permission removed from
both sandbox layers a middle-button activation silently did nothing. It also
listened on capture, so a widget handler's preventDefault could not cancel the
link the wrapper then opened itself.

Match the Control UI activation contract in ui/src/app/native-link-routing.ts:
listen for click and auxclick, gate on !defaultPrevented && !shiftKey &&
!altKey && (click+button 0 || auxclick+button 1), and listen on bubble so
widget cancellation stays effective. A middle click now routes for any widget
link, not just target=_blank, since middle-click always means new tab and
leaving plain links unrouted would keep the same silent-no-op class.

Move the wrapped-document test into src/canvas/wrap.test.ts: it exercises
buildWidgetDocument, so it belongs with its owner, and the added assertions
would otherwise push widget-tool.test.ts past the max-lines cap that AGENTS.md
forbids suppressing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docker Docker and sandbox tooling docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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.

[Feature]: Allow granted dashboard widgets to run actions and open links

1 participant