feat(track-changes): block-level & structural tracked changes#3
Open
dawidbudaszewski wants to merge 1 commit into
Open
feat(track-changes): block-level & structural tracked changes#3dawidbudaszewski wants to merge 1 commit into
dawidbudaszewski wants to merge 1 commit into
Conversation
Adds whole-block (paragraph/table) tracked-change support on top of the existing inline track-changes, so structural edits β table add/remove, list/ image/paragraph block replacements, and table column add/delete β surface as accept/reject-able suggestions and render correctly in the paginated review view. - New `structural-track-changes` extension: `setStructuralDiff` command, `computeStructuralDiff` (block matching by content/structural fingerprint with optional ordinal replace pairing via operationId) and `applyHunks` (+ tests). - Block tracked-change plumbing in `track-changes`: block tracked-change attr, accept/reject helpers, query helpers, and structural-change detection in tracked transactions. - Layout-adapter + paragraph converter render block tracked changes in the review/paginated view. - Table: clear the now-stale `grid` attr on column add/delete so the DOCX exporter (preferTableGrid) stops slicing added columns back off and the column count stays in sync across export/round-trip (+ regression tests). - Doc-API tracked-change resolver / type-utils / index / snapshot updates. - Comments: dialog + store + plugin enhancements. - Dev harness (SuperdocDev.vue) wiring for manual testing. 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
Adds block-level / structural tracked changes to SuperDoc, on top of the existing inline (character-level) track-changes. Structural edits β table add/remove, table column add/delete, and rich paragraph / list / image block replacements β now surface as accept/reject-able suggestions and render correctly in the paginated review view. This is the engine behind the al-pmo "Compare my UI edits" review flow.
What's included
New
structural-track-changesextensionsetStructuralDiffcommand (registered ineditors/v1/index.js).computeStructuralDiffβ matches top-level blocks by a content/structural fingerprint (not sdBlockId, which is reassigned on every import) and emitsremove/inserthunks. Supports optional ordinal replace pairing (sharedoperationId) so a changed block collapses into a single "replaced X with Y" review action.applyHunksβ applies hunks as block tracked changes.Block tracked-change plumbing (
track-changes)blockTrackedChangeAttr,acceptRejectBlockTrackedChange,getBlockTrackedChanges,structuralBlockChanges(+ tests).trackedTransactionandtransaction-touches-structural-change.Rendering
tracked-changes.ts+paragraph.tsconverter render block tracked changes in the review/paginated view (+ tests).Table column grid fix
table.js: clear the now-stalegridattr on column add/delete so the DOCX exporter (preferTableGrid) stops slicing newly added columns back off, keeping the column count in sync across export/round-trip (+ regression tests).Doc-API + misc
SuperdocDev.vuedev-harness wiring for manual testing.Test plan
pnpm --filter @super-editor test(unit suites for the new extension, table, layout-adapter)@scale/superdoc-scale.x, bump al-pmo dependency, drop the locallink:overrideMade with Cursor