Skip to content

feat: render dashboard data reports without iframes - #139306

Merged
steipete merged 3 commits into
mainfrom
codex/native-report-renderer
Sep 5, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/native-report-renderer

Conversation

@steipete

@steipete steipete commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #139263

What Problem This Solves

Dashboard data reports currently require an HTML document and sandboxed frames. Agents are guided toward HTML even when a report only needs text, metrics, a table, a chart, and links. This adds document loading and bridge initialization to passive content and replaces documents when report data changes.

Follow-up to #138860 (dashboard session lookup) and #139055 (duplicate dashboard resolution and history requests).

Why This Change Was Made

Add a bounded, data-only session:report widget rendered by the Control UI. show_widget accepts a structured report with pin: true; dashboard can create and update it through the existing widget_put operation. Both authoring descriptions recommend native reports for suitable data. The same validator protects writes and rendering, while fixed Lit components own markup, styling, and HTTP(S) link navigation.

Reuse the existing lazy custom-element and session-progress controllers. Move the old mock dashboard provider and operations into test helpers, delete the runtime mock query switch and placeholder, and remove unused translations. Production TypeScript/CSS decreases by 62 lines (+611/-673); tests and test support increase by 860, docs by 91, and generated boot metadata by 8. The production-to-test fixture move is counted across those categories. Including generated metadata, production remains net -54 lines.

User Impact

Agents can publish and refresh dashboard reports without an iframe, script, grant prompt, or inline preview. Reports support text, metrics, tables, bar/line charts, and links, within the existing 8 KiB props limit. Existing HTML, registered source kinds (including a plugin source named report), MCP apps, and live progress widgets retain their rendering and authority boundaries. Existing saved HTML reports are not automatically converted.

The assertion-safety baseline shrinks by one because the dashboard tool now reuses the shared record validator. No new dependency, configuration option, database schema, migration, or Gateway protocol version. This PR does not deploy a server.

Evidence

The refreshed local comparison is mixed; it does not establish a general first-load speedup. Native consistently removes two iframe contexts and updates saved report data without loading another document. The common application startup path remains substantial.

Median, seven measured pairs per viewport HTML Native
Desktop navigation to content ready 1,668 ms 1,634 ms
Mobile viewport navigation to content ready 1,599 ms 1,805 ms
Desktop board reply to content ready 525 ms 516 ms
Mobile viewport board reply to content ready 521 ms 355 ms
Iframe contexts, every measured load 2 0

Paired board-stage savings: desktop median 6 ms, native faster in 4/7 pairs; mobile median 175 ms, native faster in 6/7. Total mobile navigation was slower in 6/7 pairs. Both renderers require two renderer-specific resources, so this is not a fewer-requests claim. Do not use the earlier, more favorable pre-rebase timing batch as the final result.

Method: 32 loads total, fresh Chromium contexts, one excluded warmup pair plus seven alternating HTML/native pairs for each desktop/mobile viewport, identical five-block data and fixed 12x12 widget dimensions. The production bundle uses real local SQLite (2,000 sessions), session resolution/list handlers, SqliteBoardStore, board.get, ticketed HTML HTTP, and the real sandbox host. WebSocket transport and unrelated boot RPCs are mocked; no provider or production server is involved. All content, table/chart, link-popup, frame-count, and browser-error assertions passed. Source identity stayed unchanged at 844c146098d5a89993e17c22d94a6b37991945c8; the frozen bundle was built from the identical tree before its generated-manifest commit. Synthetic captures below were inspected.

Validation:

  • Full env -u OPENCLAW_TESTBOX node scripts/check-changed.mjs --staged passed before rebase: core/UI and all 16 test type graphs, broad core/script lint, styles, export scans, ratchets, i18n, storage and architecture guards. The first attempt caught the required assertion-baseline shrink; it was fixed and the complete gate rerun successfully.
  • After rebase: 177 focused UI cases across 12 files passed, then five production-bundle E2E cases for native report desktop/mobile and progress desktop/mobile/bare-route. Report updates preserve the element and load no additional document; Details opens safely. Progress retains cached content on transient failure, retries, and hides denied content.
  • Post-rebase node scripts/run-tsgo.mjs -p tsconfig.ui.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/ui.tsbuildinfo and focused type-aware progress/controller lint passed. Boot metadata was regenerated through node --import ./scripts/tsx.mjs scripts/control-ui-boot-manifest.mts; normal production Vite builds passed.
  • Focused authoring/store, core advertisement, native UI, provider lifecycle, gallery, and progress suites passed before rebase. Report and mixed-input validation rejects before persistence; HTML/registered composition failures remain before writes. The pre-feature baseline rejects the native report call without widget_code.
  • Three-page MDX, formatting and i18n checks passed. Independent Codex autoreview on the full refreshed candidate is clean through P2.

