From 471497ddb41b094fc3b5d9a10128c2b062e86b9c Mon Sep 17 00:00:00 2001 From: Philip Zeyliger Date: Sat, 10 Jan 2026 21:33:59 -0800 Subject: [PATCH] shelley: don't submit on Enter for mobile input I'm not convinced this is going to work for me, but let's try it and see. Prompt: In a new worktree, make the mobile input for enter not send the message since the send button is right there. On mobile devices, pressing Enter should create a newline instead of submitting the message. Users have the send button readily available for submission, and newlines are common in mobile messaging. --- ui/src/components/MessageInput.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/src/components/MessageInput.tsx b/ui/src/components/MessageInput.tsx index fc3e545e0bf50ff43eeeb2950e04531cd6f463a7..416883fed48b713603edef36d5c67e6179cea02d 100644 --- a/ui/src/components/MessageInput.tsx +++ b/ui/src/components/MessageInput.tsx @@ -309,6 +309,13 @@ function MessageInput({ return; } if (e.key === "Enter" && !e.shiftKey) { + // On mobile, let Enter create newlines since there's a send button + // I'm not convinced the divergence from desktop is the correct answer, + // but we can try it and see how it feels. + const isMobile = "ontouchstart" in window; + if (isMobile) { + return; + } e.preventDefault(); handleSubmit(e); }