Skip to content

feat: change send message from Enter to Shift+Enter#601

Open
hahaQWQ wants to merge 1 commit intomainfrom
dev/send-message-key
Open

feat: change send message from Enter to Shift+Enter#601
hahaQWQ wants to merge 1 commit intomainfrom
dev/send-message-key

Conversation

@hahaQWQ
Copy link
Copy Markdown
Collaborator

@hahaQWQ hahaQWQ commented Mar 28, 2026

Note

Low Risk
Low risk: a single UI keybinding change in the chat input with no backend, auth, or data-model impact; main risk is minor UX regression for users accustomed to Enter-to-send.

Overview
Updates the chat message composer so sendMessage triggers on Shift+Enter rather than Enter, changing the primary keyboard shortcut for sending messages.

Written by Cursor Bugbot for commit 94d7446. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the chat input to trigger message sending on Shift+Enter instead of Enter. Feedback highlights that using Shift+Enter on a standard text input is counter-intuitive as it does not support multi-line text, effectively disabling the Enter key for users without providing additional functionality. The reviewer suggests switching to a textarea to properly support multi-line messages and using the .prevent modifier on the key event.

:placeholder="t('chat.typeAMessage')"
class="h-10 w-full border-transparent bg-transparent pl-14 pr-14 text-base text-foreground shadow-none transition-all md:h-14 placeholder:text-foreground/45 focus-visible:ring-0"
@keyup.enter="sendMessage"
@keyup.shift.enter="sendMessage"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

This change maps Shift+Enter to send a message, which is a common pattern to allow for multi-line messages. However, the component used here is an <input type="text">, which does not support multi-line input.

As a result, pressing Enter alone now does nothing, and the user cannot create new lines. This creates a confusing user experience where a common key has no effect.

To properly support multi-line messages, you should use a <textarea> instead of an <input type="text">. With a <textarea>, Enter would create a new line, and Shift+Enter could send the message. I'd also recommend using the @keydown event with the .prevent modifier to avoid inserting a newline character when sending the message.

            @keydown.shift.enter.prevent="sendMessage"

Copy link
Copy Markdown

@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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

:placeholder="t('chat.typeAMessage')"
class="h-10 w-full border-transparent bg-transparent pl-14 pr-14 text-base text-foreground shadow-none transition-all md:h-14 placeholder:text-foreground/45 focus-visible:ring-0"
@keyup.enter="sendMessage"
@keyup.shift.enter="sendMessage"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Inconsistent send shortcut between chat pages

Medium Severity

This change makes the regular chat page use Shift+Enter to send, while ai-chat.vue uses Enter (without Shift) to send. These are opposite conventions within the same application, which will confuse users switching between the two chat interfaces. Additionally, using Shift+Enter on a single-line Input (type="text") is unconventional since single-line inputs don't support newlines — the typical reason for a Shift+Enter send pattern.

Fix in Cursor Fix in Web

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.

1 participant