Skip to content

feat(ui): render live dashboard gallery previews - #138640

Merged
Patrick-Erichsen merged 4 commits into
mainfrom
codex/dashboard-live-previews
Sep 4, 2026
Merged

Patrick-Erichsen merged 4 commits into
mainfrom
codex/dashboard-live-previews

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • replace the hardcoded dashboard-card scaffold with the saved dashboard HTML rendered through the canonical board document
  • lazy-load previews near the viewport and pass the gallery session identity through without a redundant session lookup
  • make gallery rendering explicitly passive: render saved HTML, omit MCP Apps/plugins, disable the HTML capability bridge, and expose no mutation or grant controls
  • keep decorative iframe content inert inside the card link and preserve preview lifecycle across detach/reattach

Before / after

Before: dashboard cards used a fixed placeholder scaffold regardless of their saved content.

Hardcoded dashboard gallery preview

After: a real dashboard created on the disposable OCM gateway renders its actual saved HTML in the gallery.

Live OCM dashboard gallery preview

Validation

  • node scripts/run-vitest.mjs run ui/src/components/board/board-document.test.ts ui/src/components/board/board-view.test.ts ui/src/components/board/board-widget-cell-mcp-app.test.ts ui/src/components/board/board-widget-frame.test.ts ui/src/lib/board/widget-sandbox-host.test.ts ui/src/pages/dashboards/dashboard-preview.test.ts ui/src/pages/dashboards/dashboards-page.test.ts — 87 passed
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/dashboard-gallery.e2e.test.ts — passed
  • pnpm tsgo:ui
  • pnpm lint:ui:styles
  • pnpm ui:build
  • real OCM gateway at port 18951 with Gateway-created dashboard-gallery-live-sample

The browser regression includes visible saved HTML and a granted MCP App in the same dashboard. It verifies the HTML iframe body, confirms the MCP App is omitted, and records zero board.widget.appView requests while the gallery card is visible. The sandbox-host regression separately proves passive HTML is fetched and delivered while its capability port is closed and no Gateway bridge request occurs.

Review notes

  • Production delta: +242 / -259 (net -17); tests: +278 / -12.
  • The passive repair closes the ClawSweeper P1 at the board document owner boundary instead of disabling HTML loading: preview HTML stays live, but executable plugin/MCP surfaces and the private dashboard bridge never initialize.
  • Independent review findings around reconnect lifecycle, focus containment, redundant lookup, bounded loading, and passive authority were addressed.
  • Codex runtime is not part of this Control UI / Gateway board rendering path.

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

ClawSweeper review complete

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

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Sep 4, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 4, 2026, 6:10 PM ET / 22:10 UTC.

ClawSweeper review

What this changes

The PR replaces synthetic dashboard-card artwork with lazy near-viewport rendering of each saved dashboard’s real board content in the Control UI gallery.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 7 items remain

Keep this PR open: the prior P1 remains on the unchanged head. A near-viewport gallery card mounts an active board document, so a saved granted MCP App can obtain an app-view lease and create its sandbox bridge despite the decorative card being inert.

