fix(core): preserve fixed table width during resize#426
Draft
leandrotcawork wants to merge 1 commit into
Draft
Conversation
|
Someone is attempting to deploy a commit to the EigenPal Team on Vercel. A member of the Team first needs to authorize it. |
2506775 to
802ebb4
Compare
Contributor
|
Hey @leandrotcawork ! are you planning to pick up the work? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Preserve the total width of fixed-width (
dxa) tables when resizing columns in the ProseMirror editor.This PR keeps imported fixed-width Word tables stable during interactive column resize by materializing deterministic
colwidthmetadata, tracking fixed-width table intent throughtoProseDoc, and normalizing edited widths back to the original table total.Problem
Imported fixed-width tables could drift after column resize in the editor:
This was especially visible on imported tables whose width was defined in
dxaand should behave as a fixed total-width grid.Root Cause
The editor had enough information to resize columns visually, but not enough persisted structure to normalize the table back to a fixed total width after the transaction:
colwidthmetadatadxa) tables from percentage/auto tablesWhat Changed
colwidthmetadata for imported fixed-width table cells intoProseDocdxavs non-fixed modes) through table conversiondata-colwidthon table cell DOM parse/render so PM resize state round-trips correctlyfixedResizeNormalizerPluginthat post-processes resized fixed-width tables and rewrites cell/table widths back into a stable fixed-width stateScope
This PR is intentionally limited to fixed-width table resize behavior.
It does not change header/footer layout logic from #425, although both PRs touch some shared ProseMirror table conversion files.
Validation
Ran:
bun test packages/core/src/prosemirror/extensions/nodes/tableFixedResizeUtils.test.ts packages/core/src/prosemirror/conversion/toProseDoc.test.ts bun x tsc --noEmit -p packages/core/tsconfig.json git diff --check origin/main...Result:
Notes For Maintainer
I kept this as a separate review slice from the header/footer work in #425 so the resize behavior can be reviewed on its own.
Functionally this patch applies cleanly on top of
main; the connection to#425is organizational rather than runtime-coupled.