Repository navigation
Conversation
There was a problem hiding this comment.
Important
pnpm run check:code-quality:changed fails on this PR: mobile/src/components/mobile-markdown-android-selection.test.tsx:43 uses a type assertion, and CI enforces that gate (.github/workflows/pr.yml:153). Details inline. The rest of the change reads correctly and the focused mobile suites pass.
Reviewed changes
- Android-only selection policy — new
inline-text-selection.tsdecidesos !== 'android'and is the single input to the gate. - Transcript gate —
MarkdownTextstrips an explicitselectableon Android, so no span in the transcript is selectable; the user bubble follows withselectable={INLINE_TEXT_SELECTION}. - Long-press actions — new
MobileNativeChatMessageActionsSheetoffers Copy message / Select text; the message row mounts it only while open and defers the selectionModalto the drawer's after-close. - Plain-text helper —
nativeChatMessagePlainTextjoins prose blocks (tool calls and images skipped) for the clipboard and the selection screen. - Tests — platform policy, Android markdown gate, plain-text helper, and
Platformmocks added to the existing Markdown/chat suites.
ℹ️ The long-press sheet has no render test
The new tests pin the platform decision, the markdown gate and the plain-text helper, but nothing renders MobileNativeChatMessageActionsSheet. MobileNativeChatMessage.test.ts mocks it to a string and runs as iOS, so the Android long-press wiring and the "open selection only after the drawer closes" sequence the PR calls out are unverified.
Technical details
# Long-press action sheet has no render test
## Affected sites
- `mobile/src/session/MobileNativeChatMessage.test.ts` — mocks `./MobileNativeChatMessageActionsSheet` and runs as iOS, so neither the sheet nor the Android long press is exercised.
- `mobile/src/session/MobileNativeChatMessageActionsSheet.tsx` — the `selectRequested` ref plus `onAfterClose` sequencing is the invariant a regression would silently break.
## Required outcome
- A render test (Android) that long-presses a message, sees the sheet, and asserts the selection screen is presented only after the drawer closes.
## Open questions for the human (optional)
- Is the deferred-open invariant worth pinning, or is on-device verification considered sufficient?ℹ️ Nitpicks
Content's AndroidPressable(MobileNativeChatMessage.tsx:75) wires onlyonLongPress, with noaccessibilityRole/accessibilityHint; TalkBack users get no signal that copy/select live behind a long press. Every other Pressable chrome in this PR (e.g. the sheet'sClose) carries a label.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 915c0ef998b02f1e63a12e91d470e2a2faa90dee and 0dbbb4c85d690d882f4a738d643fc3ff5152e10f. 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe mobile text-selection policy disables inline selection on Android. Markdown transcript text uses native text rendering in that mode, and tappable spans and image blocks can receive a long-press callback. A long press on a chat message opens actions to copy its text or open a selectable-text screen. Plain-text extraction preserves text-block whitespace while excluding whitespace-only blocks. Tests cover the platform policy, Markdown behavior, message actions, and text extraction. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The Android message-action change is ready to merge after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new copy and selection actions are explicit and confined to the message being pressed. No security issue was verified, but the change does introduce a device-clipboard path for message text. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: bbce4028-7692-48d0-a2cb-59c7fc13ca59
📥 Commits
Reviewing files that changed from the base of the PR and between 646e9a5 and ad6a088529e5965b8b5afa4914b986469e03b6b1.
📒 Files selected for processing (12)
mobile/src/components/MobileMarkdown.file-links.test.tsmobile/src/components/MobileMarkdown.tsxmobile/src/components/inline-text-selection.test.tsmobile/src/components/inline-text-selection.tsmobile/src/components/mobile-markdown-android-selection.test.tsxmobile/src/components/mobile-markdown-mermaid-routing.test.tsmobile/src/components/mobile-markdown-selectable.test.tsxmobile/src/session/MobileNativeChatMessage.test.tsmobile/src/session/MobileNativeChatMessage.tsxmobile/src/session/MobileNativeChatMessageActionsSheet.tsxmobile/src/session/mobile-native-chat-message-plain-text.test.tsmobile/src/session/mobile-native-chat-message-plain-text.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 9f1617f3-ee8d-4407-9f8b-4dfbc25e5573
📥 Commits
Reviewing files that changed from the base of the PR and between ad6a088529e5965b8b5afa4914b986469e03b6b1 and 3550f25f8637392a6ea1f6e154635d5733ec9170.
📒 Files selected for processing (5)
mobile/src/components/MobileMarkdown.tsxmobile/src/components/mobile-markdown-android-selection.test.tsxmobile/src/session/MobileNativeChatMessage.tsxmobile/src/session/mobile-native-chat-message-plain-text.test.tsmobile/src/session/mobile-native-chat-message-plain-text.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- mobile/src/session/mobile-native-chat-message-plain-text.test.ts
- mobile/src/session/mobile-native-chat-message-plain-text.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Scoped the Android deselection gate to the transcript —
androidTranscriptis nowrangeSelectable && !INLINE_TEXT_SELECTION, so task comments, descriptions and previews keep their selection on Android; a new test pins the untouched surfaces. - Routed span long presses to the row — in the transcript gate, any span with
onPressalso receives the row'sonLongPress, so a link or file path under the finger no longer swallows the press that opens the actions sheet. - Removed the type assertion from the Android markdown test —
String(node.type) === 'Text'replaces('Text' as never), and the changed-code quality gate now reports zero findings. - Preserved intra-block whitespace in
nativeChatMessagePlainText— blocks are no longer individually trimmed; only whitespace-only blocks are dropped, with the test updated to the exact joined string.
Both prior pullfrog threads are addressed and resolved. Verified locally: 8 focused test files / 65 tests pass, mobile pnpm typecheck and check:tests-typecheck pass, and pnpm run check:code-quality:changed reports 0 new findings across the 12 changed files.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
🧹 Nitpick comments (1)
mobile/src/session/MobileNativeChatMessage.test.ts (1)
1-100: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winThe current tests do not cover the Android integration path from row long press to the actions sheet.
MobileNativeChatMessage.test.tsruns withPlatform.OS: 'ios'and replaces bothMobileMarkdownandMobileNativeChatMessageActionsSheetwith host mocks. The Android Markdown tests only verify callback forwarding insideMobileMarkdown.Add a focused Android test that long-presses the rendered message row and asserts that the mounted sheet exposes
Copy messageandSelect text. This would detect a regression in the parent component even whenMobileMarkdownstill forwards callbacks correctly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: be0ce2f3-114d-4373-9923-8230525cb853
📥 Commits
Reviewing files that changed from the base of the PR and between 3550f25f8637392a6ea1f6e154635d5733ec9170 and 915c0ef998b02f1e63a12e91d470e2a2faa90dee.
📒 Files selected for processing (2)
mobile/src/components/MobileMarkdown.tsxmobile/src/components/mobile-markdown-android-selection.test.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
- mobile/src/components/MobileMarkdown.tsx
- mobile/src/components/mobile-markdown-android-selection.test.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Routed Markdown image long presses to the row —
MobileMarkdownContentnow readsMarkdownTextContextand passes the row'sonLongPressto image-blockPressables, so on the Android transcript a long press on an image opens the copy/select sheet instead of being swallowed by the image's own tap handler. Outside the transcriptrowLongPressstaysundefined, so iOS, web and non-transcript images are unchanged. - Extended the Android markdown test — the long-press routing test appends an image block and asserts every tappable
Pressable(and every tappableTextspan) carries the row handler. The assertion fails without the fix.
mobile-markdown-android-selection.test.tsx passes (3 tests). Both prior pullfrog threads (the type assertion and the gate scope) remain resolved.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Added an Android render test for the long-press path —
MobileNativeChatMessage.android.test.tsrenders the row as Android and pins that long-pressing the bubble opens the actions sheet with the pressed message, thatonCloseunmounts it, and thatMobileMarkdownreceives the same handler (so a link or image under the finger cannot swallow the press). - Pinned the Android user bubble's deselection — the new suite asserts every
selectablespan in the user bubble isfalse, complementing the iOS suite'sselectable === trueassertion. - Kept the iOS suite on its existing path — added
Platform: { OS: 'ios' }and aMobileNativeChatMessageActionsSheetmock toMobileNativeChatMessage.test.ts, so it continues to exercise the no-long-press rendering without pulling in the drawer/selection dependencies.
This partially closes the prior informational finding that the Android long-press wiring had no render coverage. The sheet's internal "open selection only after the drawer closes" sequence remains unverified; on-device proof in the PR body covers it.
Both prior pullfrog threads (the type assertion and the gate scope) are resolved. Verified locally: MobileNativeChatMessage.android.test.ts + MobileNativeChatMessage.test.ts pass (20 tests), and pnpm run check:code-quality:changed reports 0 new findings across the 13 changed files.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
thanks! Taking a look |
…ipt scrolls On Android every paragraph, heading, quote, code block and table cell in the native chat transcript was a selectable TextView. Android starts a word selection, with the magnifier, on a double tap or a long press, and two flicks in the same spot while scrolling a FlatList register as a double tap, so scrolling the chat kept selecting words. iOS is unaffected: its UITextView path arbitrates scroll against selection itself. Android now renders transcript text without inline selection: one gate in MarkdownText covers every selectable span, and the user bubble follows it. A long press on a message opens a sheet with "Copy message" and "Select text", the latter a screen whose only content is one selectable Text, so a selection can only start where the user asked for it. The message row owns that sheet and mounts it only while open. iOS and web keep their inline selection and get no long-press handler. Verified on a Pixel 10 Pro Fold (Android 17): an adb double tap on the transcript selects nothing, the same double tap inside "Select text" selects a word, tool rows inside the bubble still expand on tap, and the long press opens the sheet.
…oute span long presses Review follow-ups on stablyai#22871: - The gate now applies only where `rangeSelectable` is passed (the chat transcript). Task comments and file previews keep their selectable text on Android as before. - On the Android transcript, spans that take taps (links, file paths) also take the row's long press, so a link under the finger no longer swallows the copy/select sheet. - Copied text keeps its whitespace; only whitespace-only blocks are dropped. - The Android markdown test compares `String(node.type)` instead of a type assertion, which the changed-code quality gate rejects.
An image block is a Pressable of its own, so on the Android transcript it now carries the row's onLongPress like tappable spans do; a long press on an image opens the copy/select sheet instead of being swallowed. Test extended with an image block.
…ns sheet The existing row suite runs as iOS, where the bubble has no long press. This one runs as Android: the bubble's long press mounts the actions sheet with the message, the markdown receives the same handler, closing unmounts the sheet, and the user bubble carries no inline selection.
0dbbb4c to
882d6be
Compare
882d6be to
3f94719
Compare
Take upstream's Android chat text-selection fix (stablyai#22871) over the fork's equivalent commit; keep the Android connection keep-alive package in the mobile lockfile. Co-Authored-By: Claude Opus 5.5 <[email protected]>

