Fixes #2478
Problem#
On mobile web viewports, pressing the software keyboard's Enter key immediately submits the composer. That makes it impossible to write a multi-line prompt without switching to another input method.
Root cause#
ChatComposer already tracks whether the composer is rendered at a mobile viewport, but its command-key handler treated every unshifted Enter press as a submit action. The handler consumed the event before Lexical could insert a line break.
Fix#
- Allow plain Enter to fall through to Lexical on mobile viewports so it inserts a newline.
- Preserve the existing desktop behavior: plain Enter submits and Shift+Enter inserts a newline.
- Add focused unit coverage for the mobile and desktop decision matrix.
Visual verification#
Verified in the live web app at a 390 x 844 viewport.
- Left: baseline after pressing Enter;
First line was submitted immediately.
- Right: fixed behavior after pressing Enter and typing
Second line; both lines remain in the composer.

The interaction-state GIF alternates between the baseline submitted state and the fixed multiline draft state:

The fixed editor DOM contained a <br> between the two lines, and the route remained a draft rather than creating a submitted thread.
Validation#
vp check (passes; reports existing react(no-unstable-nested-components) warnings outside this diff)
vp run typecheck
pnpm --filter @t3tools/web test - 148 files, 1,283 tests passed
- Playwright browser verification at 390 x 844
Web/shared impact#
This only changes the web chat composer keyboard behavior at mobile viewport widths. Desktop plain-Enter submission is covered by the new test and remains unchanged. The native mobile app, server, provider adapters, shared packages, and contracts are unaffected.
Migration/deploy impact#
None. There are no schema, migration, API, auth, session, realtime transport, or deployment configuration changes.
Post-deploy smoke check#
- Open the web app at a mobile viewport.
- Type one line, press Enter, and type a second line.
- Confirm both lines remain in the composer until the send button is tapped.
- On desktop, confirm plain Enter still submits and Shift+Enter still inserts a newline.
Note
Fix Enter key submission behavior in mobile chat composer#
On mobile viewports, pressing plain Enter in the chat composer no longer submits the message. A new shouldSubmitComposerOnEnter helper in composer-logic.ts centralizes the logic: returns true only on non-mobile viewports without Shift held. ChatComposer now delegates to this helper instead of checking !event.shiftKey alone.
Macroscope summarized 26e49d1.
Note
Low Risk
Narrow web-only keyboard UX change in the chat composer with unit tests; no API, auth, or server impact.
Overview
On mobile web (max-sm), plain Enter in the chat composer no longer submits—the command-key handler only intercepts Enter when shouldSubmitComposerOnEnter says so, so Lexical can insert a line break.
Adds shouldSubmitComposerOnEnter in composer-logic.ts (submit when desktop and not Shift+Enter). ChatComposer wires it with existing isMobileViewport instead of treating every unshifted Enter as send. Desktop behavior is unchanged: Enter sends, Shift+Enter newline. Send on mobile stays via the send button / form submit path.
Unit tests cover desktop Enter, mobile Enter, and Shift+Enter.
Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 26e49d1bf50feaea79ef10f116ea2978e6493f0e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
53309fc0-2edc-4244-bdf2-4130ae3d0afbYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share