Repository navigation
Optional OpenUI input for html_render #20049
Replies: 1 comment
|
Note Drafted by Claude Opus 5.5 (Hermes, running in T3 Code); reviewed and posted by @kvnloo. We prototyped this on a fork and measured generation time. The results support the proposal, with one difference in shape that is worth a maintainer decision. What we built (fork branch
Measured A/B. Same model (
Per case, OpenUI vs HTML median turn time: repo treemap 17 s vs 54 s, stacked area 22 s vs 41 s, 3×4 heatmap 23 s vs 44 s, disk treemap 21 s vs 63 s, 7×24 heatmap 21 s vs 60 s. About 17–19 s of every turn is shared time before the first text arrives, so the format difference is almost entirely output length. OpenUI pays for it on the input side: the catalog prompt adds about 4 KB. Inside T3. In 9 of 9 live turns in one thread, the board parsed and carried the exact supplied data, including a sparse heatmap, a 7×24 grid and nested paths. A pie-chart request, which the catalog doesn't support, came back as bars with a note saying so. Screenshots from the Android build: The shape question. This discussion proposes OpenUI as an alternative input to Not covered: iOS, and a full visual pass on web; the web side has typecheck and tests only. |

Uh oh!
There was an error while loading. Please reload this page.
Note
Drafted by Claude Opus 5.5 in Claude Code (via T3 Code); reviewed and posted by @Trevor-Compaytence.
Problem
Maintainers pointed LaTeX requests to
html_render, and HTML renders work well for rich content. This proposal keeps rich content on that path and adds a compact input format for the most common visuals: tables, stat tiles, status badges and simple charts.Today each of those is a full HTML page the agent writes from scratch. That has two costs:
Proposal
Let
html_renderandhtml_previewoptionally take OpenUI Lang instead ofhtml. OpenUI is an open, MIT-licensed format for model-written UI: the agent writes a few lines naming components, and the client draws them. An illustrative example, using a component library T3 would define:T3 would draw it with components themed by T3's own tokens.
In one invoice example in my own app, I measured 827 characters of OpenUI against 5,797 characters of generated HTML body, and the HTML also needed about 29 KB of CSS. Those are source sizes, not token counts. OpenUI's README claims up to 67% fewer tokens than JSON, which is a different comparison.
Smallest useful scope
openuiinput forhtml_renderandhtml_preview; HTML input stays as it is. The aim is to reuse the current frame, attachments and mobile path, which would need checking.OpenUI ships a React renderer (
@openuidev/react-lang) and a framework-agnostic parser (@openuidev/lang-core). Inlang-core, runtime telemetry is opt-in (OPENUI_RUNTIME_TELEMETRY_ENABLED=1), but the package also runs install-time telemetry by default unlessOPENUI_TELEMETRY_DISABLED=1orDO_NOT_TRACK=1is set. That would need a look before taking the dependency.Prior art
I added this to my own local assistant: a
```openuiblock in a reply draws from a fixed, display-only component list, and anything outside it falls back to source text. It took a small parser and renderer, checked against the spec's conformance fixtures. Most of the work went into limits (output budgets, positional data with gaps, streaming), not parsing. Happy to share what we learned.The ask
Would maintainers consider an optional OpenUI input for
html_renderandhtml_preview, limited to a fixed library of display-only components? I'd like a yes or no on direction before anyone builds it.All reactions