Skip to content

fix(track-changes): handle ReplaceAroundStep in tracked changes mode (SD-2061)#2225

Merged
harbournick merged 5 commits intomainfrom
caio/sd-2061-handle-replacearoundstep-in-tracked-changes
Mar 3, 2026
Merged

fix(track-changes): handle ReplaceAroundStep in tracked changes mode (SD-2061)#2225
harbournick merged 5 commits intomainfrom
caio/sd-2061-handle-replacearoundstep-in-tracked-changes

Conversation

@caio-pizzol
Copy link
Contributor

When backspacing in tracked changes mode triggers a ReplaceAroundStep (e.g. at paragraph/list boundaries), convert it to a tracked single-character deletion instead of silently applying the structural change. This preserves paragraph numbering, font, and alignment.

Also fixes cursor positioning for ReplaceAroundStep transactions by checking selectionPos before tr.selectionSet, and merges adjacent trackDelete marks across run node boundaries so consecutive deletions appear as a single tracked change.

SD-2061: When backspacing in tracked changes mode triggers a
ReplaceAroundStep (e.g. at paragraph/list boundaries), convert it to a
tracked single-character deletion instead of silently applying the
structural change. This preserves paragraph numbering, font, and
alignment.

Also fixes cursor positioning for ReplaceAroundStep transactions by
checking selectionPos before tr.selectionSet, and merges adjacent
trackDelete marks across run node boundaries so consecutive deletions
appear as a single tracked change.
@linear
Copy link

linear bot commented Feb 28, 2026

Copy link

@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: e73966a012

ℹ️ 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".

Add 9 unit tests covering:
- Non-backspace ReplaceAroundStep blocking
- Backspace conversion to tracked single-char deletion
- selectionPos meta for cursor positioning
- findPreviousLiveCharPos skipping tracked-deleted text
- Mark merging across run node boundaries (same/different authors)
- selectionPos honored in trackedTransaction when tr.selectionSet is false

Also add numbering preservation assertion to the existing behavior test
for double-backspace at terminal period with bookmark-wrapped runs.
caio-pizzol and others added 3 commits February 28, 2026 16:59
Stop the merge loop at the first live (non-deleted) text node so
non-adjacent deletions within the search window are not incorrectly
collapsed into a single tracked change.
Increase default assertCommentHighlightExists timeout from 15s to 20s
to match what most callers already pass explicitly. Consolidate 4
sequential post-italic assertions into a single composite poll to
avoid multiplicative timeouts in webkit's slower rendering pipeline.
Copy link
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 8f3cbe4 into main Mar 3, 2026
8 checks passed
@harbournick harbournick deleted the caio/sd-2061-handle-replacearoundstep-in-tracked-changes branch March 3, 2026 19:53
@superdoc-bot
Copy link
Contributor

superdoc-bot bot commented Mar 3, 2026

🎉 This PR is included in superdoc-cli v0.2.0-next.62

The release is available on GitHub release

@superdoc-bot
Copy link
Contributor

superdoc-bot bot commented Mar 3, 2026

🎉 This PR is included in superdoc v1.17.0-next.66

The release is available on GitHub release

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.

2 participants