Priority: P1
Reviewed head: 0f3ae0fc47f7478e0dee66390f85afa815ccf7d0

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The gallery result is demonstrated for HTML, but the unchanged P1 capability-boundary defect prevents this patch from being merge-ready.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: Authority-chain proof required: the submitted OCM screenshots and HTML-only E2E fixture demonstrate rendered HTML, but do not show that a granted MCP App gallery card is prevented from requesting board.widget.appView, mcp.app.view, or creating its final bridge. After the passive repair, post a redacted after-fix trace for that forbidden path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🧂 unranked krab (1/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: Authority-chain proof required: the submitted OCM screenshots and HTML-only E2E fixture demonstrate rendered HTML, but do not show that a granted MCP App gallery card is prevented from requesting board.widget.appView, mcp.app.view, or creating its final bridge. After the passive repair, post a redacted after-fix trace for that forbidden path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 7 items Introduced active preview: The introduced gallery markup inserts the new preview component inside each card; that component mounts the canonical board document once near the viewport.
Active lifecycle remains enabled: The board document always passes active=true and MCP App callbacks into the board view; the gallery supplies this same document rather than a passive renderer.
Granted MCP App request path: An active MCP App widget observes its cell and runs its lifecycle; the Gateway provider then requests board.widget.appView for that widget.
Findings 1 actionable finding [P1] Keep gallery previews passive
Security Needs attention Gallery cards can initialize granted MCP App bridges: The introduced preview enters the ordinary active board path, which may request an MCP App view and initialize a sandbox/AppBridge merely because a card became near-visible.

How this fits together

The Control UI dashboard gallery receives saved dashboard sessions from the Gateway and links each card to its chat. This change feeds each nearby card into the board renderer, which normally loads widgets and their associated view lifecycles.

flowchart LR
  A[Saved dashboard sessions] --> B[Dashboard gallery]
  B --> C[Near viewport check]
  C --> D[Preview board renderer]
  D --> E[Widget lifecycle]
  E --> F[HTML preview or MCP App bridge]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: Authority-chain proof required: the submitted OCM screenshots and HTML-only E2E fixture demonstrate rendered HTML, but do not show that a granted MCP App gallery card is prevented from requesting board.widget.appView, mcp.app.view, or creating its final bridge. After the passive repair, post a redacted after-fix trace for that forbidden path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Keep gallery previews passive (P1) - This introduced card preview mounts openclaw-board-document, which always renders an active board. A nearby granted MCP App therefore reaches the existing app-view lifecycle and can create its sandbox bridge; inert only decorates the outer card and does not stop that lifecycle. Add a passive preview mode and cover a granted MCP App with assertions that no board.widget.appView or bridge setup occurs.
  • Resolve security concern: Gallery cards can initialize granted MCP App bridges - The introduced preview enters the ordinary active board path, which may request an MCP App view and initialize a sandbox/AppBridge merely because a card became near-visible.
  • Resolve merge risk (P1) - Merging as-is lets merely scrolling a dashboard gallery activate saved granted MCP Apps and allocate their app-view tickets, sandbox iframes, and bridges outside the user’s opened dashboard context.
  • Complete next step (P2) - Make gallery previews passive, add a granted-MCP-App regression proving no app-view request or bridge is created, and post redacted after-fix boundary proof.
  • Improve patch quality - Make the board/view/cell path explicitly passive for gallery previews and add a granted-MCP-App regression asserting no app-view request.
  • Improve patch quality - Post a redacted after-fix trace showing the near-viewport gallery card does not create an MCP App view or bridge.

Findings

  • [P1] Keep gallery previews passive — ui/src/pages/dashboards/view.ts:56-62
  • [high] Gallery cards can initialize granted MCP App bridges — ui/src/pages/dashboards/view.ts:56
Agent review details

Security

Needs attention: The diff introduces a concrete capability-boundary regression by mounting active MCP App content in decorative gallery cards.

PR surface

Source -43, Tests +134. Total +91 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 7 209 252 -43
Tests 4 145 11 +134
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 354 263 +91

Review metrics

Metric Value Why it matters
Production vs test delta production +209/-252 (net -43); tests +145/-11 (net +134) The feature is net-negative in production overall, but the new renderer crosses the existing MCP App capability boundary without matching negative-path coverage.

Merge-risk options

Maintainer options:

  1. Make gallery previews passive (recommended)
    Pass an explicit preview mode through the board renderer and assert that a near-viewport granted MCP App makes no app-view request or bridge.
  2. Pause live gallery rendering
    Keep the synthetic gallery scaffold until saved content can be rendered without activating MCP App capabilities.

Technical review

Best possible solution:

Add an explicit passive gallery-preview mode that can render safe saved HTML but never starts MCP App lifecycles, requests app views, or creates tool bridges; render non-HTML widgets as inert placeholders if needed.

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

Yes, from source: create a saved dashboard containing a granted MCP App, browse until its card is near the viewport, and observe the active lifecycle request board.widget.appView followed by mcp.app.view setup.

Is this the best way to solve the issue?

No. Reusing the fully active board document is not the best gallery renderer; a dedicated passive mode at the board/view lifecycle boundary avoids creating privileged app-view resources for a decorative card.

Full review comments:

  • [P1] Keep gallery previews passive — ui/src/pages/dashboards/view.ts:56-62
    This introduced card preview mounts openclaw-board-document, which always renders an active board. A nearby granted MCP App therefore reaches the existing app-view lifecycle and can create its sandbox bridge; inert only decorates the outer card and does not stop that lifecycle. Add a passive preview mode and cover a granted MCP App with assertions that no board.widget.appView or bridge setup occurs.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Authority-chain proof required: the submitted OCM screenshots and HTML-only E2E fixture demonstrate rendered HTML, but do not show that a granted MCP App gallery card is prevented from requesting board.widget.appView, mcp.app.view, or creating its final bridge. After the passive repair, post a redacted after-fix trace for that forbidden path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove status: ⏳ waiting on author: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P1: Scrolling the dashboard gallery can activate a granted application bridge for an unopened dashboard.
  • merge-risk: 🚨 security-boundary: The introduced preview mounts the active board and can obtain MCP App view tickets and bridges rather than remaining decorative.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Authority-chain proof required: the submitted OCM screenshots and HTML-only E2E fixture demonstrate rendered HTML, but do not show that a granted MCP App gallery card is prevented from requesting board.widget.appView, mcp.app.view, or creating its final bridge. After the passive repair, post a redacted after-fix trace for that forbidden path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Security concerns:

  • [high] Gallery cards can initialize granted MCP App bridges — ui/src/pages/dashboards/view.ts:56
    The introduced preview enters the ordinary active board path, which may request an MCP App view and initialize a sandbox/AppBridge merely because a card became near-visible.
    Confidence: 0.99

What I checked:

Likely related people:

  • Patrick-Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Shakker: 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 (1 earlier review cycle)
  • reviewed 2026-09-04T22:02:25.548Z sha 0f3ae0f :: blocked before merge. :: [P1] Prevent gallery previews from activating granted MCP Apps

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 4, 2026
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

Passive-boundary repair is now on exact head 96ca7831091.

Proof: the bundled gallery E2E renders the real saved HTML beside a granted MCP App fixture, asserts the MCP App is absent, and records zero board.widget.appView requests. The sandbox-host regression also confirms passive HTML delivery while closing the offered capability port and making zero Gateway bridge requests.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@Patrick-Erichsen
Patrick-Erichsen merged commit af54ce5 into main Sep 4, 2026
133 checks passed
@Patrick-Erichsen
Patrick-Erichsen deleted the codex/dashboard-live-previews branch September 4, 2026 22:38
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
* feat(ui): render live dashboard gallery previews

* fix(ui): bound dashboard gallery preview loading

* test(ui): narrow dashboard request payloads

* fix(ui): keep dashboard previews passive
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 maintainer Maintainer-authored PR merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant