fix(agents-server-ui): mobile composer submit (Send button + soft-keyboard Enter)#4402
Merged
Merged
Conversation
…board Enter) The Agent UI composer at /__agent_ui/ couldn't submit messages from mobile browsers (Android Chrome and iOS Chrome). Two distinct root causes, both fixed in MessageInput.tsx: Send button — tapping it blurred the textarea, the on-screen keyboard began dismissing, the viewport reflowed between pointerdown and pointerup, and the resulting click landed off the button. Fixed by preventDefault on pointerdown for non-mouse pointers so focus stays in the textarea; the click still dispatches normally. Soft-keyboard Enter — the keydown handler only matched `key === 'Enter'`, but Android Chrome / GBoard frequently report `key === 'Unidentified'` / `keyCode === 229` or route the return key through `beforeinput` as `insertLineBreak` with no matching `keydown`. Added `enterKeyHint="send"` so the keyboard surfaces a send-shaped action key and fires `keydown` reliably, an IME guard (`isComposing` / `keyCode === 229`) so committing IME candidates doesn't trigger a send, and a `beforeinput` fallback that submits on `insertLineBreak`. Fixes electric-sql#4401. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
icehaunter
approved these changes
May 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4401.
Problem
The agent UI composer at
/__agent_ui/silently dropped message submissions on mobile browsers — both Send button taps and virtual-keyboard Enter were non-functional. The textarea accepted text but nothing was ever sent.Two distinct root causes, both in
packages/agents-server-ui/src/components/MessageInput.tsx:Send button. Tapping the button blurred the textarea, the on-screen keyboard began dismissing, and the viewport reflowed between
pointerdownandpointerup. The resultingclicklanded off the button and the send never fired.Virtual-keyboard Enter. The
keydownhandler only matchede.key === 'Enter', but Android Chrome / GBoard frequently reportkey === 'Unidentified'/keyCode === 229(IME-coordinated path) or route the return key throughbeforeinputasinsertLineBreakwith no matchingkeydownat all.Fix
enterKeyHint="send"on the textarea so soft keyboards surface a send-shaped action key and (critically on Android Chrome) firekeydownwithkey === 'Enter'reliably.keydownhandler — skip submit whilee.nativeEvent.isComposingis true, and explicitly skipe.keyCode === 229(Android Chrome doesn't always setisComposing).onBeforeInputfallback matchinginputType === 'insertLineBreak'for soft keyboards that route the return key throughbeforeinputwithout a matchingkeydown.onPointerDownpreventDefault for non-mouse pointers on the Send button — keeps focus on the textarea so the on-screen keyboard doesn't dismiss, the viewport doesn't reflow between pointerdown and pointerup, and the resultingclicklands on the button as intended. Mouse pointers are excluded so desktop click behaviour is unchanged.Tested on
Verified locally against the bundled UI in
electricax/agents-server:latestwithpackages/agents-server-ui/distvolume-mounted in.Changeset
A patch-level
@electric-ax/agents-server-uichangeset is included (.changeset/agent-ui-mobile-submit.md).