GeezerVison is showing github.com — fix(web): saving an unchanged citation comment no longer adds an empty undo step by BenjaminPeters-code · Pull Request #43446 · pingdotgg/t3code
Conversation
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):
- Select text in a response and click Cite.
- Press Enter in the empty comment box.
- Press Cmd+Z.
Expected: the citation is removed.
Actual: the chip is still there. A second Cmd+Z removes it.
Change
onSaveComment returns early when the comment after trimming equals the saved one, so no transaction and no undo step are recorded. It still returns true, 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
- New browser test in
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. On main it fails: the prompt still has &comment=check after 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.
- The existing test "clears the sent prompt when an empty citation comment sends it" passes, so save-and-send with an unchanged comment still sends.
- In the real web app (e2e scenario, headless Chromium, Replay provider) with the steps above: on
main the chip is still there after one Cmd+Z; with the fix one Cmd+Z removes it.
- Desktop app: checked in
vp run dev:desktop (Electron) with this fix, against main on the same commit. Main shows the bug, this fix removes it.
- Not checked: touch input. The mobile app has its own native composer and is not touched.
Before:
After:
Claude Opus 5.5 in Claude Code did the work.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
The citation comment save handler now skips its node-update transaction when the submitted comment matches the existing comment. A browser test checks that undo restores the original prompt after an unchanged save.
Changes: Citation comment undo
| Layer / File(s) |
Summary |
Skip unchanged citation updates apps/web/src/components/ComposerPromptEditorTiptap.tsx, apps/web/src/components/ComposerPromptEditorTiptap.citationDraft.browser.test.tsx |
The save handler skips the node-update transaction when the comment is unchanged. The browser test saves an unchanged comment and checks that the platform-appropriate undo shortcut restores the original prompt. |
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Possibly related PRs
Suggested labels: bugfix
Suggested reviewers: juliusmarminge, macroscopeapp
Merge Risk: Minimal · up to 2ab2f
-
Saving an unchanged citation comment no longer adds an empty undo step, and the change is small and localized. No merge-blocking risk was found.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: saving an unchanged citation comment no longer adds an empty undo step. It follows the conventional commit form and matches the code change (early return in onSaveComm… |
| Description check |
 |
The description covers the problem with reproduction steps and expected versus actual behavior. It explains the change and why no transaction is recorded. The scope section explains why no issue is li… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the main change: saving an unchanged citation comment no longer adds an empty undo step. It follows the conventional commit form and matches the code change (early return in onSaveComment) and the new browser test. It is specific and not vague.
Full details: Description check
-
Explanation
The description covers the problem with reproduction steps and expected versus actual behavior. It explains the change and why no transaction is recorded. The scope section explains why no issue is linked and searches for duplicates. Verification lists focused tests, the existing test, web and desktop checks, and states what was not checked (touch input). It includes before and after screenshots. It follows the template closely and states the agent used, so it is complete.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between be12939 and 2ab2f57.
Files selected for processing: 1
-
apps/web/src/components/ComposerPromptEditorTiptap.citationDraft.browser.test.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…mment-no-undo-step
# Conflicts:
# apps/web/src/components/ComposerPromptEditorTiptap.citationDraft.browser.test.tsx
Evidence
Linux 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.
Scenario source
The paired runner completed with exit 0; captures were visually inspected.
Not shown:
- Saving an existing non-empty comment unchanged was not exercised.
- macOS Cmd+Z was not exercised; this proof uses Linux Ctrl+Z.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…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 onSaveComment and its test. I won't push to this branch again; feel free to take it over, rebuild it, or close it in favour of your own commit.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|