Skip to content

fix(super-editor): constrain images to table cell width in web layout (SD-2416)#2680

Merged
caio-pizzol merged 2 commits intomainfrom
luccas/sd-2416-bug-images-resizing-when-inserted-into-table-cell-web-layout
Apr 3, 2026
Merged

fix(super-editor): constrain images to table cell width in web layout (SD-2416)#2680
caio-pizzol merged 2 commits intomainfrom
luccas/sd-2416-bug-images-resizing-when-inserted-into-table-cell-web-layout

Conversation

@luccas-harbour
Copy link
Copy Markdown
Contributor

Summary

  • Images inserted into table cells in web layout mode were not constrained to the cell width, causing them to overflow
  • Hoisted the table cell detection loop in getMaxContentSize() so it runs for both print and web layout modes
  • In web layout + table cell, returns { width: cellWidth, height: Infinity } (no page height to constrain against)

@linear
Copy link
Copy Markdown

linear Bot commented Apr 1, 2026

… mode

getMaxContentSize() returned an empty object in web layout mode, bypassing
the table cell width constraint added in SD-1156. Move the cell check before
the web layout early return so images inserted into a cell are resized to fit.
@luccas-harbour luccas-harbour force-pushed the luccas/sd-2416-bug-images-resizing-when-inserted-into-table-cell-web-layout branch from 3e8a05c to 5b1bc63 Compare April 1, 2026 20:25
@luccas-harbour luccas-harbour marked this pull request as ready for review April 1, 2026 20:28
…traint

- Add tableHeader web layout test to Editor.webLayout.test.ts
- Add getAllowedImageDimensions tests for height: Infinity (the web
  layout + table cell code path)
- Add test for image fitting within constraints with Infinity height
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.

@luccas-harbour looks good — images now get constrained in web layout too. pushed a commit with a couple extra tests. approving.

@caio-pizzol caio-pizzol enabled auto-merge April 3, 2026 19:44
@caio-pizzol caio-pizzol added this pull request to the merge queue Apr 3, 2026
Merged via the queue into main with commit 9f25ab8 Apr 3, 2026
51 checks passed
@caio-pizzol caio-pizzol deleted the luccas/sd-2416-bug-images-resizing-when-inserted-into-table-cell-web-layout branch April 3, 2026 19:49
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 3, 2026

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

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 3, 2026

🎉 This PR is included in @superdoc-dev/react v1.0.0-next.16

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 3, 2026

🎉 This PR is included in esign v2.2.0-next.20

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 3, 2026

🎉 This PR is included in template-builder v1.3.0-next.19

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 3, 2026

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

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 3, 2026

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

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 3, 2026

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

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 10, 2026

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

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 10, 2026

🎉 This PR is included in superdoc v1.25.0

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 10, 2026

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

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 10, 2026

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

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 10, 2026

🎉 This PR is included in esign v2.3.0-next.1

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 10, 2026

🎉 This PR is included in template-builder v1.5.0-next.1

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.

3 participants