From 952e8d646332e1f130e13773b1e2a98381efe91c Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Sat, 22 Aug 2026 11:33:30 +0300 Subject: [PATCH] feat: require Cmd/Ctrl+Enter to send in expanded chat composer Plain Enter now inserts a newline in the expanded composer Cmd/Ctrl+Enter still sends the message Helps avoid accidental sends while writing long prompts --- CHANGELOG.md | 1 + packages/ui/src/components/chat/ChatInput.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a18b2094..997ae7fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. - **Dictation:** speech is now transcribed after you stop recording. The composer shows a live waveform and timer, and long recordings split at pauses instead of cutting words. - Chat: file paths in messages now open from the session's project, even if you last browsed files in another project (thanks to @tomzx). - Diff: creating an inline comment now opens the chat and focuses the composer for your follow-up. +- Chat: in the expanded composer, Enter now starts a new line and Cmd/Ctrl+Enter sends, so a long prompt is harder to send by accident. - Providers: expanded support for custom providers. - Small Model: summaries, goal audits, commit messages, and walkthroughs now support more providers. - Git: generated commit messages now match the repository's recent commit style and language. diff --git a/packages/ui/src/components/chat/ChatInput.tsx b/packages/ui/src/components/chat/ChatInput.tsx index 27610e32..1ff3bca0 100644 --- a/packages/ui/src/components/chat/ChatInput.tsx +++ b/packages/ui/src/components/chat/ChatInput.tsx @@ -1625,8 +1625,12 @@ const ChatInputComponent: React.FC = ({ return; } - // Handle Enter/Ctrl+Enter based on selected follow-up behavior. - if (e.key === 'Enter' && !e.shiftKey && (!isMobile || e.ctrlKey || e.metaKey)) { + // Handle Enter/Ctrl+Enter based on selected follow-up behavior. On + // mobile, and in desktop focus mode, plain Enter writes a newline and + // only Cmd/Ctrl+Enter sends: both are surfaces for composing long + // prompts, where an accidental send costs more than an extra keypress. + const requiresModifierToSend = isMobile || isDesktopExpanded; + if (e.key === 'Enter' && !e.shiftKey && (!requiresModifierToSend || e.ctrlKey || e.metaKey)) { e.preventDefault(); const isCtrlEnter = e.ctrlKey || e.metaKey;