fix: only include inline pPr on export#2287
Conversation
There was a problem hiding this comment.
💡 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".
packages/super-editor/src/core/super-converter/v3/handlers/w/tc/helpers/translate-table-cell.js
Outdated
Show resolved
Hide resolved
packages/super-editor/src/core/super-converter/export-helpers/run-properties-export.js
Outdated
Show resolved
Hide resolved
caio-pizzol
left a comment
There was a problem hiding this comment.
@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.
packages/super-editor/src/core/super-converter/export-helpers/run-properties-export.js
Outdated
Show resolved
Hide resolved
packages/super-editor/src/core/super-converter/v3/handlers/w/tc/helpers/translate-table-cell.js
Outdated
Show resolved
Hide resolved
packages/super-editor/src/extensions/run/calculateInlineRunPropertiesPlugin.js
Outdated
Show resolved
Hide resolved
packages/super-editor/src/core/super-converter/v3/handlers/w/r/r-translator.js
Show resolved
Hide resolved
68bf5ce to
91bad8b
Compare
caio-pizzol
left a comment
There was a problem hiding this comment.
@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.
packages/super-editor/src/core/super-converter/v3/handlers/w/r/r-translator.js
Outdated
Show resolved
Hide resolved
...per-editor/src/core/super-converter/v3/handlers/w/p/helpers/generate-paragraph-properties.js
Outdated
Show resolved
Hide resolved
packages/super-editor/src/extensions/run/calculateInlineRunPropertiesPlugin.js
Show resolved
Hide resolved
91bad8b to
048b54a
Compare
caio-pizzol
left a comment
There was a problem hiding this comment.
@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.
packages/super-editor/src/core/super-converter/v3/handlers/w/r/r-translator.js
Outdated
Show resolved
Hide resolved
packages/super-editor/src/document-api-adapters/plan-engine/executor.ts
Outdated
Show resolved
Hide resolved
packages/super-editor/src/extensions/run/calculateInlineRunPropertiesPlugin.test.js
Show resolved
Hide resolved
packages/super-editor/src/core/super-converter/v3/handlers/w/r/r-translator.js
Outdated
Show resolved
Hide resolved
caio-pizzol
left a comment
There was a problem hiding this comment.
@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.tssetCellPaddingupdatestableCellProperties.cellMarginsbut doesn't addcellMarginstotableCellPropertiesInlineKeys— 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.
…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
|
@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:
round-trip sizes stayed flat (~8-9% growth, no inflation). |
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.
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.
|
🎉 This PR is included in vscode-ext v1.1.0-next.10 |
|
🎉 This PR is included in superdoc v1.24.0-next.9 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-cli v0.5.0-next.9 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-sdk v1.3.0-next.9 |
Exclude inherited props from document.xml on export