Repository navigation
feat: render dashboard data reports without iframes - #139306
Conversation
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
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Land-ready at 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.tsThe 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. |
|
@clawsweeper review Please review the current head, |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 4:12 PM ET / 20:12 UTC. ClawSweeper reviewWhat this changesAdds 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 Review scores
Verification
How this fits togetherAgent 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +105, Tests +701, Docs +91, Other 0. Total +897 across 39 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
|
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 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. |
|
Follow-up performance verification of the native report path on f8b43dc795f2:
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. |
* 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


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:reportwidget rendered by the Control UI.show_widgetaccepts a structuredreportwithpin: true;dashboardcan create and update it through the existingwidget_putoperation. 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.
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 at844c146098d5a89993e17c22d94a6b37991945c8; the frozen bundle was built from the identical tree before its generated-manifest commit. Synthetic captures below were inspected.Validation:
env -u OPENCLAW_TESTBOX node scripts/check-changed.mjs --stagedpassed 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.node scripts/run-tsgo.mjs -p tsconfig.ui.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/ui.tsbuildinfoand focused type-aware progress/controller lint passed. Boot metadata was regenerated throughnode --import ./scripts/tsx.mjs scripts/control-ui-boot-manifest.mts; normal production Vite builds passed.widget_code.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.
CI follow-through: the first run found that combining this change with main grew
chat-pane-board.test.tstwo lines over its limit. Commitb940ec041a4bremoves 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.