From 91ab857107f9bd79144fb828f3b41c2cfa036be9 Mon Sep 17 00:00:00 2001 From: Paul Hitt Date: Fri, 28 Aug 2026 15:35:01 -0400 Subject: [PATCH] =?UTF-8?q?IME=20Send=20action=20on=20the=20chat=20compose?= =?UTF-8?q?r=20=E2=80=94=20enter=20sends?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 --- .../kotlin/io/flamenet/messenger/app/ChatScreens.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/kotlin/io/flamenet/messenger/app/ChatScreens.kt b/app/src/main/kotlin/io/flamenet/messenger/app/ChatScreens.kt index 19ea61c..91c1db0 100644 --- a/app/src/main/kotlin/io/flamenet/messenger/app/ChatScreens.kt +++ b/app/src/main/kotlin/io/flamenet/messenger/app/ChatScreens.kt @@ -1429,6 +1429,19 @@ fun ColumnScope.ChatScreen( color = MaterialTheme.colorScheme.onSurface, ), cursorBrush = SolidColor(MaterialTheme.colorScheme.primary), + // Return sends — same convention iOS now defaults to. The + // send button stays for anyone who taps instead. + singleLine = true, + keyboardOptions = androidx.compose.foundation.text.KeyboardOptions( + imeAction = androidx.compose.ui.text.input.ImeAction.Send), + keyboardActions = androidx.compose.foundation.text.KeyboardActions( + onSend = { + if (draft.isNotBlank()) { + model.sendMessage(draft) + draft = "" + } + } + ), modifier = Modifier.fillMaxWidth().testTag("draft"), ) }