Skip to content

fix: seed base docx package for collaboration exports#2416

Merged
harbournick merged 1 commit intomainfrom
luccas/sd-2220-fix-collab-export
Mar 17, 2026
Merged

fix: seed base docx package for collaboration exports#2416
harbournick merged 1 commit intomainfrom
luccas/sd-2220-fix-collab-export

Conversation

@luccas-harbour
Copy link
Contributor

This fixes DOCX export for collaboration-backed editors that have document state but no original DOCX package to rebuild from.

Previously, export could fail in two steps:

  • DocxExporter could crash when converter.declaration was missing
  • after guarding that, DocxZipper could still fail with docx is not iterable because collaborative export assumed options.content contained original DOCX entries

This change makes export resilient when the editor was hydrated from JSON or collaboration state without a backing package. The editor now falls back to the blank DOCX template to synthesize base package entries before zipping, and the zipper emits a clear error if that contract is violated again.

Tests:

  • added a regression test for the zipper missing-base-package path
  • added an editor-level export regression covering missing base package entries before export

Copy link
Collaborator

@harbournick harbournick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@harbournick harbournick merged commit df36853 into main Mar 17, 2026
9 checks passed
@harbournick harbournick deleted the luccas/sd-2220-fix-collab-export branch March 17, 2026 20:09
@superdoc-bot
Copy link
Contributor

superdoc-bot bot commented Mar 17, 2026

🎉 This PR is included in superdoc v1.19.1-next.1

The release is available on GitHub release

@superdoc-bot
Copy link
Contributor

superdoc-bot bot commented Mar 17, 2026

🎉 This PR is included in superdoc-cli v0.3.0-next.2

The release is available on GitHub release

harbournick pushed a commit that referenced this pull request Mar 18, 2026
# [1.20.0](v1.19.1...v1.20.0) (2026-03-18)

### Bug Fixes

* behavior tests ([#2436](#2436)) ([2d087f2](2d087f2))
* change default link protocol ([#2319](#2319)) ([1deda06](1deda06))
* **cli:** restore tracked diff redline roundtrip ([#2438](#2438)) ([f609371](f609371))
* **comments:** resolve double-click activation and edit mode issues (SD-2035) ([#2259](#2259)) ([d9465aa](d9465aa))
* **diffing:** ignore volatile OOXML attrs in image and paragraph diff comparison ([#2421](#2421)) ([ca91225](ca91225))
* **doc-api:** gate textStyle attrs and sync reference coverage ([#2430](#2430)) ([e2d6ca6](e2d6ca6))
* **docs:** coherence pass on doc api, clean up dead code, update CLI SKILL.md ([#2424](#2424)) ([bf0d4b8](bf0d4b8))
* **document-api:** add document diff API and fix tracked diff replay in CLI host session ([#2418](#2418)) ([2a804f7](2a804f7))
* **editor:** prevent scroll-to-top when clicking toolbar buttons ([#2236](#2236)) ([ab30a36](ab30a36))
* guard drawing export against invalid structures and zero IDs (SD-824) ([#2363](#2363)) ([9c7fc2e](9c7fc2e))
* improve multi-column rendering ([#2369](#2369)) ([d231640](d231640))
* **lists:** stabilize list item addresses for docs without paraIds ([#2429](#2429)) ([0070de6](0070de6))
* newline formatting inheritance without serializing style-derived formatting (SD-2228) ([#2417](#2417)) ([5a3318f](5a3318f))
* open links in view mode ([#2350](#2350)) ([25f0aad](25f0aad))
* **presentation-editor:** arrow key scroll-into-view with unconstrained containers (SD-1950) ([#2411](#2411)) ([fa8afc8](fa8afc8)), closes [#findScrollableAncestor](https://github.com/superdoc-dev/superdoc/issues/findScrollableAncestor)
* register DOCX numbering metadata for lists.create ([#2432](#2432)) ([129772f](129772f))
* seed base docx package for collaboration exports ([#2416](#2416)) ([df36853](df36853))
* show correct paragraph font in toolbar when selection is empty (SD-2145) ([#2402](#2402)) ([39e1477](39e1477))
* **super-editor:** guard against style definition nodes without elements ([#2379](#2379)) ([7dd57f8](7dd57f8))
* text selection inside headers/footers ([#2404](#2404)) ([09677dc](09677dc))
* **toc:** inject _Toc bookmarks so exported DOCX TOC links work without manual Update Table ([#2431](#2431)) ([54c5aa7](54c5aa7))

### Features

* **comments:** add scrollToComment API ([#2440](#2440)) ([0132d0e](0132d0e))
* **doc-info:** add live page counts to doc.info ([#2435](#2435)) ([e631f4b](e631f4b))
* **doc-info:** live doc.info counts for characters, tracked changes, SDT fields, and lists ([#2428](#2428)) ([2978507](2978507))

### Reverts

* Revert "fix(types): fix broken .d.ts imports in published superdoc package (S…" ([#2443](#2443)) ([33215ee](33215ee))
@harbournick
Copy link
Collaborator

🎉 This PR is included in superdoc v1.20.0

The release is available on GitHub release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants