Skip to content

fix(mobile): Android composer drag at a scroll limit no longer selects text - #35722

Open
shivamhwp wants to merge 25 commits into
pingdotgg:mainfrom
shivamhwp:issue-watch/34423
Open

shivamhwp wants to merge 25 commits into
pingdotgg:mainfrom
shivamhwp:issue-watch/34423

Conversation

@shivamhwp

@shivamhwp shivamhwp commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

On Android, a finger drag held near a long press selects a word in the message composer when the text is already at its top or bottom scroll limit. The caret doesn't move and the text doesn't scroll, which makes navigating a long draft difficult.

Change

Android's text view cancels a pending long press only when a drag actually scrolls the text. At a scroll limit nothing scrolls, so the long press fires and selects a word. The composer now declines a long press once a finger has moved past touch slop from where it went down, and keeps that decision until the touch ends, so a second finger can't reopen it. A stationary long press still selects a word. No JavaScript changes.

Scope

Bug fix for #34423. This is Refs, not Closes: the reporter's device is a Samsung Galaxy S26 Ultra on One UI 9, which this was not tested on.

Verification

Head 9b7e85be281d295801e4e639c6eafeedf17ebc18. Commits: cb6b2e5e2fc (the fix), c536d37 (the second-finger latch; the device runs below used this code), 6ca326b (formats the new test for ktlint; no behavior change), and a merge of current main (36371de9106), which brings the agent context budget in line with main. The merge touches no composer code.

  • Unit tests: ./gradlew :t3-composer-editor:testDebugUnitTest in apps/mobile/android passes at c536d37. The new ComposerTouchTest cases cover a drag at the scroll limit, a second finger during that drag, and a still long press. The drag case fails on the parent commit, and the second-finger case fails on cb6b2e5.
  • Device, Android phone (POCO F4, Android 14), a native dev client built from c536d37. The same gestures ran on the parent commit (2482b03) for the before frames:
    • Keyboard visible, 1500 ms upward drag at the bottom limit: parent shows the highlight and Copy/Cut toolbar; this build shows a caret with no highlight.
    • Keyboard hidden, same drag: caret, no highlight.
    • Quick and slow drags away from the limit: the text scrolls, no highlight.
    • Horizontal drag: the caret moves, no range.
    • Stationary 900 ms long press: selects a word, with handles and toolbar.
    • Single tap: caret placed, keyboard shown.
    • Short one-line draft, 180 ms contact with a few pixels of wobble: caret kept, keyboard shown, no range.

Before, keyboard visible, 1500 ms drag at the bottom limit (2482b03):

before

After, same gesture (c536d37):

after

Recordings: before, after

Stationary long press still selects (c536d37):

long press

Not shown:

  • Samsung One UI, or the reporter's S26 Ultra.
  • Pressing and holding one finger on a word, then dragging the same contact to extend the selection. This is reasoned from the framework source, not run on a device.
  • The second-finger case on a device. It is covered by a unit test only.

🤖 Generated with Claude Code

Model and harness: Claude Haiku 5.5 in Claude Code, with the fix implemented by Claude Opus 5.5 and review and device runs by Codex (gpt-6.1-sol).

shivamhwp and others added 2 commits November 12, 2026 17:28
…s text

Android's Touch cancels a pending long press only when a drag actually
scrolls, so a slow drag with the text already at its top or bottom limit
let the long press fire and select a word. The composer now declines a
long press once the finger has moved past touch slop from where it went
down. A still long press still selects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ong press

The drag latch cleared on pointer-down and pointer-up, so a second finger
during a drag at a scroll limit could let the long press select a word.
The latch now holds until the touch ends.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 13, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Nov 13, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 03e5550

Macroscope's review found this PR approvable — Android composer finger drags now suppress long-press text selection even at scroll limits. The change is limited to gesture handling and preserves ordinary long presses.

No code changes detected at 1d799b9. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

