(MOT-4519) feat(console): preview screen renders agent HTML beside the chat - #863
(MOT-4519) feat(console): preview screen renders agent HTML beside the chat#863rohitg00 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
skill-check — worker0 verified, 62 skipped (no docs/).
Four for four. Nicely done. |
|
Superseded: preview: is the cheap version of a proper agent-artifact primitive (durable, addressable, shareable, versioned — like Claude Code artifacts). Closing in favor of that direction. |
Why
A workspace column shows
chat,traces,workers, orext:<worker-page>. There was no way for an agent to show its own HTML — a plan, a chart, a rendered diff — in the workspace. This is the most-cited use of the browser-in-terminal tools that motivated the workspace functions: write a page, open it beside the conversation.What
A
preview:<path>screen kind.console/src/functions/workspace.rs):is_valid_screenacceptspreview:<path>(non-empty), soconsole::workspace::open screen=preview:/path/to/plan.htmlplaces it beside chat like any screen and it persists in the layout. The function description names it.workspace-tabs.ts):previewPathForScreen/screenForPreview, validation, and a basename label.PreviewPane(pages/Preview): reads the file throughshell::fs::readand renders it in a sandboxed iframe (sandbox="", so page scripts never run and it cannot reach the console around it). HTML/SVG render as a document; other text renders as preformatted text. Nothing is stored in the polled console config — the path travels in the screen id and the bytes are read on demand, so history and previews never bloat the config the way inlined blobs would.Verification
cargo fmt --check,cargo clippy -D warnings,cargo test(console;screen_validationcoverspreview:<path>and rejects a barepreview:).tsc -b, biome, vitest 1472 (preview round-trip, label, and that a malformedpreview:tab is dropped).console::workspace::open screen=preview:/…/preview-demo.htmlreturnedplacement: new_column,console::workspace::listshows['chat', 'preview:/…/preview-demo.html'], and the column renders the agent's HTML in the sandboxed iframe.Stacked on #861 → #860 → #843. Merge those first.
Linear: MOT-4519