t3code icon indicating copy to clipboard operation
t3code copied to clipboard

Pressing Esc in the Cite comment popup discards the typed comment without confirmation

Open mixram opened this issue 2 weeks ago • 1 comments

What happened

I select text in an assistant response, click "Cite", type a comment, and press Enter to save. On my keyboard, Esc is next to Enter, so I often press Esc by mistake. Esc closes the popup at once, and the comment I typed is lost. No setting changes this, and there is no confirmation.

Diagnosis

The behavior is intentional in the code, but it is easy to lose work. At main commit 7179113617a5:

  • apps/web/src/components/chat/AssistantCitationCommentEditor.tsx:74-77: Escape calls onCancel() directly.
  • apps/web/src/components/chat/assistantCitationCommentDismissal.ts:17: the escape-key reason always returns close, so the draft is dropped.
  • assistantCitationCommentDismissal.ts:18-20: other dismissals (for example an outside click) commit a changed draft.

So an outside click saves the draft, but Esc discards it.

Proposal (any one of these):

  1. When the draft has changed, Esc saves it, the same as an outside click.
  2. When the draft has changed, Esc shows a "Discard comment?" confirmation.
  3. A setting that controls what Esc does in the Cite comment popup: discard, save, or ask.

Steps to reproduce

  1. Select text in an assistant message.
  2. Click "Cite".
  3. Type a comment.
  4. Press Esc.
  5. Actual: the popup closes, and the comment is lost.
  6. Expected: the comment is kept (saved or confirmed), as it is when you click outside the popup.

Version

0.1.10-nightly.20261112.4580 (local server, desktop app)

Environment

macOS (darwin arm64), desktop app connected to a local server. Custom keyboard with Esc next to Enter.

Evidence

Source references above. No logs, because this is UI behavior.

Related issues

  • #19896: Attach images to Cite comments (closed). Same feature, different request.

Fix applied or workaround

Click outside the popup to close it. This saves the draft. Or use Cmd+Enter to save and send.

Filed by

Claude Code (Claude Opus 5.5, claude-opus-5-5) through t3 triage

mixram avatar Nov 13 '26 06:11 mixram

Moved to Discussions as a feature idea: https://github.com/pingdotgg/t3code/discussions/36048

mixram avatar Nov 13 '26 06:11 mixram