Universal submit shortcut: ⌘/Ctrl+Enter sends in every input
Key-convention policy, settled: every field accepts ⌘/Ctrl+Enter (metaKey || ctrlKey — Mac gets ⌘↵, Windows/Linux Ctrl↵, the Gmail convention); plain Enter stays matched to the field's species — sends in message fields (chat composer, free-text answers — the universal chat convention, Shift+Enter still a newline), newline in the thinking field (composition, for dumping).
This commit is contained in:
@@ -42,7 +42,10 @@ export function Composer({
|
||||
value={value}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter" && !e.shiftKey) {
|
||||
// Chat convention: Enter sends, Shift+Enter is a newline.
|
||||
// ⌘/Ctrl+Enter also sends — the universal submit shortcut
|
||||
// across every input in the app (thinking field, answers).
|
||||
if (e.key === "Enter" && (e.metaKey || e.ctrlKey || !e.shiftKey)) {
|
||||
e.preventDefault();
|
||||
if (busy) onStop();
|
||||
else if (canSend) onSend();
|
||||
|
||||
Reference in New Issue
Block a user