fix(track-changes): allow backspace on empty list items in suggesting mode (SD-2187)#2472
Conversation
… mode (SD-2187) When all text in a list item was deleted in suggesting mode (marked as trackDelete), pressing backspace to remove the bullet did nothing. The replaceAroundStep handler blocked the structural change because findPreviousLiveCharPos returned null (no un-deleted text left). Allow the structural ReplaceAroundStep (e.g. lift out of list) to apply when there are no live characters remaining. Structural changes aren't tracked yet, but blocking them leaves the user stuck on an empty bullet they can't remove.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4cc21ad078
ℹ️ 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".
|
🎉 This PR is included in superdoc-sdk v1.2.0 |
|
🎉 This PR is included in superdoc-cli v0.4.0 The release is available on GitHub release |
|
🎉 This PR is included in superdoc v1.23.0 The release is available on GitHub release |
|
🎉 This PR is included in esign v2.2.0-next.3 The release is available on GitHub release |
|
🎉 This PR is included in template-builder v1.3.0-next.2 The release is available on GitHub release |
Demo
CleanShot.2026-03-19.at.15.20.55.mp4
Summary
replaceAroundStephandler blocked structural changes (e.g. lift out of list) whenfindPreviousLiveCharPosreturned null, leaving the user stuck on an undeletable empty bulletReplaceAroundStepto apply directly instead of blocking itRoot Cause
The
replaceAroundStephandler (introduced in PR #2225 / SD-2061) converts backspaceReplaceAroundStepoperations into tracked single-character deletions. When all text in a list item is already marked astrackDelete,findPreviousLiveCharPos()returnsnulland the handler returned early, blocking the structural change entirely.The fix allows the structural step to pass through when the content is effectively empty. Structural changes aren't tracked yet (as noted in the ticket), but blocking them is worse than applying them untracked.
Test plan