Skip to content

fix(layout): fold block-level tracked change into block version signature#2

Open
dawidbudaszewski wants to merge 1 commit into
release/combined-mainfrom
fix/block-tracked-change-version-signature
Open

fix(layout): fold block-level tracked change into block version signature#2
dawidbudaszewski wants to merge 1 commit into
release/combined-mainfrom
fix/block-tracked-change-version-signature

Conversation

@dawidbudaszewski

Copy link
Copy Markdown
Owner

Summary

  • Fold a paragraph's block-level structural tracked change (block.attrs.trackedChange) into the canonical block version produced by deriveBlockVersion.
  • Without this, accepting/rejecting a whole-paragraph structural change only mutates 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 a block-tc segment (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 pass
  • Manual: in al-pmo tracked-change review, accept/reject a whole-paragraph change in one click and confirm the highlight clears

Made with Cursor

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant