Problem
Clicking an HTML file in the Workspace file browser opens it in the code editor view (raw markup with syntax highlighting). There's no way to view the rendered HTML.
The /api/preview-file route exists and supports HTML rendering in an iframe (it's used by the Conductor complete-phase panel for mission outputs at `/tmp/dispatch-*/index.html`), but the file browser UI doesn't expose any "Preview" / "Render" / "Open in browser" affordance.
Expected behaviour
For files with renderable types (HTML, SVG, MD, images, PDF), the file browser should offer a preview action alongside / instead of the editor:
- HTML / SVG → sandboxed iframe via
/api/preview-file
- Markdown → rendered markdown view
- Images → thumbnail preview
- PDF → PDF.js or similar
A simple two-button pattern works: Preview (default for renderable types) | Edit (default for code files).
Additional gap
preview-file has a hardcoded prefix allowlist (/tmp, ~/projects, ~/dispatch, ~/.hermes/projects, ~/.claude/projects, ~/.ocplatform/workspace/projects). The active workspace catalog path is not in this list — so even if the file browser did wire up the Preview button, files from the user's configured workspace would 403.
The allowlist should also include:
- The currently-active workspace catalog path
- Any path explicitly registered via
POST /api/workspace
These are paths the user has already authorised as workspaces, so it's reasonable to allow preview within them.
Why it matters
The most common reason a user clicks an HTML file in the file browser is to see what it looks like — not to edit the source. Defaulting to the code editor inverts the expected UX.
Combined with the cross-cutting artifact rendering issue, this is the second-most common pain point for agents that produce HTML output.
Repro
- Configure a workspace at
/srv/workspace
- Have the agent write an HTML file there
- Click the file in the Workspace file browser
- Get the code editor instead of a rendered view, with no obvious way to switch
Problem
Clicking an HTML file in the Workspace file browser opens it in the code editor view (raw markup with syntax highlighting). There's no way to view the rendered HTML.
The
/api/preview-fileroute exists and supports HTML rendering in an iframe (it's used by the Conductor complete-phase panel for mission outputs at `/tmp/dispatch-*/index.html`), but the file browser UI doesn't expose any "Preview" / "Render" / "Open in browser" affordance.Expected behaviour
For files with renderable types (HTML, SVG, MD, images, PDF), the file browser should offer a preview action alongside / instead of the editor:
/api/preview-fileA simple two-button pattern works: Preview (default for renderable types) | Edit (default for code files).
Additional gap
preview-filehas a hardcoded prefix allowlist (/tmp,~/projects,~/dispatch,~/.hermes/projects,~/.claude/projects,~/.ocplatform/workspace/projects). The active workspace catalog path is not in this list — so even if the file browser did wire up the Preview button, files from the user's configured workspace would 403.The allowlist should also include:
POST /api/workspaceThese are paths the user has already authorised as workspaces, so it's reasonable to allow preview within them.
Why it matters
The most common reason a user clicks an HTML file in the file browser is to see what it looks like — not to edit the source. Defaulting to the code editor inverts the expected UX.
Combined with the cross-cutting artifact rendering issue, this is the second-most common pain point for agents that produce HTML output.
Repro
/srv/workspace