fix(layout): fold block-level tracked change into block version signature#2
Open
dawidbudaszewski wants to merge 1 commit into
Open
Conversation
…ture Accepting/rejecting a whole-paragraph structural tracked change only mutates block.attrs.trackedChange (text, runs, and other paragraph attrs are unchanged). Without folding that attr into the canonical block version, the resolved-layout pipeline reuses the cached fragment and the painter never repaints, leaving the insert/delete decoration on an already-resolved paragraph. Mirrors the existing table-row handling. Adds coverage in versionSignature.test.ts and a DOM painter accept/reject regression test. Co-authored-by: Cursor <cursoragent@cursor.com>
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
block.attrs.trackedChange) into the canonical block version produced byderiveBlockVersion.block.attrs.trackedChange(text/runs/other attrs unchanged), so the resolved-layout pipeline reuses the cached fragment and the DOM painter never repaints — leaving the insert/delete decoration on an already-resolved paragraph. This mirrors the existing table-row handling in the same file.Changes
packages/layout-engine/layout-resolved/src/versionSignature.ts— include ablock-tcsegment (kind/id/author/email/date/color/storyKey) in the block version when a block-level tracked change is present.packages/layout-engine/layout-resolved/src/versionSignature.test.ts— coverage: version changes when a block-level tracked change is added, returns to baseline once removed (accept), and distinguishes insert vs delete.packages/layout-engine/painters/dom/src/paragraph/block-tracked-change-accept.test.ts— new DOM painter accept/reject regression test.Test plan
pnpm test:editor/ relevant layout-engine tests passMade with Cursor