The rebase preserves main's updated progress error behavior. Its sole conflict was the controller error accessor: main had removed it as unused; this feature gives it a real widget consumer.

Follow-ups: profile the common dashboard startup path separately; investigate the legacy capless iframe path after proving its raw-mutation-snapshot/view-metadata transition. This feature preserves that existing boundary.

Desktop HTML report before native rendering

Desktop native data report

Mobile HTML report before native rendering

Mobile native data report

CI follow-through: the first run found that combining this change with main grew chat-pane-board.test.ts two lines over its limit. Commit b940ec041a4b removes the obsolete one-use mock-URL wrapper and redundant setup; it changes no production code or test assertions. All 40 cases in that file and explicit-root type-aware lint pass, and its independent review is clean through P2. The measured production tree remains unchanged.

Expose bounded native report data through show_widget and dashboard authoring. Reuse the shared widget loader and progress owner, and move mock dashboard fixtures out of production.

Closes #139263
@clawsweeper

clawsweeper Bot commented Sep 5, 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 gateway Gateway runtime agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Sep 5, 2026
@steipete
steipete marked this pull request as ready for review September 5, 2026 19:08
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready at b940ec041a4b9409f0f75b5d475b314fe12ce0c8: CI33986896822 completed successfully. Native review artifacts validate and independent Codex review is clean through P2.

The report contract and fixed Control UI renderer reuse existing board storage. Mock runtime code and duplicate widget/progress lifecycle code are removed. Production TS/CSS is -62 lines, or -54 including generated metadata. Existing HTML/registered/MCP behavior remains; no schema/configuration migration or automatic HTML conversion.

Local proof includes the full pre-rebase changed gate, 177 refreshed focused UI cases, five production-browser cases, and 32 final real-store/HTTP/sandbox comparison loads. The CI correction removes obsolete test setup only: all40 affected cases and explicit-root type-aware lint pass; production is unchanged from the measured commit.

Exact local commands included:

env -u OPENCLAW_TESTBOX node scripts/check-changed.mjs --staged
node scripts/run-vitest.mjs --config ui/vitest.config.ts ui/src/pages/chat/chat-pane-board.test.ts
node scripts/run-tsgo.mjs -p tsconfig.ui.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/ui.tsbuildinfo
node scripts/run-oxlint.mjs --config .oxlintrc.json --tsconfig config/tsconfig/oxlint.core.json --disable-nested-config --threads=1 ui/src/pages/chat/chat-pane-board.test.ts

The inspected before/after captures and detailed measurements are in the PR body. The refreshed timings are mixed: native eliminates both iframe contexts and updates in place, but this does not establish a general first-load speedup. The local transport/bootstrap mocks and absence of a production deployment are explicitly recorded.

@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

Please review the current head, b940ec041a4b9409f0f75b5d475b314fe12ce0c8. The native merge gate requires a completed review; the PR currently has only the initial acknowledgment. CI is green, and the PR body contains inspected browser proof, the production LOC breakdown, and the mixed performance results without a general speedup claim.

@clawsweeper

clawsweeper Bot commented Sep 5, 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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 4:12 PM ET / 20:12 UTC.

ClawSweeper review

What this changes

Adds structured dashboard reports rendered directly in the Control UI, reuses existing widget lifecycle controllers, and moves mock dashboard fixtures out of production.

Merge readiness

✅ Ready for maintainer review

This remains a useful implementation candidate for the linked feature request. No blocking introduced defect was found; current main lacks the native report renderer, and the related merged dashboard optimizations do not supersede it.

Priority: P2
Reviewed head: b940ec041a4b9409f0f75b5d475b314fe12ce0c8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent, bounded feature with useful production-browser evidence and no supported blocking correctness finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured production-browser measurements exercise native report rendering through real board storage and handlers, reporting zero iframe contexts and document-free updates; inspected E2E source covers retained elements and safe link navigation. Transport/bootstrap mocks are disclosed, and screenshot appearance could not be independently inspected.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured production-browser measurements exercise native report rendering through real board storage and handlers, reporting zero iframe contexts and document-free updates; inspected E2E source covers retained elements and safe link navigation. Transport/bootstrap mocks are disclosed, and screenshot appearance could not be independently inspected.
Evidence reviewed 8 items Pinned change ownership: Reviewed the introduced delta from ac53dc9 to the pinned head. The final commit changes only chat-pane-board.test.ts, preserving the production tree used for the reported measurements. The supplied stale test merge was not used to infer removals from main.
Bounded native rendering: The shared validator rejects unknown fields, restricts links to HTTP(S), and bounds report size and block contents. The renderer uses fixed Lit templates, escaped data, and links with noopener noreferrer; saved data cannot select a custom-element tag or executable action.
Existing persistence and authority boundaries: Both authoring paths reach board.widget.put. Its existing request authority check precedes the synchronous store write; report validation runs before widget rows are updated. Existing content-owner checks reject implicit conversion of saved HTML or registered-source widgets. No new schema, credential, capability ticket, or authorization-bearing value is introduced.
Findings None None.
Security None None.

