Repository navigation
feat(export): export a page to Word (DOCX) and OpenDocument (ODT) - #46
Merged
Merged
Conversation
christianhuening
added a commit
that referenced
this pull request
Oct 24, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Draft design for exporting one page to Word and OpenDocument: a new pure knot-export crate walks the live Y.Doc into an export model with hand-written OOXML/ODF writers, diagrams rendered to PNG in the browser and sent with the request, per-element fallbacks reported to the user, memory and upload limits, and a neutral style set ready for company templates later. Includes the approved brainstorm mockup. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Twenty TDD tasks: the knot-export crate (walker, tables, media, DOCX and ODT writers, kitchen-sink sample), the server service, routes and export-check CLI, the web diagram rendering, API client, export flow and menu, an e2e flow, and whole-branch verification. Adds the planning clarifications to the design. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
nextest's positional filter matches test names, not binaries, so the per-task commands selected zero tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
christianhuening
force-pushed
the
feat/page-export
branch
from
October 24, 2026 06:58
6ca13c9 to
615e958
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Export the open page as a Word (.docx) or OpenDocument (.odt) file from the page header, ready to send around internally. Mermaid diagrams and Excalidraw boards are included as pictures. Design:
docs/superpowers/specs/2026-10-23-page-export-docx-odt-design.md(with the approved mockup next to it). Plan:docs/superpowers/plans/2026-10-23-page-export-docx-odt.md.sequenceDiagram participant UI as Browser (ExportMenu → useExport) participant S as knot-server participant X as knot-export (pure crate) UI->>S: GET /api/docs/{id}/export/diagrams S->>X: walk(live Y.Doc snapshot) S-->>UI: {limits, diagrams: mermaid source / board ids} UI->>UI: render each diagram → PNG at 2× UI->>S: POST /api/docs/{id}/export/{docx|odt} (multipart PNGs) S->>S: resolve images (per-blob ACL, 40 MiB budget, WebP→PNG), mentions, links S->>X: write_docx / write_odt (spawn_blocking, 2 permits) S-->>UI: file + X-Knot-Export-Fallbacks UI->>UI: save "<title>.docx", toast what couldn't be includedEvidence
Before: the page could only be exported as a Markdown zip.
After:
cargo nextest run --workspace --all-features: 626 passed, 2 skipped. That includes 137 knot-export tests, which unzip and parse every part (relationships, content types, styles, numbering ids, child order, manifest, covered cells).pnpm test: 474 passed.tsc,eslint --max-warnings 0,cargo fmt --checkandclippy -D warningsare all clean.flows/export.spec.ts+flows/mobile.spec.ts: 4 passed in Chromium. The tests download real DOCX and ODT files and assert the headings, the picture parts, and a correctly sized diagram PNG.cargo deny: licenses, bans and sources pass. Two advisories fail, RUSTSEC-2026-0386 (tokio) and RUSTSEC-2026-0385 (ctutils), and both are already onmain.A final whole-branch review looked at the plan, security and file formats. It found:
Manual acceptance before merge. Open the kitchen-sink files and one real export in Word (365, 2019, web) and LibreOffice 7.6+, and check:
Do one diagram export in Firefox and in Safari.
Not measured: binary size. Local release builds fail on macOS 27, main's included, so CI's Linux image shows the real number.
Merge Danger
Door: two-way
No migration and no change to stored data. Reverting removes the new routes, the crate and the menu.
Blast Radius: moderate
contributors_integration::revoked_editor_…is a pre-existing flaky test, also flaky on main.🤖 Generated with Claude Code