HTML file preview in the Code Editor pane (rendered web view for .html, .htm, .xhtml)
Pre-submit Checks
- [x] I have searched Warp feature requests and there are no duplicates. Closest existing issues are #10259 (only the
<details>/<summary>tags inside markdown rendering), #10903 (syntax highlighting for.html, no rendering), #9729 (image preview in the Code Editor pane — same surface, different media), #8940 (SVG-only preview), and #11068 (LaTeX PDF preview). None cover rendering a standalone.htmlfile as a web page inside Warp's file preview. - [x] I have searched Warp docs and my feature is not there. The Markdown viewer (
docs.warp.dev/terminal/more-features/markdown-viewer) is the closest precedent for a non-text rendered view inside a Code Editor tab, but it only handles.md/.markdown.
Describe the solution you'd like?
When opening a .html, .htm, or .xhtml file from the File Tree (or via CMD/CTRL-click on a file link in a terminal block), open it in a Rendered HTML preview tab in the Code Editor instead of as a raw text editor tab. Behavior mirrors the existing Markdown viewer split:
View modes (pane overflow menu, same control surface as Markdown viewer)
- Rendered (default): displays the HTML as it would render in a browser, scoped to a sandboxed local view.
- Source: the existing raw text editor, with syntax highlighting (closes the gap in #10903).
- Split: source + rendered side-by-side, scroll-synced.
Rendering scope
- Relative URLs (
./style.css,img/logo.png,<script src="app.js">) resolve against the file's directory using afile://base, so most static prototypes render correctly with no project config. - Inline
<style>and external stylesheets render. <img>(includingsrcset),<svg>,<picture>,<video>,<audio>render.<iframe>tofile://siblings renders; cross-origin iframes follow the host webview's default policy.- JavaScript execution is opt-in per tab via a clearly labeled "Enable scripts" toggle in the toolbar (off by default), with the setting remembered per-file path.
- Auto-reload on file save (and on dependent-asset save within the same directory tree) is on by default; toggleable.
Toolbar
- View-mode switcher (Rendered / Source / Split).
- "Enable scripts" toggle (off by default, with a tooltip explaining the sandbox).
- Reload button + "Auto-reload" toggle.
- "Open in default browser" action (delegates to OS handler).
- Zoom in / out / reset (Cmd/Ctrl +
=/-/0). - Status footer: file path, document title (
<title>), byte size.
Out of scope (explicit non-goals for v1)
- A full project dev server (no
npm run devsubstitute, no live-reload websocket beyond file-save watching). - HTTPS / cross-origin proxying / cookie / credentialed-fetch support.
- Editing the rendered DOM in place; DevTools panel.
- Bookmarking, history, or multi-page navigation across non-sibling files.
- Remote URLs (
http://,https://) — this is a file preview surface, not a browser.
Is your feature request related to a problem?
Today, clicking a .html file in the File Tree opens it as a text editor tab; users have to either run an external HTTP server or right-click → Open with → browser to see the rendered output. This breaks flow in the exact moment Warp positions itself as an agentic development environment — e.g., an agent generates index.html + style.css + app.js and the user has to leave Warp to verify the result. The Markdown viewer already solved this for .md; HTML is the natural next media type because it is (a) the most common static-preview case after Markdown, (b) routinely produced by agents (prototype mocks, docs, reports, generated screenshots embedded in HTML), and (c) trivially scoped to file:// resolution without standing up a server.
Additional context
Rationale summary
- Closes the loop for agent-generated static prototypes without leaving the terminal.
- Consistent with Warp's existing precedent (Markdown viewer split, Image preview RFC #9729) of rendering non-text media inside Code Editor tabs.
- Unblocks the obvious follow-up: rendered HTML email previews, generated test reports, coverage reports, Storybook static exports, mdbook/Hugo/Jekyll built output, generated docs (rustdoc, javadoc, pdoc, sphinx HTML).
Acceptance criteria (testable invariants)
- Opening a
.html,.htm, or.xhtmlfile from the File Tree routes to the Rendered HTML preview tab by default, not the text editor. - Magic-byte sniff overrides the extension when content does not begin with HTML markup; non-HTML content falls back to the text editor with an informational banner.
- Relative
href/srcresolve against the source file's directory; sibling assets render without configuration. - The view-mode switcher offers Rendered / Source / Split; the choice persists per file path across tab close/reopen within the session.
- Scripts are disabled by default; the "Enable scripts" toggle is per tab, off by default, and its enabled state is persisted only for the current file path until Warp restart.
- Saving the source file (in Warp or externally) triggers a re-render within 250 ms when "Auto-reload" is on; the toggle reflects state immediately.
- The "Open in default browser" action launches the OS handler with the file's absolute
file://URL and does not block the Warp UI. - The preview is sandboxed: no network requests to non-
file://origins fire by default (verified with a manifest-of-requests fixture); enabling scripts does not bypass this default. - Closing the tab releases the renderer process / webview; opening 20 HTML previews in sequence does not leak memory above a reasonable per-tab budget (sketch: < 80 MB resident average per active preview, dropped on close).
- The Source mode applies the same syntax highlighter requested in #10903 (i.e., this feature subsumes that bug for the Code Editor pane, but does not block on it — Source mode can ship with the editor's current highlighting and improve later).
- First paint of the Rendered mode for a 200 KB document with 10 sibling assets completes within 500 ms on a cold cache.
- Keybindings follow the existing Code Editor / Markdown viewer conventions; no new global shortcuts introduced in v1.
Reuse and integration
- Tab system, drag-split-close, session restore: existing Code Editor tab controller.
- View-mode switcher in pane overflow: same control surface as the Markdown viewer.
- File-save watcher: existing File Tree watcher; do not instantiate a second one.
- Webview / renderer host: whichever surface the existing app uses for rich content (Markdown viewer, in-app browser surfaces if any). Avoid bundling a second engine.
Cross-platform notes
- macOS: WKWebView is the natural host.
- Linux: WebKitGTK or whichever surface the existing rich-content path uses; document any feature gaps (e.g., codec support) in the spec.
- Windows: WebView2.
- Where a host webview cannot meet the sandbox requirements above, that platform ships Source-only with a banner explaining the gap, rather than degrading the security posture.
Related issues
- #10903 (
.htmlsyntax highlighting — complementary, addresses Source mode) - #10259 (HTML tags inside markdown rendering — different surface)
- #9729 (Image preview in Code Editor pane — sibling proposal, same tab system)
- #8940 (SVG preview — sibling)
- #11068 (LaTeX → PDF preview — sibling)
Operating system (OS)
Cross-platform
How important is this feature to you?
3
@KiwiGaze
Here's what I found while triaging this issue:
Thanks for the detailed request. I confirmed this is currently a feature gap: Markdown has a rendered viewer path, while HTML files are routed to the Code Editor as source. Related requests such as #10903, #10259, #9729, #8940, and #11068 cover adjacent surfaces but not this standalone HTML preview workflow.
Maintainer details
I concluded that feature request for a rendered HTML preview mode in Code Editor tabs; current routing only special-cases Markdown for rendered preview and opens HTML as source..
Triage summary
This is a well-scoped enhancement request for rendering .html, .htm, and .xhtml files inside Warp's Code Editor/file-preview surface. The current implementation appears to support only Markdown as a rendered file-view special case; HTML files are treated as code/source files.
Current behavior / likely implementation area
app/src/util/openable_file_type.rsonly exposesMarkdown,Code, andTextas openable in-Warp file types, and only Markdown can resolve toFileTarget::MarkdownViewer.app/src/code/file_tree/view.rsandapp/src/workspace/view.rsroute File Tree opens to eitherMarkdownViewerorCodeEditor; there is no HTML preview target.crates/languages/src/lib.rsmapshtmlandhtmto the HTML language for editor support, which explains why HTML opens as source rather than as a rendered browser-like preview.- The existing Markdown rendered/raw toggle lives around
app/src/notebooks/file/mod.rs,app/src/code/view.rs, andapp/src/view_components/markdown_toggle_view.rs; an HTML preview would likely need a distinct rendered view and security/sandbox design rather than reusing the Markdown renderer directly.
Duplicate check
I searched all open non-PR issues in warpdotdev/warp. Related issues exist for adjacent surfaces — #10903 for HTML syntax highlighting/source mode, #10259 for HTML tags inside Markdown rendering, #9729 for image preview, #8940 for SVG preview, and #11068 for LaTeX/PDF preview — but none request standalone rendered HTML file preview in the Code Editor.
Recommendation
Keep this as an enhancement routed to Code Editor/File Tree owners. Because the proposal introduces new preview controls and a sandboxed web rendering surface, it likely needs design/security review or mocks before implementation.
This is my automated analysis and may be incorrect. A maintainer will verify the details.
Powered by Oz
This is a good idea. However, the prospect of shipping a complete HTML renderer has not been prioritized.
We will leave this open to gauge interest, but it is not ready to spec.
Got it, makes sense. Thank you for considering it.
+1, and here's a concrete use case that I think changes the priority math.
The Claude Code team just published a piece on using HTML as the default output format for agent work — "The unreasonable effectiveness of HTML". The argument: instead of emitting walls of Markdown, Claude Code writes self-contained .html artifacts — specs, plans, code reviews with annotated diffs, design catalogs, status reports — because HTML carries spatial structure (tables, SVG diagrams, tabs, collapsible sections, client-side filters) that Markdown flattens.
I've moved my workflow to exactly this: my product-vision docs and a feature catalog are now self-contained HTML files the agent writes straight into the repo, with search and filtering baked in. For this kind of artifact it's clearly better than Markdown.
The snag is precisely this issue: Warp renders Markdown but opens HTML as source. So the moment my agent output becomes HTML, Warp can no longer show it — I have to leave the terminal and open the file in a browser, which breaks the generate → review loop that makes the whole workflow worth it.
That's significant enough that it's currently the main thing pulling me off Warp. A rendered HTML preview — same rendered/raw toggle Markdown already has, sandboxed — would keep me here. Strong +1; this is the interest you said you were gauging.
I totally agree with the utility of rendering HTML in Warp. It's just that we would have to be extremely careful to integrate HTML rendering in Warp without adversely affecting performance and binary size.
We do hope to tackle this challenge, but it has not yet been prioritized.