SD-2277 - fix: tracked change doesn't undo correctly#2658
Conversation
…mes-inaccurate-after-undoredo
…mes-inaccurate-after-undoredo
caio-pizzol
left a comment
There was a problem hiding this comment.
@chittolinag looks good! tested locally — undo/redo updates the sidebar bubble correctly now. one small cleanup inline.
Co-authored-by: Caio Pizzol <97641911+caio-pizzol@users.noreply.github.com>
…mes-inaccurate-after-undoredo
caio-pizzol
left a comment
There was a problem hiding this comment.
@chittolinag lgtm! added a test for the bubble text after undo/redo, all green.
…mes-inaccurate-after-undoredo
|
🎉 This PR is included in vscode-ext v1.1.0-next.60 |
|
🎉 This PR is included in @superdoc-dev/react v1.0.0-next.14 The release is available on GitHub release |
|
🎉 This PR is included in template-builder v1.3.0-next.17 The release is available on GitHub release |
|
🎉 This PR is included in esign v2.2.0-next.18 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-cli v0.5.0-next.57 The release is available on GitHub release |
|
🎉 This PR is included in superdoc v1.24.0-next.57 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-sdk v1.3.0-next.58 |
Issue
Tracked-change bubbles weren’t updated when the history replay rebuilt suggestions, so undoing part of an insertion (typing “add text” → undoing “ text”) removed those characters from the document but left the sidebar bubble showing “add text.”
Fix
This fix makes
syncTrackedChangeComments()re-runcreateOrUpdateTrackedChangeComment()in “update” mode for existing suggestions, making sure that replay re-calculates the tracked-change text/deletion payload from the current state before emitting the bubble update.The fix keeps full metadata per tracked-change ID (runtime ID + imported ID) and adds a
refreshExistingmode. When replay runs, the helper now:createOrUpdateTrackedChangeComment()withevent: 'update'.handleTrackedChangeUpdate().