Repository navigation
fix(web): saving an unchanged citation comment no longer adds an empty undo step - #43446
BenjaminPeters-code wants to merge 4 commits into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…mment-no-undo-step
…mment-no-undo-step # Conflicts: # apps/web/src/components/ComposerPromptEditorTiptap.citationDraft.browser.test.tsx
EvidenceLinux Chromium 156, 1280×800, light theme; fresh isolated databases with identical synthetic Replay (dev) Showcase data. Steps: open the finished response → select its final paragraph using the browser Selection API → click Cite → press Enter with the optional comment empty → press Ctrl+Z once.
The paired runner completed with exit 0; captures were visually inspected. Not shown:
|
|
The automated pipeline stopped on this pull request and will not merge it: someone else pushed to fix/cite-unchanged-comment-no-undo-step (head is now be12939); the pipeline does not build on commits it did not review It stays open for a person to finish or close. |
…mment-no-undo-step # Conflicts: # apps/web/src/components/ComposerPromptEditorTiptap.citationDraft.browser.test.tsx
|
Note Claude Opus 5.5 posting on behalf of Benjamin Sorry, my merges of main into this branch (be12939, 2ab2f57) stopped the pipeline. I only meant to clear the conflict after #43444 and #43445 landed. The fix itself is unchanged: against main the PR still only adds the early return in |




Problem
Saving a citation comment always writes the citation node again, even when the comment did not change. Pressing Enter in the empty comment box of a new citation is the normal flow, so that save records an undo step that changes nothing. The first Cmd+Z after citing appears to do nothing; only the second removes the citation.
Steps (web, any thread with a response):
Expected: the citation is removed.
Actual: the chip is still there. A second Cmd+Z removes it.
Change
onSaveCommentreturns early when the comment after trimming equals the saved one, so no transaction and no undo step are recorded. It still returnstrue, so Enter closes the box and save-and-send still sends.Scope
A small fix of an obvious bug, so no issue. I searched open and closed issues and PRs for "undo citation", "undo cite composer", "Cmd+Z citation", "undo twice citation", "citation comment undo" and "cite undo", and found none. The only related item is #32550 (open, a Delete button for citations), whose undo work is about restoring a deleted citation, not this empty step.
Verification
ComposerPromptEditorTiptap.citationDraft.browser.test.tsx: add a comment through the pencil, open it again and save it unchanged, then one undo must remove the comment. Onmainit fails: the prompt still has&comment=checkafter one undo, because that undo only reverted the empty step. With the fix it passes, which also shows that saving a changed comment is still one undo step. 6 passed.vp run check:changed: format, lint, knip, typecheck, tests and React Compiler all pass.mainthe chip is still there after one Cmd+Z; with the fix one Cmd+Z removes it.vp run dev:desktop(Electron) with this fix, against main on the same commit. Main shows the bug, this fix removes it.Before:
After:
Claude Opus 5.5 in Claude Code did the work.