SD-2343 - Table borders being converted twice#2667
Conversation
| return { style: 'none' as BorderStyle, width: 0 }; | ||
| } | ||
|
|
||
| const width = borderSizeToPx(sizeNumber); |
There was a problem hiding this comment.
We were converting it again here when it already was in pixels. Adding other verifications just as a fail safe.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5a0dc0f46
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33bdd02d40
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33bdd02d40
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
caio-pizzol
left a comment
There was a problem hiding this comment.
hey @chittolinag! thanks for addressing last round.
two things to fix before merge. one inline. also, the extractCellBorders JSDoc example at packages/layout-engine/pm-adapter/src/attributes/borders.ts:275 is out of date - with the new default unit, size 8 returns width 8 (not 1.33) and size 16 returns width 16. the new options argument is also missing from the JSDocs of convertBorderSpec, convertTableBorderValue, and extractTableBorders.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
caio-pizzol
left a comment
There was a problem hiding this comment.
hey @chittolinag! pushed the round 2 fixes myself :)
quick correction: the build-break i flagged last round was wrong on my end - it only happens with leftover build files from main. your branch is fine on its own.
lgtm.
|
🎉 This PR is included in superdoc v1.30.0-next.8 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-cli v0.8.0-next.23 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-sdk v1.8.0-next.8 |
|
🎉 This PR is included in @superdoc-dev/mcp v0.3.0-next.4 The release is available on GitHub release |
|
🎉 This PR is included in @superdoc-dev/react v1.2.0-next.49 The release is available on GitHub release |
|
🎉 This PR is included in vscode-ext v2.3.0-next.51 |
|
🎉 This PR is included in superdoc v1.30.0 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-cli v0.8.0 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-sdk v1.8.0 |
|
🎉 This PR is included in @superdoc-dev/mcp v0.3.0 The release is available on GitHub release |
|
🎉 This PR is included in vscode-ext v2.3.0 |
|
🎉 This PR is included in @superdoc-dev/react v1.3.0 The release is available on GitHub release |
Issue
DOCX tables store border thickness in eighths of a point (
w:sz). The table translator (_processTableBorders intbl-translator) already runsw:szthrougheighthPointsToPixels, so thesizepassed downstream is in pixels. However,convertBorderSpec()/convertTableBorderValue()still assumedsizewas an OOXML eighth-point value and converted it again. This makes SuperDoc render noticeably thinner borders than Word in some cases.Fix
When calculating the final border values, do not convert it to px again since it's already converted.