Skip to content

fix(chat): Improved message editing UX by adding Escape key cancellation and removing auto-save on blur #1589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 1, 2025

Conversation

Mathieu2301
Copy link
Contributor

Problem

I was frequently frustrated while editing messages I had sent to Copilot.
When looking up information in my notes, I would accidentally click outside the message being edited, which would cause it to lose focus and automatically save/send the half-modified message to Copilot. This generated unnecessary AI responses and disrupted my workflow. This happened multiple times and made message editing feel unreliable.

Solution

Implemented a better message editing flow:

  • Escape key: Cancels editing and restores the original message
  • Enter key: Saves and sends the modified message
  • Lost focus: No action taken (no more accidental saves)

This provides explicit user control over when edits are saved or cancelled, preventing accidental message submissions.

Changes

  • Added Escape key handler to cancel message editing
  • Removed onBlur save behavior to prevent accidental saves
  • Message editing now requires intentional user action (Enter or Escape)

Testing

Tested in real conditions within my Obsidian vault.

Pressing Escape while editing a message now cancels the edit and restores the original message. Also removed onBlur save behavior to prevent accidental saves when focus is lost.
@logancyang
Copy link
Owner

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ BugBot reviewed your changes and found no bugs!


BugBot free trial expires on July 22, 2025
You have used $0.00 of your $50.00 spend limit so far. Manage your spend limit in the Cursor dashboard.

Was this report helpful? Give feedback by reacting with 👍 or 👎

@logancyang logancyang merged commit 50b3389 into logancyang:master Jul 1, 2025
3 checks passed
@logancyang logancyang mentioned this pull request Jul 1, 2025
wenzhengjiang pushed a commit that referenced this pull request Jul 9, 2025
Pressing Escape while editing a message now cancels the edit and restores the original message. Also removed onBlur save behavior to prevent accidental saves when focus is lost.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants