Skip to content

fix(pptx): preserve schema order in snapshot merges - #245

Merged
ChristopherVR merged 1 commit into
ChristopherVR:mainfrom
yunfeizhu:fix/pptx-merge-shape-property-order
Nov 4, 2026
Merged

ChristopherVR merged 1 commit into
ChristopherVR:mainfrom
yunfeizhu:fix/pptx-merge-shape-property-order

Conversation

@yunfeizhu

Copy link
Copy Markdown
Contributor

What does this change?

Fixes #243.

Use the existing DrawingML child sequences when merging concurrent shape-property edits. A fill and outline added by different peers now survive in valid schema order in either merge direction. Mutually exclusive choices remain unresolved; the shared XML merger also declines ambiguous unkeyed insertions while retaining deterministic keyed collection merges.

Type of change

  • Bug fix (non-breaking)

Area

pptx / xml. The ordering hook stays in the shared XML merger; PowerPoint supplies its format-specific sequences by reusing the existing property-order constants.

  • The change is made once in the area that owns it
  • DOM-free logic stays in core
  • Unsupported behaviour is reported honestly

Testing

  • Regression tests fail without this change
  • XSD checks cover fill/outline merges in both peer orders and with different namespace prefixes, line fill/dash, effects and conflicting fill choices
  • Existing XML, OPC, DOCX, XLSX, Visio and PPTX merge regressions pass
  • bun run verify --base 5b031d7c377b3d0679558b59b799304c467c8425 --jobs 2: all 38 planned local steps passed, including lint, changed-file formatting, typechecks, affected core/UI tests and viewer checks/builds

The default local verifier skips browser suites and package smoke checks. Scoped fork CI is running those additional planned checks on 1fb4c590bb0e284f3a1b1a080524260ff5bfeec1.

Reproduction case

Input decks, before/after outputs, XML, verification report and runnable script. No screenshots or generated output files are committed; the tests reuse the existing PPTX fixture.

Conventional Commits

  • One conventional commit

Use the existing DrawingML child sequences when combining independent
property edits. Return unresolved for mutually exclusive choices and
unkeyed insertions whose order cannot be established safely.

Cover fill and outline edits, line dash, namespace prefixes and reverse
merges with XSD checks, preserving convergent keyed collection inserts.
@github-actions github-actions Bot added tests Test-only change area: pptx PowerPoint engine area: shared xml, opc, units, color, geometry, chart, diagram, math size: M Fewer than 500 changed lines labels Nov 4, 2026
@pkg-pr-new

pkg-pr-new Bot commented Nov 4, 2026

Copy link
Copy Markdown
  • ooxml-office-playground

    npm i https://pkg.pr.new/ChristopherVR/ooxml/ooxml-office-preview@1fb4c59
    
    npm i https://pkg.pr.new/ChristopherVR/ooxml/ooxml-core@1fb4c59
    
    npm i https://pkg.pr.new/ChristopherVR/ooxml/ooxml-ui@1fb4c59
    

commit: 1fb4c59

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Bundle size

9 of 67 entry points changed size against main (5b031d7):

Entry point Before (gzip) After (gzip) Change
ooxml-core 510.7 kB 510.9 kB +0.2 kB (+0.0%)
ooxml-core/docx 435.5 kB 435.7 kB +0.2 kB (+0.0%)
ooxml-core/opc 23.0 kB 23.2 kB +0.2 kB (+0.8%)
ooxml-core/pptx 1328.8 kB 1329.7 kB +0.9 kB (+0.1%)
ooxml-core/pptx/automation 1478.8 kB 1479.7 kB +0.9 kB (+0.1%)
ooxml-core/pptx/cli 1216.1 kB 1216.1 kB +0.0 kB (+0.0%)
ooxml-core/pptx/converter 519.5 kB 519.5 kB -0.0 kB (-0.0%)
ooxml-core/xlsx/collab 421.6 kB 421.7 kB +0.2 kB (+0.0%)
ooxml-core/xml 8.7 kB 8.9 kB +0.2 kB (+2.1%)
All entry points
Entry point Before (gzip) After (gzip) Change
ooxml-core 510.7 kB 510.9 kB +0.2 kB (+0.0%)
ooxml-core/automation 1182.7 kB 1182.7 kB 0
ooxml-core/automation/node 2.3 kB 2.3 kB 0
ooxml-core/chart 176.5 kB 176.5 kB 0
ooxml-core/chart/region-map 9.0 kB 9.0 kB 0
ooxml-core/collab 14.9 kB 14.9 kB 0
ooxml-core/color 4.1 kB 4.1 kB 0
ooxml-core/crypto 28.1 kB 28.1 kB 0
ooxml-core/diagram 215.6 kB 215.6 kB 0
ooxml-core/diagram/builtin 346.0 kB 346.0 kB 0
ooxml-core/digest 12.4 kB 12.4 kB 0
ooxml-core/docx 435.5 kB 435.7 kB +0.2 kB (+0.0%)
ooxml-core/docx/embedded 301.4 kB 301.4 kB 0
ooxml-core/docx/layout 200.5 kB 200.5 kB 0
ooxml-core/docx/load 388.7 kB 388.7 kB 0
ooxml-core/docx/ui 299.0 kB 299.0 kB 0
ooxml-core/drawingml 40.8 kB 40.8 kB 0
ooxml-core/embedding 4.3 kB 4.3 kB 0
ooxml-core/embedding/onedrive 5.7 kB 5.7 kB 0
ooxml-core/geometry 91.7 kB 91.7 kB 0
ooxml-core/i18n 5.6 kB 5.6 kB 0
ooxml-core/math 19.8 kB 19.8 kB 0
ooxml-core/opc 23.0 kB 23.2 kB +0.2 kB (+0.8%)
ooxml-core/pptx 1328.8 kB 1329.7 kB +0.9 kB (+0.1%)
ooxml-core/pptx/automation 1478.8 kB 1479.7 kB +0.9 kB (+0.1%)
ooxml-core/pptx/automation/schemas 128.5 kB 128.5 kB 0
ooxml-core/pptx/cli 1216.1 kB 1216.1 kB +0.0 kB (+0.0%)
ooxml-core/pptx/converter 519.5 kB 519.5 kB -0.0 kB (-0.0%)
ooxml-core/pptx/node 0.6 kB 0.6 kB 0
ooxml-core/pptx/signature-node 14.8 kB 14.8 kB 0
ooxml-core/pptx/smartart-layouts 353.3 kB 353.3 kB 0
ooxml-core/pptx/ui 5.3 kB 5.3 kB 0
ooxml-core/ribbon 0.4 kB 0.4 kB 0
ooxml-core/teams 444.9 kB 444.9 kB 0
ooxml-core/text 16.1 kB 16.1 kB 0
ooxml-core/units 0.7 kB 0.7 kB 0
ooxml-core/visio 601.7 kB 601.7 kB 0
ooxml-core/visio/collab 24.3 kB 24.3 kB 0
ooxml-core/visio/ui 616.5 kB 616.5 kB 0
ooxml-core/xlsx 681.7 kB 681.7 kB 0
ooxml-core/xlsx/collab 421.6 kB 421.7 kB +0.2 kB (+0.0%)
ooxml-core/xlsx/load 457.4 kB 457.4 kB 0
ooxml-core/xlsx/ui 800.2 kB 800.2 kB 0
ooxml-core/xml 8.7 kB 8.9 kB +0.2 kB (+2.1%)
ooxml-ui 291.0 kB 291.0 kB 0
ooxml-ui/bindings 3.2 kB 3.2 kB 0
ooxml-ui/bindings/react 1.0 kB 1.0 kB 0
ooxml-ui/bindings/solid 1.0 kB 1.0 kB 0
ooxml-ui/bindings/vue 2.3 kB 2.3 kB 0
ooxml-ui/chart-format-locales 14.5 kB 14.5 kB 0
ooxml-ui/controls 132.7 kB 132.7 kB 0
ooxml-ui/docx 449.7 kB 449.7 kB 0
ooxml-ui/icons 2.5 kB 2.5 kB 0
ooxml-ui/pptx 1018.3 kB 1018.3 kB 0
ooxml-ui/pptx/ai 26.3 kB 26.3 kB 0
ooxml-ui/pptx/dom 1027.8 kB 1027.8 kB 0
ooxml-ui/pptx/i18n 72.3 kB 72.3 kB 0
ooxml-ui/pptx/loader 1.1 kB 1.1 kB 0
ooxml-ui/pptx/onedrive 0.1 kB 0.1 kB 0
ooxml-ui/pptx/theme 8.6 kB 8.6 kB 0
ooxml-ui/presence 7.7 kB 7.7 kB 0
ooxml-ui/smartart 28.7 kB 28.7 kB 0
ooxml-ui/suite 2.6 kB 2.6 kB 0
ooxml-ui/teams 262.5 kB 262.5 kB 0
ooxml-ui/theme 6.2 kB 6.2 kB 0
ooxml-ui/visio 428.7 kB 428.7 kB 0
ooxml-ui/xlsx 504.6 kB 504.6 kB 0

Each entry point with the files it imports statically, gzipped, before minification. Measured by scripts/bundle-size.mjs.

@ChristopherVR
ChristopherVR merged commit ad90b70 into ChristopherVR:main Nov 4, 2026
72 checks passed
ChristopherVR added a commit that referenced this pull request Nov 4, 2026
Core properties are an xsd:all set of singletons, so key each child by
its name. After the shared merger started declining ambiguous unkeyed
insertions (#245), two peers adding different properties such as a
title and a subject came back unresolved; they now merge again, while
two different values for the same property stay unresolved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: pptx PowerPoint engine area: shared xml, opc, units, color, geometry, chart, diagram, math size: M Fewer than 500 changed lines tests Test-only change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pptx: concurrent fill and outline edits produce invalid merged XML

2 participants