Skip to content

Commit fb7008a

Browse files
committed
ux: Enter sends, Shift+Enter for newline (was Cmd/Ctrl+Enter to send). Also guards against IME composition with isComposing.
1 parent b9a2b03 commit fb7008a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h1>Gemma <span class="sub">on a 5090</span></h1>
3636
<div id="messages"></div>
3737
<form id="composer">
3838
<div id="imagePreview" class="image-preview"></div>
39-
<textarea id="prompt" placeholder="ask Gemma… paste/drop images, ⌘/ctrl+Enter to send" rows="3"></textarea>
39+
<textarea id="prompt" placeholder="ask Gemma… paste/drop images, Enter to send (Shift+Enter for newline)" rows="3"></textarea>
4040
<div class="composer-row">
4141
<button id="attach" type="button" title="attach image">📎 image</button>
4242
<input id="fileInput" type="file" accept="image/*" multiple hidden />

src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ els.newChat.addEventListener('click', newConversation);
327327
els.prompt.addEventListener('input', updateSendEnabled);
328328

329329
els.prompt.addEventListener('keydown', (e) => {
330-
if ((e.metaKey || e.ctrlKey) && e.key === 'Enter') {
330+
if (e.key === 'Enter' && !e.shiftKey && !e.isComposing) {
331331
e.preventDefault();
332332
els.composer.requestSubmit();
333333
}

0 commit comments

Comments
 (0)