IME Send action on the chat composer — enter sends

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Paul Hitt
2026-08-28 15:35:01 -04:00
co-authored by Claude Opus 4.8
parent 4d77e21cf9
commit 91ab857107
@@ -1429,6 +1429,19 @@ fun ColumnScope.ChatScreen(
color = MaterialTheme.colorScheme.onSurface, color = MaterialTheme.colorScheme.onSurface,
), ),
cursorBrush = SolidColor(MaterialTheme.colorScheme.primary), 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"), modifier = Modifier.fillMaxWidth().testTag("draft"),
) )
} }