GeezerVison is showing github.com — fix(web): Cancel removes a new citation while dictation is recording by mrlufepines · Pull Request #32651 · pingdotgg/t3code
Conversation
mrlufepines
commented
Nov 7, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Problem
While voice input is recording in the chat composer, you can still select assistant text and click Cite. The citation is inserted and its comment box opens, but Cancel does nothing: the comment box stays open and the new citation stays in the draft.
Steps:
- Start voice input in the chat composer.
- While it records, select text in an assistant message and click Cite.
- In the comment box that opens, click Cancel.
Expected: the comment box closes and the citation you just inserted is removed, the same as when no recording is running (#10518).
Actual: nothing happens.
Cause: Cancel on a new citation calls onRemove in ComposerPromptEditorTiptap.tsx, which returns early when !editor.isEditable. While dictation runs, ChatComposer passes disabled={speechInput.freezesEditor}, so the editor is read-only and Cancel is a silent no-op. The citation insertion itself goes through a controlled value update, which does not check that flag, so the popover can open in this state.
Change
onRemove no longer bails out when the editor is read-only. It still deletes only the citation it inserted (plus the space it added), and it only moves focus into the editor when the editor is editable. The editable path is unchanged.
I chose "remove the new citation" over "just close the popover" because that is what Cancel means for a new citation everywhere else. Closing the box and leaving the chip would make Cancel behave differently depending on whether a recording happens to be running.
Not changed here: inserting a citation (or anything else) into the draft during a recording still makes the recording's transcript stale, so the transcript is refused when the recording stops. Cancel removing the citation does not undo that, because the draft revision has already moved. That is a separate problem, reported in #32653.
Scope and approval
No prior issue. This qualifies as a very small, focused fix for an obvious bug: a visible Cancel button that does nothing. The fix is one guard in one function plus one browser test, and it restores the behavior #10518 already defined for Cancel on a new citation. It does not change dictation or the read-only rules for typing. Save still refuses while the composer is read-only, as it does on main; that is left alone here.
Verification
Failing test first. Added cancels a new citation while dictation makes the composer read-only to ComposerPromptEditorTiptap.citationDraft.browser.test.tsx. It renders the editor with disabled (what dictation sets), opens the comment box for a newly inserted citation, clicks Cancel, and asserts the box is gone and the draft is back to "See ".
- On
main (25bf84a): fails, expected document not to contain element, found <textarea aria-label="Comment on selected text" ...>.
- With this change: passes.
Commands and results:
vp test run src/components/ComposerPromptEditorTiptap.citationDraft.browser.test.tsx src/components/chat/AssistantCitationChip.browser.test.tsx: 6 passed.
vp test run src/components/ComposerPromptEditorTiptap*.browser.test.tsx: 40 passed.
vp run check:changed: format, lint, knip, typecheck (2 packages), tests (2 files), React Compiler check all pass.
Real client, with a live recording. Local web dev client on isolated state, Chromium with a fake microphone (--use-fake-device-for-media-stream) and a local Whisper Tiny English model selected under Settings → Voice, so dictation really records. Same steps on both builds: type a line in the composer, start the microphone, select assistant text, Cite, then Cancel while the recording keeps running. Before is main at 25bf84a, after is this branch.
|
Before (main) |
After (this PR) |
| Citation inserted, comment box open |
 |
 |
| After clicking Cancel |
 |
 |
|
Comment box still open, citation still in the draft, recording still running (0:07) |
Comment box closed, draft back to Before merging, double-check this: , recording still running (0:08) |
Recording of the full sequence:
Before (main) |
After (this PR) |
 |
 |
MP4: before, after.
Not checked: the desktop app and a physical microphone. The recording above uses Chromium's fake audio device; the editor is read-only for the whole recording regardless of what the microphone captures.
Written by Claude Opus 5.5 in Claude Code, driven from T3 Code.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved at 012d7d5
Macroscope's review found this PR approvable — Cancel now removes a newly added citation during dictation without stealing editor focus. The change remains limited to citations marked for removal on cancellation and leaves other read-only editing restrictions intact.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 7, 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 removal handler can now remove a pending citation in a read-only editor. A browser test covers starting and cancelling a citation comment in a disabled composer.
Changes: Citation cancellation
| Layer / File(s) |
Summary |
Remove pending citations and verify cancellation apps/web/src/components/ComposerPromptEditorTiptap.tsx, apps/web/src/components/ComposerPromptEditorTiptap.citationDraft.browser.test.tsx |
The removal handler deletes the pending citation and eligible adjacent spaces in read-only mode. It focuses the editor only when editable. The browser test checks that cancellation closes the comment UI and restores the prompt to "See ". |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
- Issue 32653 concerns stale transcript and recording loss when a composer draft changes during dictation. This PR tests citation cancellation in a disabled composer, but does not address those behaviors.
Suggested reviewers: t3dotgg, juliusmarminge
Merge Risk: Minimal · up to ef3c0
-
Cancel removes the pending citation while recording. No material merge-blocking risk was identified.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title clearly summarizes the main change: Cancel removes a new citation while dictation is recording. |
| Description check |
 |
The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the issue, the fix, the scope, and the test results, and provides UI evidence. |
| 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. |
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 012d7d5 and ef3c0e7.
Files selected for processing: 2
-
apps/web/src/components/ComposerPromptEditorTiptap.citationDraft.browser.test.tsx
apps/web/src/components/ComposerPromptEditorTiptap.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
maria-rcks
commented
Nov 10, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Note Written by claude-opus-5-5 on behalf of Maria
Takeover update
merged current main into the branch with a merge commit (ef3c0e7aca). the only conflict was in ComposerPromptEditorTiptap.citationDraft.browser.test.tsx: main had added a send prop and two save-and-send tests, and the resolution keeps those alongside this pr's disabled prop and its cancel test. the source fix merged cleanly and is unchanged. no other code changes.
checks on the merged head, run through a blacksmith testbox: the citationDraft browser tests (5/5) and vp run check:changed (format, lint, knip, typecheck, tests, react compiler) all pass. ci on ef3c0e7aca reports 31/31 green with no conflicts. no review-bot findings to address.
Earlier verification (gpt-6.1-sol, head 012d7d5)
Verified in a real dev environment
verified head 012d7d5b1cfba8b22a4507de048f74fe9a9efa2d against github/main at 6c9adfb2739205244b84e607736f6fd8b4611e69 on linux. installed each checkout with vp i and ran one isolated dev server at a time.
used the repo's playwright with /usr/bin/google-chrome. created the project and thread through the app, then ran real codex gpt-6.1-sol turns to produce the cited assistant response. final captures use the vm's pulseaudio system input and local whisper tiny english, without chrome's fake audio device or mocked app/provider data.
- main: start dictation, select assistant text, cite, cancel. the comment box and citation remain, with recording active.
- pr: the same interaction closes the comment box, removes the citation, and restores exactly
Before merging, double-check this: while recording remains active and the editor reports contenteditable=false.
- nearby: normal citation cancel restores the draft; save retains the comment; cancelling an existing citation's comment retains the citation. finishing recording restores typing. after inserting/cancelling a citation, finishing reports
Draft changed, consistent with the limitation already described in this pr.
- also reproduced a pre-existing issue on both main and this head: type-to-focus can insert characters during recording despite the read-only editor. this pr does not address that separate path.
focused checks through blacksmith-check: vp test run apps/web/src/components/ComposerPromptEditorTiptap.citationDraft.browser.test.tsx apps/web/src/components/chat/AssistantCitationChip.browser.test.tsx passed all 6 tests. the head has 31 successful ci checks. no code changes or pushes were needed.
before, main after cancel:

after, pr after cancel:


Not verified
native desktop, ios/android, macos/windows, physical microphone capture, transcription accuracy, cloud speech services, and remote/relay connections were not exercised. this vm has a system audio monitor input rather than a physical microphone. the recording and cancellation path was exercised; speech recognition quality was not.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…uring-dictation
# Conflicts:
# apps/web/src/components/ComposerPromptEditorTiptap.citationDraft.browser.test.tsx
|
Thanks for this. Main has the change since #32682.
Main now removes a newly inserted citation and closes its comment box when Cancel is clicked during dictation. Compared the complete PR diff: its read-only guard removal, conditional focus behavior, and regression test are all included in the merge.
Closing as superseded.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XS
0-9 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
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.
|