fix(web): Backspace after a list shortcut restores the typed marker#31989

closed2
main
GitHub fork: fix/composer-backspace-restores-list-marker
opened6d agobyEefemaer
View on GitHubTwo-way sync enabledPR last imported 1d ago

Problem

With the rich text composer on, typing + , * or 1. turns the line into a list. Backspace right after that deletes the marker you typed and leaves an empty line, so you can't type a line that starts with a literal + . Backspace already undoes the > and # shortcuts.

Fixes #31988.

Change

backspaceAcrossList replaces Tiptap's default Backspace for list items. The default runs undoInputRule first, and the replacement skipped that step. It now runs undoInputRule first, as the default does. Backspace anywhere else in a list works as before, because undoInputRule only acts right after a shortcut fires.

Scope and approval

This is a one-line fix for an obvious bug, so it qualifies for the small-fix exception. Backspace should undo a Markdown shortcut you just triggered, and the composer already does that for quotes and headings. It changes no defaults and adds no setting.

Verification

  • A new case in ComposerPromptEditorTiptap.input.browser.test.tsx types each marker into the real composer and presses Backspace. On main all three fail with expected '' to be '+ ' (and the same for * and 1. ). With the fix all three pass.
  • vp test run on the five composer suites passes 347 of 347. vp run check:changed passes.
  • Real client (vp run dev, Browser panel). I typed + , pressed Backspace, then typed something. Before Backspace the editor held a bulletList with marker +. After it held one paragraph, + something, and that is the text that sends.
  • Mobile does not use this code. Nothing in apps/mobile imports Tiptap or composer-rich-text-doc.ts.

Written with Claude Opus 5.5 in Claude Code, run from T3 Code.

🤖 Generated with Claude Code

Checks

23 successful · 11 skipped
All checks passed
93fdaaa

Added 2 commits

  • fix(web): Backspace after a list shortcut restores the typed marker93fdaaa
  • test(web): cover Backspace right after a list shortcutcd73336
Synced from GitHub

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code Review✅ Completed 2026-11-06T12:41:12.068812Z93fdaaaDraft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Synced from GitHub

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Backspace now attempts to undo a list input rule before applying existing list-boundary handling. Browser tests cover + , * , and 1. shortcuts.

Changes: List shortcut Backspace behavior

Layer / File(s)Summary
Undo list shortcuts on Backspace
apps/web/src/composer-rich-text-doc.ts, apps/web/src/components/ComposerPromptEditorTiptap.input.browser.test.tsx
backspaceAcrossList now calls undoInputRule() and consumes Backspace when undo succeeds. Tests check that each supported shortcut becomes plain text after Backspace.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: t3dotgg

Merge Risk: External image Minimal · up to 93fda

Backspace restores list shortcuts, with no identified merge-blocking issue.

Pre-merge checks: Passed 4

Check nameStatusExplanation
Title checkPassedThe title clearly describes the main change.
Description checkPassedThe description covers the problem, change, scope, and verification. It does not include the required before-and-after screenshots or an interaction recording.
Linked Issues checkPassed[#31988] backspaceAcrossList runs undoInputRule before existing list handling. The new browser test checks that Backspace restores + , * , and 1. as paragraph text.
Out of Scope Changes checkPassed[#31988] The list Backspace change and its browser tests support the web composer fix. The summary shows no unrelated changes.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
External image Recent review info

External image Run configuration

External image Commits

Reviewing files that changed from the base of the PR and between 6577c6b6185167c0e502fa01f9e8e8f2dee6ff25 and 93fdaaaab86edc40710e7cb831ea3d95a808b23c.

External image Files selected for processing: 2

  • apps/web/src/components/ComposerPromptEditorTiptap.input.browser.test.tsx
  • apps/web/src/composer-rich-text-doc.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Thanks for this. #32005 makes the same change and is the one being kept: Keep #32005 instead: it fixes the same open issue, #31988, with equivalent input-rule undo before list handling. It is the more complete verification package, covering all three reported markers plus a blockquote control at the editor layer; GitCafe reports no conflicts and all 34 checks passing. All 3,628 open PRs were paged. Fresh main still lacks the undo and regression case; distinctive-line history searches found neither. No merge commits since this PR's base touch its files; the sole intervening file-touching commit is 88109ce, an unrelated model-mention change. No project code, tests, or scripts were executed.

Closing as a duplicate.