File preview
Click a file in the workspace tree to open a read-only preview in the right pane (format-dependent).
Supported previews
| Type | Behavior |
|---|---|
| Code & Markdown | Styled text view |
| HTML / HTM | Opens the visual preview tab by default (source tab still available); relative CSS/images/scripts rewritten to bounded data: URLs; optional Allow scripts (sandbox without allow-same-origin) |
| Images | Inline display |
| CSV | Tabular view |
| Office & PDF | Extracted text preview (DOCX, XLSX, PPTX, PDF) |
| Mermaid | Rendered diagrams when detected |
| Binary | Hex snippet for unknown formats |
Office files can also open in the system default app from the workspace UI.
vs Built-in Browser
| File preview (this page) | Built-in Browser | |
|---|---|---|
| Target | Static / semi-static workspace files | Any URL / localhost SPA |
| Agent | Does not drive the page | browser_* navigate & click |
| Local dev server | Not ideal | .zagens/preview.json + browser_start_preview |
After HTML edits, desktop may toast a suggestion to open Browser (pref can disable the hint).
Diff review
After edit_file / apply_patch / batch_edit, Zagens shows changes with diff2html.
Deliverables (Office)
write_office outputs usually land in deliverables/. See Deliverables.
Limits
- Preview is for reading; edits go through agent tools — not a full IDE.
- Huge files may truncate; ask the agent to read sections.
- Keep HTML scripts off for untrusted content.
Related: Workspace overview · Built-in Browser · Deliverables