SD-3358 - tracked deletion is captured char by char in suggesting mode#3610
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7467ac5d79
ℹ️ 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".
There was a problem hiding this comment.
cubic analysis
1 issue found across 2 files
Linked issue analysis
Linked issue: SD-3358: Tracked deletion is captured char-by-char in suggesting mode (one tracked change per keystroke)
| Status | Acceptance criteria | Notes |
|---|---|---|
| ✅ | Contiguous same-author keystroke deletion (e.g. holding Backspace over a single run) results in one logical tracked deletion, not one per character. | The PR adds adjacent-deletion detection and folds a new keystroke delete into an existing same-user unresolved deletion (findAdjacentDeletedSegment + compileTextDelete coalescing). A focused test asserting one tracked deletion for repeated Backspace on "Beta" is added. |
| ✅ | Keystroke deletions that span run seams (including zero-width anchor nodes like Google-Docs comment/bookmark anchors) coalesce into one tracked deletion. | The PR adds isCoalescibleDeletionGap and a ZERO_WIDTH_ANCHOR_NODE_NAMES set and uses them when searching nearby same-user deletions so deletions spanning empty structural/anchor gaps fold together. A test exercising deletion across a Google-Docs run seam is included. |
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
andrii-harbour
left a comment
There was a problem hiding this comment.
Well done! I have only optional comments, up to you to address them or merge as is
…s and clarify membership rules
…-char-by-char-in-suggesting-mode
…-char-by-char-in-suggesting-mode
Issue
In suggesting mode, deleting a contiguous run keystroke-by-keystroke (Backspace/Delete) created one tracked change per character instead of one logical deletion. It also re-fragmented at run seams - e.g. Google-Docs multi-run paragraphs where comment-anchor markers sit between runs. (SD-3358)
Proposed solution
When a tracked deletion is adjacent to the same author's existing unresolved deletion — directly, or separated only by zero-width markers (run boundaries, comment/bookmark anchors) with no live text between - reuse that change's id so the run coalesces into a single logical deletion. Mirrors the existing same-author insertion refinement. Covered by a new behavior test.