ELI5
Quick flicks through Android chat could select words and open the magnifier. The transcript now scrolls without inline selection. Long-press a message to copy it or open a separate screen for selecting part of its text.
What Changed
Only Android transcript text loses inline selection. The message row opens Copy message / Select text actions, and interactive Markdown links and images forward long presses while retaining their tap actions. Host notices follow the same selection rule and copy the wording actually displayed.
The selection screen opens after the drawer has closed and keeps a snapshot of the message so streamed updates cannot disturb selection. Copying preserves indentation and excludes tool activity and image attachments. Clipboard failures are shown to the user. The actions UI mounts only while open.
Why
Disabling selection after scrolling begins is too late: Android can recognize successive flicks as a double tap first. Explicit selection removes that conflict while retaining partial copying, without maintaining a custom native TextView. iOS, web, and non-transcript Markdown retain their existing selection behavior.
Linked Issue
Fixes #22869
Visual Proof
Contributor's before/after recordings on a Pixel 10 Pro Fold, Android 17:
orca-android-selection-before-small.mp4
orca-android-selection-after-small.mp4
The contributor also verified double-tap selection inside Select text, clipboard copying, and tool-row taps. Follow-up validation rendered the actual drawer and selection components through React Native Web in a hidden Electron window: transition, layout, and stable text during an update were checked. This is not a new native Android gesture verification.
Testing
After rebasing onto main and applying review fixes:
pnpm lintstops at existing dependency-cycle warnings in four unchanged mobile files, identical to main. CI runs that audit before installing mobile dependencies; local mobile dependencies were present.3f947197cea301d54b2332fb1dc192d57f031caa: Mobile Checks, static analysis/typechecking, mobile web build/rendering, repository guards, test LoC, and the final aggregate check.AI Disclosure
Original implementation and Android device verification: Claude via Claude Code, reviewed by the contributor. Maintainer rebase, adversarial review, follow-up fixes, and regression tests: Codex.
Review
Reviewed selection scope, nested tap/long-press routing, modal teardown, clipboard rejection, streaming updates, row identity, and preservation of main's host-notice and turn-status rendering. No remaining blocking finding. Automated tests now exercise the real drawer lifecycle through native-animation completion, copy failures, cancellation, disabled actions, and streaming snapshots.
Client-side presentation only: no host execution, storage, RPC, SSH, workspace-type, or git-provider contracts change. Native iOS and a fresh Android run were not performed during the maintainer follow-up.
Agent skill upstream boundary
Notes
Android transcript selection now requires an explicit long press. The selection screen displays source Markdown, as copied to the clipboard.
Checklist