Skip to content

fix(mobile): smooth Android scrolling through long settled threads - #64

Closed
macodev00 wants to merge 1 commit into
mainfrom
cursor/android-transcript-slices-redo2-ca7c
Closed

macodev00 wants to merge 1 commit into
mainfrom
cursor/android-transcript-slices-redo2-ca7c

Conversation

@macodev00

Copy link
Copy Markdown
Owner

What Changed

On Android, a long settled assistant message is no longer one list row. It is split into bounded markdown rows, and a code fence longer than 16 lines is windowed into plain text rows. Android also recycles transcript rows. iOS is unchanged.

Each markdown slice is parsed as its own document, so slices are cut only where that stays valid:

  • Lists, blockquotes, GFM tables, HTML blocks, and setext headings stay intact, including lazy continuation.
  • Inline links, images, emphasis, inline code, autolinks, and raw HTML are not cut. Nested elements of the same name stay balanced.
  • Link reference definitions are copied onto a slice that uses them, including a destination or title on the following line.
  • Indented fences drop the opening fence's indent from each content line. An empty fence still renders.
  • <textarea> blocks stay intact through </textarea>.
  • A backtick fence whose info string contains a backtick stays prose.
  • A construct longer than the budget stays one row instead of being hard-split.
  • Short messages, and a single short fence, stay on the highlighted renderer.
  • Recycled code rows key the horizontal scroller and copy button by the full fence text, so a shared language and opening characters cannot keep the previous scroll offset or copied state. Streaming appends keep that key stable.

Fixes pingdotgg#13925

Why

Scrolling a long settled thread on Android stalls on the UI thread while Fabric mounts one large selectable text tree, then mounts it again when the row comes back. Smaller rows plus container reuse remove that hitch. Slice boundaries stay on markdown constructs so a link, list, quote, or code fence is not rendered as plain prose.

UI Changes

Android transcript scrolling only. This environment has no Android emulator, so there are no before/after frames. Slice boundaries are covered by apps/mobile/src/features/threads/androidTranscriptSlices.test.ts.

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 

Long settled assistant messages mounted as one selectable text tree, so
scrolling them back into view stalled the Android UI thread. On Android,
split those messages only at markdown-safe boundaries, window long code
fences, and recycle list rows.

Empty fences, multiline link definitions, nested same-name HTML, indented
fence bodies, and textarea blocks stay intact. Recycled code rows key off
the full fence so scroll position and copy state do not leak across blocks.

Fixes pingdotgg#13925
@github-actions github-actions Bot added size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Sep 28, 2026
@macodev00

Copy link
Copy Markdown
Owner Author

Opened upstream.

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

Labels

size:XXL 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: scrolling a long, settled thread is janky

1 participant