[codex] fix mobile composer Enter behavior#3930
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the 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. Comment |
ApprovabilityVerdict: Approved Simple, well-tested bug fix that adjusts Enter key behavior on mobile viewports. The new utility function is straightforward boolean logic with clear test coverage documenting the expected behavior. You can customize Macroscope's approvability policy. Learn more. |
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
ChatComposeralready 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
Visual verification
Verified in the live web app at a 390 x 844 viewport.
First linewas submitted immediately.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 existingreact(no-unstable-nested-components)warnings outside this diff)vp run typecheckpnpm --filter @t3tools/web test- 148 files, 1,283 tests passedWeb/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
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
shouldSubmitComposerOnEnterhelper incomposer-logic.tscentralizes the logic: returnstrueonly on non-mobile viewports without Shift held.ChatComposernow delegates to this helper instead of checking!event.shiftKeyalone.Macroscope summarized abfd136.
Note
Low Risk
Localized web composer keyboard handling with no API, auth, or data changes; desktop submit behavior is preserved and covered by tests.
Overview
On mobile web viewports, plain Enter in the chat composer no longer triggers send.
ChatComposernow callsshouldSubmitComposerOnEnterinstead of treating every unshifted Enter as submit, so the key can reach Lexical and add a line break.Desktop behavior is unchanged: plain Enter still submits; Shift+Enter still adds a newline. The decision lives in
composer-logic.tswith unit tests for mobile, desktop, and Shift+Enter.Reviewed by Cursor Bugbot for commit abfd136. Bugbot is set up for automated code reviews on this repo. Configure here.