fix(comments): undo of last tracked-change suggestion leaves orphan comment (IT-601)#2187
fix(comments): undo of last tracked-change suggestion leaves orphan comment (IT-601)#2187wasimrehman05 wants to merge 1 commit intosuperdoc-dev:mainfrom
Conversation
…omment in UI PresentationEditor skipped emitting commentPositions when positions were empty, so undoing the last tracked-change mark never signaled the store to clear stale position data. Additionally, getFloatingComments treated tracked-change comments (which lack selection.source) as non-editor comments that bypass position filtering, and handleEditorLocationsUpdate blocked all empty position updates regardless of lifecycle state. - Always emit commentPositions from PresentationEditor, even when empty - Use isEditorBackedComment() in getFloatingComments instead of naive source check so tracked-change comments require live positions - Add hasReceivedPositions flag to distinguish initial-load guard from legitimate undo cleanup in handleEditorLocationsUpdate
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42e3fa304e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Hi @harbournick @caio-pizzol Thanks! |
|
Hey @wasimrehman05, thanks for jumping on this so quickly - your analysis of the root cause is spot-on. The We had an internal fix already in progress on #2164 that addresses the same issue with a slightly different approach — it fixes the Really appreciate the contribution and the thorough breakdown in the PR description. Hope to see you around on future issues! |
PresentationEditor skipped emitting commentPositions when positions were empty, so undoing the last tracked-change mark never signaled the store to clear stale position data. Additionally, getFloatingComments treated tracked-change comments (which lack selection.source) as non-editor comments that bypass position filtering, and handleEditorLocationsUpdate blocked all empty position updates regardless of lifecycle state.
fixed #2186