@github-actions github-actions Bot added the 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. label Nov 13, 2026
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The Android composer tracks touch movement against the platform touch-slop threshold. It suppresses long-click handling after a drag and resets drag state when the touch ends or is cancelled. Robolectric tests cover dragging at the scroll limit and stationary long presses.

Changes: Android composer gestures

Layer / File(s) Summary
Drag-aware long-click handling
apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt, apps/mobile/modules/t3-composer-editor/android/src/test/java/expo/modules/t3composereditor/ComposerTouchTest.kt
SelectionAwareEditText records touch coordinates and classifies a gesture as a drag after movement reaches touch slop. Long-click handling is suppressed for a drag, and drag state resets on down, up, or cancel. Tests cover dragging at the scroll limit and selecting a word with a stationary long press.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • pingdotgg/t3code#34423: The reported Android composer drag-selection behavior matches the gesture handling addressed here. The specific Samsung One UI case is not covered, so the match is partial.

Suggested labels: bugfix

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · previous review 03e55

This change stops an Android composer drag at a scroll limit from selecting text, and a stationary long press still selects a word. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: an Android composer drag at a scroll limit no longer selects text. It matches the raw summary, which describes suppressing long-press handling once a drag crosses touc…
Description check Passed The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section states the bug and expected behavior. The Change section explains the cause and the fix. Th…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: an Android composer drag at a scroll limit no longer selects text. It matches the raw summary, which describes suppressing long-press handling once a drag crosses touch slop, and the objectives, which describe the same fix. It uses the conventional commit format from the template.

Full details: Description check

Explanation

The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section states the bug and expected behavior. The Change section explains the cause and the fix. The Scope section links issue #34423 and explains the Refs choice. The Verification section lists the unit tests, the commit hashes, device runs on a POCO F4, and the untested cases. It includes before and after images and recordings, and it names the model and harness as the template asks.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 3d70c4a and 03e5550.

Files selected for processing: 2

  • apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt
  • apps/mobile/modules/t3-composer-editor/android/src/test/java/expo/modules/t3composereditor/ComposerTouchTest.kt

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Splits the two one-line PointerCoords blocks in secondFingerDown so the
mobile native static check passes. No behavior change.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@macroscopeapp
macroscopeapp Bot dismissed their stale review November 13, 2026 01:05

Dismissing prior approval to re-evaluate 6ca326b

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Nov 13, 2026
@juliusmarminge juliusmarminge added the takeover t3 automation: takeover label Nov 13, 2026
@macroscopeapp
macroscopeapp Bot dismissed their stale review November 13, 2026 03:01

Dismissing prior approval to re-evaluate 4b8c7c8

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Nov 13, 2026
@shivamhwp

Copy link
Copy Markdown
Collaborator Author

[Haiku 5.5][Claude Code] on behalf of shivam.

Julius pushed his own commits to this branch (6d9dc37, a test refactor, plus merges 1d4bec7 and 4b8c7c8), so I'm stopping here and won't push anything more. The last head I verified was 9b7e85b: all required checks passed there, and Macroscope approved it. Macroscope's re-evaluation is now on 4b8c7c8.

@shivamhwp

shivamhwp commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator Author

[Haiku 5.5][Claude Code] on behalf of shivam.

Findings for #34423, handed over to Julius with this PR.

Reproduced: POCO F4 (Android 14), T3 Code Android dev client at 2482b03a01c. A 40-line draft scrolled to its bottom limit, then a finger drag up from a word, held ~1500 ms: a highlight with Copy/Cut appears. The same drag at 180 ms leaves a caret. Keyboard hidden and visible both reproduced. Not reproduced on a Samsung; the reporter's S26 Ultra was not available.

Root cause: Android's Touch cancels a pending long press only when a drag actually scrolls. At a scroll limit nothing scrolls, so the long press fires and Editor selects a word.

