Skip to content

fix: Shift+Enter now inserts newline when Ctrl+Enter to send is enabled#10829

Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
fix/shift-enter-newline-10386
Draft

fix: Shift+Enter now inserts newline when Ctrl+Enter to send is enabled#10829
roomote-v0[bot] wants to merge 1 commit intomainfrom
fix/shift-enter-newline-10386

Conversation

@roomote-v0
Copy link
Copy Markdown
Contributor

@roomote-v0 roomote-v0 bot commented Jan 18, 2026

This PR attempts to address Issue #10386. Feedback and guidance are welcome.

Problem

When "Ctrl+Enter to send" mode is enabled (enterBehavior === "newline"), pressing Shift+Enter was sending the message instead of inserting a newline. This was contrary to user expectations and standard text editing behavior.

Root Cause

In ChatTextArea.tsx, the handleKeyDown function had event.shiftKey included in the send condition:

if (event.shiftKey || event.ctrlKey || event.metaKey) {
    onSend()
}

Solution

Removed event.shiftKey from the condition so only Ctrl/Cmd+Enter triggers send:

if (event.ctrlKey || event.metaKey) {
    onSend()
}

Expected Behavior After Fix

When enterBehavior === "newline" (Ctrl+Enter to send enabled):

  • Enter - inserts a new line
  • Shift+Enter - inserts a new line (fixed)
  • Ctrl/Cmd+Enter - sends the message

Testing

  • Updated existing test to verify the corrected behavior
  • All 47 tests in ChatTextArea.spec.tsx pass

Closes #10386


Important

Fix ChatTextArea.tsx to allow Shift+Enter to insert newline when Ctrl+Enter to send is enabled, updating tests accordingly.

  • Behavior:
    • Fix handleKeyDown in ChatTextArea.tsx to remove event.shiftKey from send condition, allowing Shift+Enter to insert newline when enterBehavior === "newline".
    • Updated behavior: Enter and Shift+Enter insert newline; Ctrl/Cmd+Enter sends message.
  • Testing:
    • Update test in ChatTextArea.spec.tsx to verify Shift+Enter inserts newline and Ctrl/Cmd+Enter sends message.
    • All 47 tests in ChatTextArea.spec.tsx pass.

This description was created by Ellipsis for fe682d8. You can customize this summary. It will automatically update as commits are pushed.

Interactively review PR in Roo Code Cloud

@roomote-v0
Copy link
Copy Markdown
Contributor Author

roomote-v0 bot commented Jan 18, 2026

Rooviewer Clock   See task on Roo Cloud

Reviewed the changes and found no issues. The fix correctly removes event.shiftKey from the send condition so that Shift+Enter now inserts a newline when Ctrl+Enter to send is enabled. Test coverage is comprehensive.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

…ode is enabled

Removes event.shiftKey from the send condition in ChatTextArea when
enterBehavior is "newline", so that only Ctrl/Cmd+Enter sends the
message. Shift+Enter and plain Enter now both insert newlines as
expected.

Fixes #10386
@roomote-v0 roomote-v0 bot force-pushed the fix/shift-enter-newline-10386 branch from fe682d8 to 08ce747 Compare April 1, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] Shift Enter sends chat message instead of adding a new line

1 participant