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;