Skip to content

(MOT-4519) feat(console): preview screen renders agent HTML beside the chat - #863

Closed
rohitg00 wants to merge 2 commits into
feat/console-hydration-gatefrom
feat/console-preview-screen
Closed

(MOT-4519) feat(console): preview screen renders agent HTML beside the chat#863
rohitg00 wants to merge 2 commits into
feat/console-hydration-gatefrom
feat/console-preview-screen

Conversation

@rohitg00

Copy link
Copy Markdown
Contributor

Why

A workspace column shows chat, traces, workers, or ext:<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.

  • Rust (console/src/functions/workspace.rs): is_valid_screen accepts preview:<path> (non-empty), so console::workspace::open screen=preview:/path/to/plan.html places it beside chat like any screen and it persists in the layout. The function description names it.
  • TS (workspace-tabs.ts): previewPathForScreen / screenForPreview, validation, and a basename label.
  • PreviewPane (pages/Preview): reads the file through shell::fs::read and 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_validation covers preview:<path> and rejects a bare preview:).
  • tsc -b, biome, vitest 1472 (preview round-trip, label, and that a malformed preview: tab is dropped).
  • Rig: built and installed. console::workspace::open screen=preview:/…/preview-demo.html returned placement: new_column, console::workspace::list shows ['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

@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview Aug 20, 2026 3:53pm
workers-tech-spec Ready Ready Preview Aug 20, 2026 3:53pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 036eac95-a29f-4027-8b72-b87305556070

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 62 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

@rohitg00

Copy link
Copy Markdown
Contributor Author

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.

@rohitg00 rohitg00 closed this Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant