Before submitting#
Area#
apps/web (reproduced in the desktop app)
Steps to reproduce#
- Open a thread containing an assistant response.
- Select some text in the response and click Cite.
- In the citation comment popover, click Cancel or press Esc.
- Check the chat composer.
Expected behavior#
Cancelling a new citation should dismiss the popover and remove that citation from the composer, preserving any existing draft text and previously saved citations. Cancelling comment edits on an already saved citation should keep that citation and its original comment.
Actual behavior#
The popover closes, but the newly selected citation remains in the composer. The user has to remove it manually even though they cancelled the action.
Impact#
Minor bug or occasional failure
Version or commit#
Reproduced on main at 223ff4490 before the local fix.
Environment#
macOS, local T3 Code desktop development build (Electron 43.4.1). Originally observed in T3 Code Nightly.
Workaround#
Click the citation chip's remove button in the composer after cancelling.
Thanks for the clear repro. Confirmed on
mainat223ff4490— this is a real web/desktop composer bug, not a wash duplicate.What happens. Cite inserts the chip first, then opens the comment popover. Cancel/Esc only closes the popover.
ChatComposer.citeAssistantText→insertComposerTextwithcitationCommentAnchorwritesformatAssistantCitationForComposer(...)into the draft immediately, thenrequestCitationComment.ComposerPromptEditor/$consumeComposerCitationCommentRequestopens the popover on the newComposerCitationNode.AssistantCitationChipCancel/Esc isonCancel={() => commentEditor.onOpenChange(false)}, which only clearsopenCitationComment. It never runs the existingonRemovepath.New cites carry a
sourceAnchor; pencil-edits of an already-saved chip do not. That is enough to tell “undo this insert” from “discard a comment edit.” Clicking outside the popover uses the sameonOpenChange(false)path, so a leftover chip is likely there too unless dismiss is handled the same way as Cancel/Esc.Not already fixed upstream. No open PR covers cancel-of-new-citation. #10374 (same author) is screenshots/preview annotations and is unrelated.
Related cite/composer history only: #9146 (feature), #9307 (Cmd+Enter send), #9306 (select-cite remount), #9499 (keep composer open while selecting). #9605 is Codex source citations, a different feature.
Next step. Please open a PR for the local fix:
ComposerPromptEditor.test.ts).Workaround until then: the citation chip’s remove button.