How this fits together

Agent tools write named widgets into a session’s board store, and the Control UI renders board snapshots. This change lets bounded report data render as native components while executable documents retain their existing sandbox.

flowchart LR
 A[Agent authoring tools] --> B[Report validation]
 B --> C[Existing session board store]
 C --> D[Board snapshot]
 D --> E{Content type}
 E --> F[Native report components]
 E --> G[Sandboxed executable document]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +105, Tests +701, Docs +91, Other 0. Total +897 across 39 files.

View PR surface stats
Area Files Added Removed Net
Source 19 621 516 +105
Tests 16 937 236 +701
Docs 3 118 27 +91
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 39 1677 780 +897

Review metrics

Metric Value Why it matters
Report authoring contract 1 optional report argument; 5 block types; 24 blocks within the existing 8 KiB budget The new capability is bounded and reuses the existing widget-write operation without a configuration option or protocol method.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #139263
Summary: This PR implements the linked native-report request; the earlier dashboard optimizations concern distinct loading work.

Members:

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

Technical review

Best possible solution:

Keep passive reports on the bounded native renderer and existing board storage, while retaining sandboxed HTML and registered sources for interactive content.

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

Not applicable as a bug reproduction: this adds a requested capability. Current-main source confirms that generic native reports are absent.

Is this the best way to solve the issue?

Yes. A fixed data renderer fits passive reports more narrowly than expanding an executable rendering surface; existing HTML and registered A2UI paths still require document frames.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e8fbf33b32be.

Labels

Label changes:

  • add P2: This is a bounded dashboard capability improvement with no demonstrated urgent regression.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured production-browser measurements exercise native report rendering through real board storage and handlers, reporting zero iframe contexts and document-free updates; inspected E2E source covers retained elements and safe link navigation. Transport/bootstrap mocks are disclosed, and screenshot appearance could not be independently inspected.
  • 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 (live_output): The captured production-browser measurements exercise native report rendering through real board storage and handlers, reporting zero iframe contexts and document-free updates; inspected E2E source covers retained elements and safe link navigation. Transport/bootstrap mocks are disclosed, and screenshot appearance could not be independently inspected.

Label justifications:

  • P2: This is a bounded dashboard capability improvement with 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 (live_output): The captured production-browser measurements exercise native report rendering through real board storage and handlers, reporting zero iframe contexts and document-free updates; inspected E2E source covers retained elements and safe link navigation. Transport/bootstrap mocks are disclosed, and screenshot appearance could not be independently inspected.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured production-browser measurements exercise native report rendering through real board storage and handlers, reporting zero iframe contexts and document-free updates; inspected E2E source covers retained elements and safe link navigation. Transport/bootstrap mocks are disclosed, and screenshot appearance could not be independently inspected.

Evidence

