Skip to content

[lexical-table][lexical-playground] Breaking change: Move hasFitNestedTables logic to Playground plugin#8210

Merged
etrepum merged 2 commits intofacebook:mainfrom
randal-atticus:chore-playground-fit-nested-table-plugin
Mar 15, 2026
Merged

[lexical-table][lexical-playground] Breaking change: Move hasFitNestedTables logic to Playground plugin#8210
etrepum merged 2 commits intofacebook:mainfrom
randal-atticus:chore-playground-fit-nested-table-plugin

Conversation

@randal-atticus
Copy link
Contributor

@randal-atticus randal-atticus commented Mar 11, 2026

Breaking Change

The hasFitNestedTables option in TablePlugin introduced in v0.41.0 (#8097) has been moved to an independent playground plugin due to edge cases and its experimental state.

Description

The recently implemented hasFitNestedTables in #8097 works in the general case (i.e. in Playground) however after attempting to use it as-is in our application I discovered some application-specific edge cases or gaps, such as:

  • Handling tables changing style, e.g. padding, therefore requiring a "remeasure and resize". markDirty works to force the MutationListener to run but is a hack, but what I really wanted to do was to explicitly re-run the resizing logic, which I couldn't do.
  • Table margins (horizontal spacing around the table) was not considered in measurement.
  • When the editor itself changes width, top-level tables are not resized and a remeasure is needed. Once again, markDirty worked as a hack.
  • Didn't quite work with how we implement zoom
  • It would be nice to extend this feature to other resizable elements, such as Images.

With the gaps listed above, and how new this feature is (I bet no one else is using it), I think it's a good time to cut losses and move the plugin to Playground. However, TableNode.scaleDOMColWidths can/should stay in lexical-table.

Test plan

Before

N/A

After

Feature still works as expected (there is also an E2E test checking hasFitNestedTables and is unchanged in this PR)

Screen.Recording.2026-03-11.at.9.36.31.pm.mov

@vercel
Copy link

vercel bot commented Mar 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment Mar 11, 2026 10:47am
lexical-playground Ready Ready Preview, Comment Mar 11, 2026 10:47am

Request Review

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 11, 2026
@etrepum etrepum added this pull request to the merge queue Mar 15, 2026
Merged via the queue into facebook:main with commit afda7bd Mar 15, 2026
65 of 66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants