feat(odf.js): add a real .sxi writer for OpenOffice.org 1.x presentations - #902
Merged
Conversation
…ions writeSxi/writeSxiContent wrap writeOdp/writeOdpContent through transformToOoo1Package, the exact pattern writeSxw/writeSxc already use for .odt/.ods -- the transform is already generic across every ODF media type, so wiring .sxi up to it needed no changes to the transform itself, only a third pair of writer entry points.
…ed reader Mirrors the sxc suite's own two-part discipline: the round-trip law (normaliseOdpContent(readSxiContent(writeSxiContent(document))) equals normaliseOdpContent(document), through both the flat and tree forms, with the same rotated-shape floating-point tolerance exception typed/odp/write-round-trip.test.ts already states) and a second, independent check that the output genuinely looks like OpenOffice.org 1.x XML -- its own namespace URIs, no mimetype part, no office:presentation genre wrapper, and a shape written as a bare draw:text-box rather than ODF's draw:frame-wrapped one.
Updates the Status/Usage/Architecture sections and the root monorepo README to state real .sxi write support, including a real LibreOffice 26.2.5.2 check (soffice --headless --convert-to fodp/pdf) alongside the existing round-trip suite.
… is genuinely OOo1x Each of writeSxw/writeSxc/writeSxi's own "holds through the tree form" test built a package and checked it read back correctly, but never checked what kind of package it actually was. transformOoo1Package returns anything it does not detect as OpenOffice.org 1.x completely unchanged, so a writer that silently skipped transformToOoo1Package would still round-trip -- the identity composed with itself -- while producing a package with a .sxw/.sxc/.sxi extension and plain ODF content inside it. Confirmed directly: mutating writeSxw, writeSxc, and writeSxi in turn to skip the transform left every existing test in this file passing. isOoo1Package is the assertion that actually distinguishes the two, and each writer's own "genuine OpenOffice.org 1.x XML" describe block already makes the identical check against its *Content sibling -- this closes the same gap for the tree-level entry point.
Mearman
marked this pull request as ready for review
September 4, 2026 02:01
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Part of #821. writeOdp landed in #900; this wires up the .sxi wrapper the same way #878 (writeSxw) and #889/#894 (writeSxc) already did for .sxw/.sxc -- transformToOoo1Package is generic across every ODF media type, so no changes to the transform itself, just a third pair of writer entry points (writeSxi/writeSxiContent) wrapping writeOdp/writeOdpContent.
Verified the same two ways the sxw/sxc writers were: the round-trip law through this package's own unmodified reader (readSxiContent(writeSxiContent(document)) reproduces document up to normaliseOdpContent, including the flat and tree forms and the rotated-shape floating-point tolerance the odp suite already carries), and a second, independent check that the output genuinely looks like OpenOffice.org 1.x XML rather than merely something the transform's own catch-all tolerates (its own namespace URIs, no mimetype part, no office:presentation genre wrapper, a shape written as a bare draw:text-box rather than ODF's draw:frame-wrapped one).
Also checked against real LibreOffice 26.2.5.2: a
.sxibuilt with writeSxiContent (a title, a rotated shape, a table, an image, multi-line speaker notes) converts cleanly withsoffice --headless --convert-to fodpand--convert-to pdf(both exit 0, LibreOffice identifies the input as a genuine Impress document), every authored string survives verbatim in the flat XML, and the rendered PDF confirms correct layout with the speaker notes absent from the slide itself.Full check suite green:
pnpm exec turbo run _lint _typecheck _test _test:workers --filter=odf.js --force(1156 tests) and a full-workspacepnpm exec turbo run _lint _typecheck --force(57 tasks)..sxdstill has no writer -- it needs awriteOdgunderneath it first, tracked as its own follow-up.A real, pre-existing coverage gap found and fixed along the way
While self-verifying this PR (mutating
writeSxito skiptransformToOoo1Packageand confirming the test suite would catch it), the whole suite still passed — the tree-level "holds through the tree form" test can't distinguish genuine OpenOffice.org 1.x output fromwriteOdp's own plain ODF passed straight through, becausetransformOoo1Packagereturns anything it doesn't detect as OpenOffice.org 1.x completely unchanged: skipping the forward and reverse transform round-trips by accident (identity composed with itself).Checked whether this was specific to my own new code or a pre-existing gap: mutating the already-merged
writeSxwandwriteSxcthe identical way leaves their own existing tests green too. Not something this PR introduced -- a real gap in already-shipped test coverage (#878, #889/#894). Fixed for all three tree-level entry points with anisOoo1Package(pkg)assertion, the same check each writer's own "genuine OpenOffice.org 1.x XML" describe block already makes against its*Contentsibling. Confirmed each of the three new assertions actually fails against the corresponding mutation before restoring the real implementation.