Skip to content

Fix mobile composer touch behavior#2090

Draft
Noojuno wants to merge 2 commits intopingdotgg:mainfrom
Noojuno:t3code/mobile-composer-fixes
Draft

Fix mobile composer touch behavior#2090
Noojuno wants to merge 2 commits intopingdotgg:mainfrom
Noojuno:t3code/mobile-composer-fixes

Conversation

@Noojuno
Copy link
Copy Markdown
Contributor

@Noojuno Noojuno commented Apr 16, 2026

  • Use coarse-pointer detection to switch Enter handling
  • Increase composer text size on mobile
  • Surface sidebar actions on touch devices
  • Collapse composer on mobile by default; tap to expand

What Changed

Mobile touch UX improvements to the chat composer and sidebar:

  • Enter behavior on touch devices: Bare Enter inserts a newline; Cmd/Ctrl+Enter sends. Desktop behavior (Enter sends, Shift+Enter newlines) is unchanged.
  • Collapsed mobile composer: On small viewports, the composer starts collapsed as a single-line preview with an inline send button. Tapping anywhere on it expands the full editor. The composer re-collapses when focus leaves.
  • Composer text size: Uses text-base on small screens to avoid iOS auto-zoom on focus, stepping down to text-[14px] at sm and above.
  • Sidebar touch targets: The cloud icon is hidden on coarse-pointer devices and the new-thread button is always visible and tappable (no hover required).
  • Send button focus preservation: All send/action buttons call preventDefault on pointerDown to prevent stealing focus from the editor on touch devices.

Why

On mobile/touch devices, the composer was hard to use: Enter would send instead of adding newlines (no physical Shift key), text was too small (triggering iOS auto-zoom), sidebar actions were hidden behind hover states that don't exist on touch, and the full composer took up too much vertical space on small screens.

UI Changes

Composer collapsed (mobile default):

  • Single-line bar showing the current prompt text (or placeholder), with an inline send button.

Composer expanded (after tap):

  • Full multi-line editor with all toolbars, same as desktop. Collapses again when focus leaves the composer surface.

Sidebar:

  • New-thread button always visible on touch devices instead of requiring hover.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 16, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c6ff421b-7e91-4ffe-8396-1af6c65a0cec

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Apr 16, 2026
@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Apr 17, 2026
@Noojuno Noojuno force-pushed the t3code/mobile-composer-fixes branch from 953163e to 3f25fca Compare April 17, 2026 04:49
Noojuno and others added 2 commits April 18, 2026 00:31
- Use coarse-pointer detection to switch Enter handling
- Increase composer text size on mobile
- Surface sidebar actions on touch devices
Port the mobile composer collapse feature from PR pingdotgg#1263 into the
extracted ChatComposer component. On small viewports (<640px), the
composer collapses to a compact single-row bar showing truncated prompt
text and a send button when unfocused. Tapping expands the full
composer with editor focus; blurring collapses it back.

Also adds onPointerDown handlers on submit buttons to prevent iOS
from stealing focus before the click registers.

Co-authored-by: Hiram Chirino <hiram@hiramchirino.com>
@Noojuno Noojuno force-pushed the t3code/mobile-composer-fixes branch from 3f25fca to 1ba7e35 Compare April 17, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant