Skip to content

feat(export): export a session as one self-contained HTML file - #227

Open
tridha643 wants to merge 2 commits into
mainfrom
stitch-html-snippets-issue
Open

feat(export): export a session as one self-contained HTML file#227
tridha643 wants to merge 2 commits into
mainfrom
stitch-html-snippets-issue

Conversation

@tridha643

Copy link
Copy Markdown
Contributor

A session can now be saved and shared as one self-contained HTML file: GET /api/sessions/:id/export and the new sideshow export CLI command render every post into the viewer's card column, with each surface still embedded as a sandboxed srcdoc iframe so the core isolation rule holds inside the saved file. The /s/:id renderers and the export now share a single renderSurfaceDocument dispatch, so the two paths can't drift when a surface kind or renderer option changes. Image surfaces are inlined as data URIs (allowlisted raster types only, 32 MB per export, shared via INLINE_IMAGE_TYPES in types.ts), sessions over 4 MB of surface text get a 413 instead of an unloadable file, and ?theme=/?mode=/?download=1 pin the look or force an attachment download. Export never creates a session, and there's deliberately no MCP tool — MCP agents use the HTTP route. Covered by unit tests (test/export.test.ts, CLI tests) and a new Playwright spec (e2e/export.spec.ts); the agent guide documents the workflow.


Compound Engineering
Claude Code

@tridha643

Copy link
Copy Markdown
Contributor Author

@greptile

@tridha643
tridha643 requested a review from benvinegar July 21, 2026 19:15
tridha643 and others added 2 commits July 27, 2026 14:27
GET /api/sessions/:id/export and the new `sideshow export` command render
a whole session into a single shareable HTML file styled like the viewer's
card column. Every surface that becomes HTML is embedded as a sandboxed
srcdoc iframe via the same renderSurfaceDocument dispatch /s/:id uses, so
the isolation rule holds inside the saved file. Image surfaces inline as
data URIs (allowlisted raster types, 32 MB cap per export); sessions over
4 MB of surface text are rejected with a 413.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tridha643
tridha643 force-pushed the stitch-html-snippets-issue branch from 9914fea to 9af51ac Compare July 27, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant