Skip to content

SD-3358 - tracked deletion is captured char by char in suggesting mode#3610

Merged
harbournick merged 9 commits into
mainfrom
gabriel/sd-3358-tracked-deletion-is-captured-char-by-char-in-suggesting-mode
Jun 3, 2026
Merged

SD-3358 - tracked deletion is captured char by char in suggesting mode#3610
harbournick merged 9 commits into
mainfrom
gabriel/sd-3358-tracked-deletion-is-captured-char-by-char-in-suggesting-mode

Conversation

@chittolinag
Copy link
Copy Markdown
Contributor

@chittolinag chittolinag commented Jun 2, 2026

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.

@chittolinag chittolinag requested a review from a team as a code owner June 2, 2026 22:03
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 2, 2026

SD-3358

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@andrii-harbour andrii-harbour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! I have only optional comments, up to you to address them or merge as is

Copy link
Copy Markdown
Collaborator

@harbournick harbournick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@harbournick harbournick merged commit 51c5f50 into main Jun 3, 2026
69 checks passed
@harbournick harbournick deleted the gabriel/sd-3358-tracked-deletion-is-captured-char-by-char-in-suggesting-mode branch June 3, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants