Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 |
YousefED
added a commit
that referenced
this pull request
Oct 8, 2026
YousefED
force-pushed
the
fix/legacy-version-diff-structure
branch
from
October 8, 2026 14:28
b2ceae6 to
72c1cce
Compare
YousefED
added a commit
that referenced
this pull request
Oct 8, 2026
YousefED
force-pushed
the
fix/legacy-version-diff-structure
branch
from
October 8, 2026 14:30
72c1cce to
f7505eb
Compare
YousefED
added this pull request to stack #3174
October 8, 2026 14:30
This was referenced Oct 8, 2026
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/diagram-block
@blocknote/mantine
@blocknote/math-block
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
@blocknote/xl-typst-exporter
commit: |
|
YousefED
force-pushed
the
fix/legacy-version-diff-structure
branch
from
October 8, 2026 20:38
f7505eb to
4eaab21
Compare
YousefED
force-pushed
the
fix/legacy-version-diff-structure
branch
from
October 9, 2026 09:54
4eaab21 to
eaeaee9
Compare
YousefED
force-pushed
the
fix/legacy-version-diff-structure
branch
from
October 9, 2026 11:55
eaeaee9 to
366dd27
Compare
The old binding changed a block's type in place, keeping the old and the new content in one block, which a diff renders as schema-invalid content that is then dropped. Before rendering a diff, replace each block that changed structurally since the earlier version with a copy, as the current binding stores such a change, so it shows as a deleted and an inserted block. The copy and the deletion keep the change's authors. The versioning snapshot shows that this also splits tables two users resize concurrently (to revisit).
… ways Replacing such a table silently dropped concurrent edits to it. Version diffs compare all the changes between two versions, so two concurrent one-way reshapes (a row and a column) replaced the whole table there too. Reshapes now merge in place, as one-way reshapes always did.
…ver made it The split credited every attribution found anywhere in the block to both sides, timestamps included: `insertAt` became an "insert" by a user named like the time. It now credits the content nodes and child groups that changed the block, with their own attributions. The split only changes the decoded snapshot; a test checks that the document stays unchanged.
…ange to its writer The split replaced the block with a clone and credited all of the clone to whoever changed the block's structure, including text that someone else typed into the block later. The clone is now paired with the original unit by unit (it has the same content in the same order), and content added after the baseline keeps its own author.
YousefED
force-pushed
the
fix/legacy-version-diff-structure
branch
from
October 9, 2026 14:17
366dd27 to
a7e23b9
Compare
This branch was successfully deployed
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.
Replaces #3167. GitHub marked #3167 as merged during a restack of the PRs, so it cannot be reopened.
Stacked on #3090. This fix is on by default. It has no option, because without it the diff does not show the changed block.
Problem
The old y-prosemirror (Yjs v13) binding stored some structural changes inside the same block container. These changes are:
The current binding prevents this with
blockMatchNodes. It stores these changes as a replaced block.Version history can make a diff of such an old change. The merged render then has two block contents (or two groups) in one container. The schema does not allow this. Thus, @y/prosemirror drops it and shows no error. The changed block is not in the diff. For example, a paragraph → heading change shows only the deleted paragraph.
Changes
snapshotPreview.ts: before the diff renders,splitChangedBlocksexamines the decoded snapshot. Some blocks existed in the baseline, andblockMatchNodesconsiders them changed.splitChangedBlocksreplaces each of these blocks with a new copy. The diff then shows a deleted block next to an inserted block. This is the same diff as for a change by the current binding.insert/insertAtbecomesdelete/deleteAt). Other content in the block, such as text that a different user typed, does not get the credit for the change.blockMatchNodes.ts: the table rule is off. Before, the collaboration binding replaced a table when one edit changed the number of rows and the number of columns. This rule has two problems:Now a table edit always merges in place. One-direction resizes always did this. Two concurrent resizes can still merge into a table with an unusual shape. This was already possible before this change.
Covered (the diff is the same as for a change by the current binding, with the same authors)
Not covered
snapshotPreview.Tests
The tests are in #3090, in
legacyYjsDocBinding.test.ts. On #3090, the failing tests have the comment "To be fixed by #3173". This PR changes them to normal tests:tableReshape.test.ts: "keeps a concurrent cell edit when a different user reshapes the table". Before, the table rule replaced the table, and the cell edit was lost.Other tests in this file pass on #3090 and on this PR:
Versioning snapshot (
tests/src/end-to-end/y-prosemirror/__snapshots__/versioning.test.tsx.snap): the table rule change changes 5 table scenarios. In each of them, two users add or delete rows and columns at the same time. The table now merges in place, and the diff shows the added or deleted rows and columns. Before, the diff showed the full table as deleted and inserted again:All other scenarios show the same diff as on #3090.