Skip to content

fix: only include inline pPr on export#2287

Merged
caio-pizzol merged 16 commits intomainfrom
sd-1919_filter-inherited-props
Mar 25, 2026
Merged

fix: only include inline pPr on export#2287
caio-pizzol merged 16 commits intomainfrom
sd-1919_filter-inherited-props

Conversation

@VladaHarbour
Copy link
Copy Markdown
Contributor

Exclude inherited props from document.xml on export

@linear
Copy link
Copy Markdown

linear bot commented Mar 4, 2026

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eaa6b03cab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

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

@VladaHarbour clean approach — tracking inline keys to avoid exporting inherited styles makes sense.

two things to fix: the style chain merge is in the wrong order (base overwrites derived), and the cell property filter drops user edits that weren't in the original import. also worth checking whether existing collab docs could have null inline keys — if so, export would strip their formatting.

minor cleanup: runPropertiesStyleKeys is saved but never read on export. run-properties-export.js has no unit tests. left inline comments.

@VladaHarbour VladaHarbour requested a review from caio-pizzol March 6, 2026 14:29
@VladaHarbour VladaHarbour force-pushed the sd-1919_filter-inherited-props branch 2 times, most recently from 68bf5ce to 91bad8b Compare March 12, 2026 16:24
@superdoc-dev superdoc-dev deleted a comment from github-actions bot Mar 18, 2026
Copy link
Copy Markdown
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

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

@VladaHarbour all five round 1 items fixed, nice. the collab guard covers editing, but the export itself still doesn't handle old docs where the new fields are missing — formatting gets dropped on save. same at the paragraph level. left inline comments with a fix.

@VladaHarbour VladaHarbour force-pushed the sd-1919_filter-inherited-props branch from 91bad8b to 048b54a Compare March 23, 2026 18:02
Copy link
Copy Markdown
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

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

@VladaHarbour round 2 feedback is addressed — the old-doc fallback and paragraph guard are both in. i tested the import/export path and the plugin covers fresh imports, so the inflation worry was smaller than i thought.

one thing: createRunNodeWithContent still turns [] into null, which makes it hard to tell "no inline props" from "old doc, don't know." the plugin catches this for most cases, but the executor doesn't go through the plugin — so API edits on old docs still drop props. left a few comments.

Copy link
Copy Markdown
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

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

@VladaHarbour all four round 3 items addressed — the [] is preserved now, the executor has the smarter 3-way fallback, the legacy test is in, and the filter is a named function. lgtm, approving.

a couple things for follow-up (not blocking):

  • tables-adapter.ts setCellPadding updates tableCellProperties.cellMargins but doesn't add cellMargins to tableCellPropertiesInlineKeys — so user-edited padding gets dropped on export for cells where margins came from the table style.
  • the executor partial-run split path (left/middle/right fragments) has no test yet — only the full-run path is covered.

caio-pizzol and others added 2 commits March 25, 2026 13:03
…ne property filtering

Word-generated fixtures (via COM automation) with proper style hierarchies,
docDefaults, and basedOn chains. Tests assert that:
- Plain runs don't export inherited w:rFonts/w:sz/w:lang
- Explicit overrides (bold, color, font) are preserved
- Table cell margins stay in w:tblCellMar, not duplicated per w:tcPr
@caio-pizzol
Copy link
Copy Markdown
Contributor

caio-pizzol commented Mar 25, 2026

@VladaHarbour pushed Word-native regression tests for the export filtering.

3 fixtures created by real Microsoft Word — headings, body text, bold/color/font overrides, and a table with style margins. The test imports each one, exports it, and checks:

  • plain runs don't get inherited font/size properties
  • bold and color overrides are kept
  • table cell margins stay on the table, not copied to each cell

round-trip sizes stayed flat (~8-9% growth, no inflation).

@caio-pizzol caio-pizzol enabled auto-merge (squash) March 25, 2026 16:49
caio-pizzol and others added 5 commits March 25, 2026 14:10
The fixture doc already has en-US as the default language, so applying
en-US is a no-op. Using fr-FR makes it an actual change.
Worker threads were hitting the default V8 heap limit during test
teardown, causing ERR_WORKER_OUT_OF_MEMORY on CI.
- Switch Vitest to forks pool on CI (each test file gets its own process
  with separate heap) to prevent ERR_WORKER_OUT_OF_MEMORY
- Cap workers at 2 to match GitHub Actions runner vCPUs
- Fix imageRegistrationPlugin.browser.test mock: merge duplicate
  startImageUpload mocks so addImageRelationship resolves correctly
The free-tier runner (2 vCPU, 7GB) was hitting OOM during test runs.
Using the superdoc-ci-4cpu runner (4 cores, 16GB RAM) instead.
@caio-pizzol caio-pizzol disabled auto-merge March 25, 2026 19:29
Roll back all CI runner and memory changes — the OOM is likely caused
by something in this PR's code, not the CI config. Will address separately.
@caio-pizzol caio-pizzol merged commit 407924e into main Mar 25, 2026
9 of 10 checks passed
@caio-pizzol caio-pizzol deleted the sd-1919_filter-inherited-props branch March 25, 2026 19:30
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Mar 25, 2026

🎉 This PR is included in vscode-ext v1.1.0-next.10

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Mar 25, 2026

🎉 This PR is included in superdoc v1.24.0-next.9

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Mar 25, 2026

🎉 This PR is included in superdoc-cli v0.5.0-next.9

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Mar 25, 2026

🎉 This PR is included in superdoc-sdk v1.3.0-next.9

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.

2 participants