Preview & Comments
Sandboxed preview
Artifacts render inside a sandboxed iframe. HTML documents are served from the project's file URL (or inlined via srcdoc when forced); JSX renders with a vendored React 18 + Babel runtime. Nothing in an artifact can reach the host page.
How rendering is chosen
- The agent writes real files into the project folder.
- The artifact manifest records
kindandrenderer. - The renderer registry maps that to a viewer:
| Renderer | Viewer |
|---|---|
html | Standard preview with frame toggle |
deck-html | Deck viewer with slide navigation |
motion-html | Motion transport (play / scrub / frame-step) |
react-component | JSX preview |
markdown | Rendered markdown |
brand-guideline | Design spec / brand kit view |
Files with no manifest fall back to shape detection — a document with class="slide" sections is treated as a deck even when the project kind says otherwise.
Preview controls
| Control | Action |
|---|---|
| Frame toggle | Desktop / tablet / mobile widths; cycle with the toolbar |
| Fullscreen | Open the preview in a modal overlay |
| Refresh | Re-render the current artifact |
| Tweaks | Enter the interactive tweak board (see below) |
Tweaks and inline comments
The Tweaks toggle in the preview toolbar turns the artifact interactive. Clicking an element opens a comment composer tied to that element's selector, position, and current styles.
Tweaks on → click an element → type the change → Add & send
- Comments are persisted per project and per file.
- Each comment carries a snapshot of the target: selector path, bounding box, computed styles.
- Sending a comment produces a surgical edit instruction referencing that snapshot, so the agent edits the element instead of regenerating the page.
- Multiple pending tweaks queue up and can be sent as a batch or exported to the chat composer.
- Comment status is tracked (open → addressed → resolved).
Targeted patching depends on the artifact's DOM structure. For structural changes, describe the change in chat instead — a rewrite beats three failed selector patches.
Board tools
The tweak board also offers drawing tools (inspect, pod annotation, stroke). These are for annotating the preview, not for editing the artifact: they produce richer comment attachments.
Live todo progress
The agent streams a todo plan that renders as a live card in the chat pane. Items move from in_progress to completed in real time.
- Watch — see the plan before the artifact exists.
- Interrupt — stop a run that is heading the wrong way.
- Redirect — send a message mid-run to change course.
- Continue remaining — when a run stops with unfinished todos, this resumes only what is left instead of redoing completed work.
Tool-call feed
File reads, writes, searches, and shell calls render as tool cards in the chat pane. Each shows the tool, its input, and a compact result — enough to see what the agent touched without opening the file tree.
Motion transport
Motion artifacts get a different viewer, because a timeline needs a transport rather than slide navigation.
| Control | Action |
|---|---|
| Compose / Rendered tabs | Edit-time preview vs the rendered MP4 |
| Play / pause | Drive the playhead |
| Scrub | Seek continuously |
| Frame step | Move one frame at a time |
| Render | Run the MP4 render from the viewer |
Preview and render share one mechanism: both write the --od-t custom property. What you scrub is exactly what the renderer captures — that is the point of the data-od-* contract, and it is why scrubbing never drifts from the final output.
When a composition declares media layers (data-od-src), the compose tab shows the DOM layer only. Video and audio layers are composited by ffmpeg at render time.
See Motion.
Design system preview
Opening a design system before selecting it shows:
DESIGN.md— the nine sections, rendered.- Swatches — the palette with hex values.
- Component showcase —
components.htmlrendered with the tokens. - Design spec — a structured token view.
File workspace
The file panel shows the real on-disk project tree:
| Action | Notes |
|---|---|
| Browse | Folder tree of the project working directory |
| Open | Syntax-highlighted viewer; HTML gets the preview |
| Edit | Manual edit mode with undo/redo (⌘/Ctrl+Z) |
| Download | Per-file chips |
| Search | Project-wide search |
| Versions | Per-file version history with restore |
⌘/Ctrl+P | Quick switcher over all project files |
Version history
Every saved file keeps snapshots with an id, timestamp, source (manual / agent), and label. You can read an old version and restore it in place — from the app, or from the CLI:
tfdesign files versions <projectId> index.html
tfdesign files version-read <projectId> index.html <versionId>
tfdesign files version-restore <projectId> index.html <versionId>
The same history is available over MCP with list_file_versions and get_file_version.