fix(extension-table): snapshot column widths on first resize - #8137
fix(extension-table): snapshot column widths on first resize#8137sverg84 wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: be5419a The changes in this PR will be included in the next version bump. This PR includes changesets to release 74 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for tiptap-embed ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary
WalkthroughAdds a column-resize snapshot plugin for editable resizable tables. It preserves rendered widths before the first resize, handles existing widths and colspans, integrates with the table plugin stack, and adds focused tests plus a patch changeset. ChangesTable column resize behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant EditorView
participant columnResizingSnapshot
participant DOMTable
participant ProseMirrorTransaction
EditorView->>columnResizingSnapshot: Receive resize mousedown
columnResizingSnapshot->>DOMTable: Read rendered column widths
columnResizingSnapshot->>ProseMirrorTransaction: Store cell colwidth values
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/extension-table/src/table/columnResizingSnapshot.ts`:
- Around line 37-80: Update snapshotColumnWidths so the write-back condition is
evaluated per cell: preserve each cell’s existing valid colwidth and only apply
measured widths to cells whose colwidth is missing, invalid, or has the wrong
length. Keep the table-level early return and dispatch behavior intact, and add
a regression test covering a table with mixed valid and missing colwidth values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: ee71edf2-df5c-4435-9d9f-27f439b04036
📒 Files selected for processing (4)
.changeset/2026-07-28-fix-table-column-resize-snapshot.mdpackages/extension-table/__tests__/columnResizeSnapshot.spec.tspackages/extension-table/src/table/columnResizingSnapshot.tspackages/extension-table/src/table/table.ts
Fixes
Closes #7560
Changes and Review
colwidth, so the first resize of a non-leading column let the browser redistribute untouched columns.mousedown(before ProseMirror updates the dragged column), including colspan cells, and keep that snapshot out of undo history.columnResizeSnapshot.spec.ts.Checklist
Responsibility