What I checked:

  • Pinned change ownership: Reviewed the introduced delta from ac53dc9 to the pinned head. The final commit changes only chat-pane-board.test.ts, preserving the production tree used for the reported measurements. The supplied stale test merge was not used to infer removals from main. (ui/src/pages/chat/chat-pane-board.test.ts, b940ec041a4b)
  • Bounded native rendering: The shared validator rejects unknown fields, restricts links to HTTP(S), and bounds report size and block contents. The renderer uses fixed Lit templates, escaped data, and links with noopener noreferrer; saved data cannot select a custom-element tag or executable action. (src/boards/board-report.ts:73, b940ec041a4b)
  • Existing persistence and authority boundaries: Both authoring paths reach board.widget.put. Its existing request authority check precedes the synchronous store write; report validation runs before widget rows are updated. Existing content-owner checks reject implicit conversion of saved HTML or registered-source widgets. No new schema, credential, capability ticket, or authorization-bearing value is introduced. (src/boards/board-store.ts:201, b940ec041a4b)
  • Compatibility and regression coverage: Inspected tests cover report creation, update and database reopen, invalid-input rejection without mutation, registered source kinds named report, escaped rendering, finite chart geometry, and in-place browser updates. The existing progress store remains the lifecycle owner, and passive previews admit only the explicitly marked core report renderer alongside existing HTML. (src/canvas/widget-tool.report.test.ts:78, b940ec041a4b)
  • Current-main necessity and release check: At the supplied fetched main revision, the native widget registry contains session:progress but no session:report renderer. The new board-report.ts path is also absent from v2026.9.2. The supplied related merged PRs address session lookup and redundant dashboard requests, not native report rendering. (ui/src/lib/board/widgets/index.ts:27, e8fbf33b32be)
  • Reported production-browser evidence: The captured PR body and feat: render dashboard data reports without iframes #139306 (comment) report 32 comparison loads using the production browser bundle, real SQLite, board handlers, ticketed HTTP and sandbox hosting, with mocked WebSocket/bootstrap traffic. Native reports used zero iframe contexts and updated without another document load. Timings are explicitly mixed. The screenshot attachment fetches failed in this review environment, so their appearance was not independently inspected; no target tests or scripts were executed. (ui/src/e2e/native-report-widget.e2e.test.ts:92, 844c146098d5)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: 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 e90a3ba into main Sep 5, 2026
194 checks passed
@steipete
steipete deleted the codex/native-report-renderer branch September 5, 2026 20:30
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged as e90a3baabc14 through the native workflow. Exact-head CI 33986896822 and the completed ClawSweeper review passed; the merge receipt is retained.

LOC accounting clarification: the automated Source +105 table treats the 159-line move from runtime mock-ops.ts into test support as neutral. Those lines are no longer shipped in the production import graph. Reclassifying that move yields -54 production lines including generated metadata, or -62 TS/CSS lines, as detailed in the PR body.

The native report capability and in-place updates are verified. The refreshed first-load timings remain mixed; no general speedup or production deployment is claimed.

Operational follow-up: the batch review publisher in run 33987209223 hit its 12-minute comment-sync budget after processing 18 of 61 selected items (17 synced), before reaching this PR. The dedicated exact-review queue completed publication and satisfied the merge gate.

@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up performance verification of the native report path on f8b43dc795f2:

Viewport Native paint median Native slowest HTML composed-frame bound median
Desktop, 1440×1000 536 ms 596 ms 626.4 ms
Mobile-sized, 390×844 536 ms 600 ms 612.9 ms

Seven measured loads per format and viewport, alternating formats after predeclared warmups. Every measured native load was below one second. All 28 measured cases passed complete report-content checks and actual trusted Details-link activation. Native also passed its two warmups at 688/664 ms.

This used a real isolated Gateway, normal authentication and HTTP/WebSocket traffic, shipped Brotli assets, fresh browser contexts, 2,000 synthetic sessions, and identical five-block reports in the ordinary split layout. The Linux Testbox workflow reported four AMD EPYC logical CPUs; Chromium was 151.0.7922.34, without explicit browser CPU/network throttling. Native timing uses browser Element Timing for the visible title and three metric values, with complete-DOM and visibility gates. HTML timing is explicitly an upper bound. This is loopback proof, not live-site or physical-phone verification.

The overall run intentionally remains nonzero: one predeclared desktop HTML warmup had complete DOM but no inner paint entries and was retained as a telemetry failure. There were 31 successful cases and that one failure; it was not reclassified as a pass. Earlier mobile HTML interaction failures were traced to pointerdown landing on the outer iframe without an inner anchor click. Post-paint scroll/hover verification and a normal trusted click without further scrolling resolved that input-delivery problem in every final measured case; sandbox restrictions were unchanged.

The previous polling-based ready detector was not a reliable paint clock—for example, one calibration painted native content at 676 ms but was detected at 1,079.5 ms. Hardware, transport and layout also differ, so these numbers are not presented as a runtime speedup ratio against the earlier harness.

No additional application patch was needed. This PR remains merged, with the verified overall production delta of −54 lines. Attached captures were inspected and contain synthetic data only.

Native report in the ordinary desktop dashboard

Native report at mobile viewport size

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
* feat: render dashboard reports without iframes

Expose bounded native report data through show_widget and dashboard authoring. Reuse the shared widget loader and progress owner, and move mock dashboard fixtures out of production.

Closes openclaw#139263

* chore(ui): refresh generated boot module inventory

* test: remove obsolete board mock URL setup
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 docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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.

[Feature]: Native data reports for dashboards

1 participant