Fix tested (c536d37, with cb6b2e5e2fc and 6ca326b):

  • Unit tests: ./gradlew :t3-composer-editor:testDebugUnitTest passed at c536d37. The three ComposerTouchTest cases cover a drag at the limit, a second finger during that drag, and a still long press. The drag case fails on the parent commit; the second-finger case fails on cb6b2e5e2fc.
  • Device, POCO F4 at c536d37: keyboard visible and hidden, the 1500 ms drag leaves a caret with no highlight. Quick and slow drags scroll. A horizontal drag moves the caret. A stationary 900 ms long press selects a word with handles. A tap places the caret and shows the keyboard. A short one-line draft with a small wobble keeps its caret.

Not verified: Samsung One UI; holding one finger on a word and then dragging the same contact to extend the selection (reasoned from source only); the second-finger case on a device (unit test only).

Evidence: before and after images and recordings are attached to the PR body, and the device run's attempt log is kept with the working notes.

@MikaMcFlurry

Copy link
Copy Markdown
Contributor

Verified the current head 4b8c7c8427 on two more phones, since the last device run was on 9b7e85b: OnePlus 7 Pro (Android 11) and OnePlus 9 Pro (Android 14), Gboard. Native dev clients built from 95cb068c10 (base) and from that commit with 4b8c7c8427 merged (head).

Each trial set a 40-line draft (caret at the end, so the composer sits at its bottom limit), then a 1500 ms upward pan from a word in the composer, and read the EditText's selection range afterwards.

  • Base: a range was selected in 6 of 6 trials on each phone, with the Copy toolbar showing.
  • Head: no range in 6 of 6 trials on each phone; the drag leaves a caret.
  • Head, stationary 900 ms long press starting from a caret: selects a word on both phones, as on base.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 13, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

The automated pipeline stopped on this pull request and will not merge it:

the proof could not be captured: the agent ran past its 120 minutes

It stays open for a person to finish or close.

@juliusmarminge juliusmarminge added takeover:blocked Takeover blocked; reason in the PR body takeover:in-progress A takeover lead is working on this PR and removed takeover:in-progress A takeover lead is working on this PR takeover:blocked Takeover blocked; reason in the PR body labels Nov 13, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge juliusmarminge added takeover:blocked Takeover blocked; reason in the PR body and removed takeover:in-progress A takeover lead is working on this PR labels Nov 13, 2026
@juliusmarminge juliusmarminge added takeover:in-progress A takeover lead is working on this PR and removed takeover:in-progress A takeover lead is working on this PR takeover:blocked Takeover blocked; reason in the PR body labels Nov 16, 2026
@juliusmarminge juliusmarminge added takeover:blocked Takeover blocked; reason in the PR body takeover:in-progress A takeover lead is working on this PR and removed takeover:in-progress A takeover lead is working on this PR takeover:blocked Takeover blocked; reason in the PR body labels Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge juliusmarminge added takeover:blocked Takeover blocked; reason in the PR body takeover:in-progress A takeover lead is working on this PR and removed takeover:in-progress A takeover lead is working on this PR takeover:blocked Takeover blocked; reason in the PR body labels Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge juliusmarminge added takeover:blocked Takeover blocked; reason in the PR body takeover:in-progress A takeover lead is working on this PR and removed takeover:in-progress A takeover lead is working on this PR takeover:blocked Takeover blocked; reason in the PR body labels Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge juliusmarminge added takeover:blocked Takeover blocked; reason in the PR body takeover:in-progress A takeover lead is working on this PR and removed takeover:in-progress A takeover lead is working on this PR takeover:blocked Takeover blocked; reason in the PR body labels Nov 17, 2026
juliusmarminge and others added 2 commits November 17, 2026 05:52
Drop the second-finger case, which only failed if a non-move event
cleared the drag latch, and simplify the touch helper to one finger.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. size:S 10-29 changed lines (additions + deletions). takeover:blocked Takeover blocked; reason in the PR body takeover t3 automation: takeover vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants