feat: support wide tables rendering outside of margins#2823
feat: support wide tables rendering outside of margins#2823VladaHarbour wants to merge 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb148ad488
ℹ️ 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".
| if (justification === 'center') { | ||
| return { x: baseX + Math.max(0, (columnWidth - width) / 2), width }; | ||
| return { x: baseX + (columnWidth - width) / 2, width }; | ||
| } | ||
| if (justification === 'right' || justification === 'end') { | ||
| return { x: baseX + Math.max(0, columnWidth - width), width }; | ||
| return { x: baseX + (columnWidth - width), width }; |
There was a problem hiding this comment.
Preserve column ownership when aligning overwide tables
Removing the Math.max(0, …) clamp for centered/right tables lets fragment.x move left of the table’s actual flow column when width > columnWidth (e.g., a table laid out in column 2 can start inside column 1). Several layout-bridge paths infer column index from fragment.x (notably assignFootnotesToColumns in layout-bridge/src/incrementalLayout.ts and determineColumn in layout-bridge/src/position-hit.ts), so this change can misclassify the table as belonging to the wrong column in multi-column documents, which breaks footnote placement and column-aware hit testing for those tables.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Here for any table with width > columnWidth:
- centered tables would no longer shift left into the margin
- right/end-aligned tables would no longer overflow leftward from the content area
Adding fix to support multi-column layout together with wide tables overflow.
eb148ad to
a06f987
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
No description provided.