Skip to content

fix(mobile): keep Android composer caret in view - #7

Closed
macodev00 wants to merge 4 commits into
mainfrom
cursor/android-composer-caret-scroll-0ab8
Closed

macodev00 wants to merge 4 commits into
mainfrom
cursor/android-composer-caret-scroll-0ab8

Conversation

@macodev00

Copy link
Copy Markdown
Owner

Fixes pingdotgg#12690.

What Changed

On Android, a long multi-line composer prompt no longer leaves the current line off-screen while typing.

  • The expanded editor now takes a clamped height from the existing native onComposerContentSizeChange event (min 72, max 160). Collapsed composers still use a fixed height.
  • After text, selection, and layout updates, the native editor calls bringPointIntoView so the caret stays visible once that max height is reached. Echo re-renders that only refresh chip spans do not steal a manual scroll.

Thread composer and new-task composer share this editor, so both pick up the same behavior. Web already follows the caret via Tiptap scrollIntoView; this change is Android native.

Why

The reporter confirmed the box caps at max height, then typing continues off-screen. Yoga needs a concrete height to grow past minHeight, and Android had no caret-into-view call after controlled text/selection updates (setScrollEnabled only toggles the scrollbar).

UI Changes

Android native composer. No screenshots: this needs a device or emulator, and caret-follow is an interaction, not a static layout change.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes
Open in Web Open in Cursor 

After the expanded composer hits its max height, typing no longer
scrolled the current line into view, so long prompts were entered
blind. Grow the editor from the native content-size event up to that
cap and call bringPointIntoView after text, selection, and layout
updates.
@cursor

cursor Bot commented Sep 20, 2026

Copy link
Copy Markdown

@coderabbitai run pre-merge checks

One-line JSDoc/TSDoc/KDoc on functions touched by the caret-into-view
change so CodeRabbit docstring coverage can meet the 80% threshold.

Co-authored-by: maco <macodev00@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/android-composer-caret-scroll-0ab8 branch from 505ff8e to 1084569 Compare September 20, 2026 10:38
macodev00 and others added 2 commits September 20, 2026 11:05
Extract leftover anonymous paste/focus/touch callbacks into named
functions with one-line JSDoc/KDoc, and put KDoc above @Suppress so
CodeRabbit can attach it. Covers the functions the 69% docstring
check still treated as undocumented.

Co-authored-by: maco <macodev00@users.noreply.github.com>
Controlled document updates can include the current selection without
moving it. Scrolling on those resets a manual review scroll. Track
whether applySelection changed the range and only bring the caret
into view when the text or that range actually changed.

Co-authored-by: maco <macodev00@users.noreply.github.com>
@github-actions github-actions Bot added size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Sep 22, 2026
@cursor

cursor Bot commented Sep 22, 2026

Copy link
Copy Markdown

@coderabbitai review

@macodev00

Copy link
Copy Markdown
Owner Author

Superseded by upstream pingdotgg#12716 — closing fork-local draft.

@macodev00 macodev00 closed this Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 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.

[Bug][Mobile] Android composer does not scroll the current line into view while typing a long prompt

2 participants