[Feature]: Render HTML files in the web file preview #6846
tastelessjolt
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Area
apps/web
Problem or use case
Opening an HTML file from the workspace file viewer shows its source. The action that opens previewable files in the integrated browser is only available in the desktop runtime, so users of the served web app cannot see the rendered result from the file panel.
Proposed solution
For HTML files, offer a Rendered view alongside the existing Source view. Render the document in a sandboxed iframe without same-origin access. The source view should remain available for inspection and editing workflows.
A first implementation could use srcdoc for self-contained HTML documents. Broader support for referenced workspace assets can be considered separately if it requires URL rewriting or additional server behavior.
Why this matters
Users frequently ask agents to produce small HTML artifacts, reports, and prototypes. Seeing the rendered output directly in the file viewer would make those outputs useful on the web surface without requiring the Electron-only browser preview.
Smallest useful scope
Support .html and .htm files in the web file panel with:
Alternatives considered
Risks or tradeoffs
HTML may contain scripts or expensive content, so iframe sandboxing and lifecycle cleanup are important. CSP behavior, iframe navigation, large documents, and whether scripts should be enabled need an explicit decision. Supporting relative assets later may require signed URLs or safe URL rewriting.
Examples or references
Contribution
All reactions