Skip to content

SD-2343 - Table borders being converted twice#2667

Merged
caio-pizzol merged 16 commits into
mainfrom
fix/sd-2343
Apr 28, 2026
Merged

SD-2343 - Table borders being converted twice#2667
caio-pizzol merged 16 commits into
mainfrom
fix/sd-2343

Conversation

@chittolinag
Copy link
Copy Markdown
Contributor

Issue

DOCX tables store border thickness in eighths of a point (w:sz). The table translator (_processTableBorders in tbl-translator) already runs w:sz through eighthPointsToPixels, so the size passed downstream is in pixels. However, convertBorderSpec() / convertTableBorderValue() still assumed size was 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.

@linear
Copy link
Copy Markdown

linear Bot commented Mar 31, 2026

return { style: 'none' as BorderStyle, width: 0 };
}

const width = borderSizeToPx(sizeNumber);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We were converting it again here when it already was in pixels. Adding other verifications just as a fail safe.

@chittolinag chittolinag self-assigned this Mar 31, 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: 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".

Comment thread packages/layout-engine/pm-adapter/src/attributes/borders.ts Outdated
@chittolinag chittolinag marked this pull request as draft April 1, 2026 17:44
@chittolinag chittolinag marked this pull request as ready for review April 1, 2026 20:46
@chittolinag chittolinag marked this pull request as draft April 1, 2026 20:46
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: 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".

Comment thread packages/layout-engine/pm-adapter/src/converters/table.ts Outdated
@chittolinag chittolinag marked this pull request as ready for review April 2, 2026 16:11
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: 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".

Comment thread packages/layout-engine/pm-adapter/src/converters/table.ts Outdated
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.

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.

Comment thread packages/layout-engine/pm-adapter/src/attributes/borders.ts
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

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.

@caio-pizzol caio-pizzol added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit b97a6d7 Apr 28, 2026
56 checks passed
@caio-pizzol caio-pizzol deleted the fix/sd-2343 branch April 28, 2026 20:46
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 28, 2026

🎉 This PR is included in superdoc v1.30.0-next.8

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 28, 2026

🎉 This PR is included in superdoc-cli v0.8.0-next.23

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 28, 2026

🎉 This PR is included in superdoc-sdk v1.8.0-next.8

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 28, 2026

🎉 This PR is included in @superdoc-dev/mcp v0.3.0-next.4

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 29, 2026

🎉 This PR is included in @superdoc-dev/react v1.2.0-next.49

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 29, 2026

🎉 This PR is included in vscode-ext v2.3.0-next.51

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 30, 2026

🎉 This PR is included in superdoc v1.30.0

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 1, 2026

🎉 This PR is included in superdoc-cli v0.8.0

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 1, 2026

🎉 This PR is included in superdoc-sdk v1.8.0

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 1, 2026

🎉 This PR is included in @superdoc-dev/mcp v0.3.0

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 5, 2026

🎉 This PR is included in vscode-ext v2.3.0

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 7, 2026

🎉 This PR is included in @superdoc-dev/react v1.3.0

The release is available on GitHub release

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.

4 participants