feat: change send message from Enter to Shift+Enter#601
Conversation
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
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" |
There was a problem hiding this comment.
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.


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
sendMessagetriggers onShift+Enterrather thanEnter, changing the primary keyboard shortcut for sending messages.Written by Cursor Bugbot for commit 94d7446. This will update automatically on new commits. Configure here.