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 |
@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
added this pull request to stack #3169
October 8, 2026 04:22
3 of 4 tasks
YousefED
force-pushed
the
fix/legacy-version-diff-structure
branch
from
October 8, 2026 14:25
c3ed733 to
b2ceae6
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.
Stacked on #3166.
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.
Change
snapshotPreview.ts: before the diff renders,splitChangedBlocksexamines the decoded snapshot. The snapshot is a temporary copy. It is never the live document or the stored document. 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.The copy and the local deletion get the attributions of the original. They are converted to the correct kind. Thus, the change keeps its author: "Deleted by"/"Inserted by" the user who made the change.
Covered (for each case, the diff is the same as for a change by the current binding, with the same authors)
Not covered
splitChangedBlocksthen also splits this table, although the current binding made the change. The diff then shows the whole table as deleted and inserted again. The versioning snapshot records this. For example, "Delete row vs add column" shows the whole table as deleted by A and inserted by B. Other examples are "Add column vs add row" and "A adds column then row, B adds column". We will examine this again.snapshotPreview. This needs a binding transformer.Tests
The tests are in #3090, in
legacyYjsDocBinding.test.ts:On #3090, the 5 structural cases are marked
it.fails, with the comment "To be fixed by #3167". This PR changes them to normal tests.The tests for the new binding use
gc: falsedocuments, as stored history does.Versioning snapshot (
tests/src/end-to-end/y-prosemirror/__snapshots__/versioning.test.tsx.snap): this PR changes only the table scenarios with two users that resize the same table. See the known issue above.