You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(mobile): prevent black flashes during Android text selection - #36892
Adjusting Android's text-selection handles can flash the chat background black and make the conversation unreadable. Keep the WebView on a dedicated GPU texture while text is selected, then release it when selection ends.
What Changed
Use an Android WebView subclass that acquires a hardware layer for the native selection action mode and restores the previous layer when creation is refused or the action mode ends.
Forward the original menu callbacks and Callback2 content rectangle so selection actions and toolbar positioning continue to work.
Why
The affected phone reproduces this in a full-window WebView during magnifier dragging. Native background color, an opaque HTML background, and a composited page root all still fail. A dedicated hardware layer prevents the flash. Limiting it to selection avoids keeping an extra full-window GPU texture during ordinary chat use.
Affected Nothing A065, Android 16, WebView 158.0.8127.2. These are English-only captures from an isolated full-window reproduction using production RN Web styles and the production chat scroller. The after capture runs the exact new Java class; private conversations are excluded.
Before: default WebView layer
After: hardware layer during selection
Testing
Manually reproduced the reported defect in installed Orca Mobile 0.0.61 on the affected physical phone using normal long-press and handle-drag input.
Same-phone full-window A/B: default WebView failed 4/4 drags; the scoped layer passed 12 light-mode drags, including deselect/reselect, and 4 dark-mode drags.
Observed the native layer transition 0 -> 2 -> 0 after selection starts and is dismissed, including dark mode.
Compiled the exact new class against Android API 36, converted it with D8, packaged it into the isolated diagnostic APK, and executed it on the phone.
Reporter confirmed in the actual Orca Mobile app on the affected phone that flickering disappeared after updating the Android APK (2026-11-01).
git diff --check.
Automated tests added/updated, or explained why not: the failure requires Android's actual window compositor and magnifier. The device A/B above is the rendering regression evidence; a JVM test or desktop selection test would not exercise that surface path.
The complete Expo Android release APK builds successfully with this patch. Its checksum and APK signature were verified. Application-level acceptance is now reporter-confirmed on the affected phone (2026-11-01): updating the desktop alone did not remove the flicker; it disappeared only after installing the updated Android APK. This is the reporter's result in Orca Mobile, distinct from the instrumented A/B in the isolated diagnostic app above. The native WebView change is delivered by the APK, so a desktop/page-bundle update alone cannot install this fix. Broad repository checks are left to CI.
Handset revalidation after the page-only fix — 2026-11-03
Retested the actual paired Orca Mobile application on the affected Nothing A065 (Android 16, Adreno 730, WebView 158.0.8127.2), with both opaque-scroller changes from #36905 present. The served transcript/tab-strip files match the merged PR and current main byte for byte; the official 0.0.61 native WebView source also matches current main.
Official Orca Mobile 0.0.61 without this native patch: 2/2 native selection-handle drags still blacken the transcript and tab strip while the magnifier is visible.
Restored 0.0.61 APK containing this patch, with the same page and paragraph: 0/2 drags blacken the background.
Both variants used normal UI input, were recorded, and were checked by installed APK digest. No DOM selection was injected and no application data was reset. This is evidence for the relevant selection paths, rather than every unrelated change in a clean full-main build. Raw recordings remain local because they contain a private conversation. This native fix is therefore still needed on the affected handset alongside #36905.
AI Disclosure
Implemented and investigated with OpenAI Codex. Device results above were verified through native Android UI input.
Review
Android-only native implementation; desktop platforms and iOS have no source changes. Local/remote hosts, mixed host versions, supported agents/integrations, and folder/git workspaces use the same existing bridge contract. GPU rendering stays enabled; the additional texture is scoped to selection. Menu actions/content rectangles are delegated, and the existing WebView isolation settings remain in their existing factory.
Agent skill upstream boundary
Not applicable; no skill-installer source or assets are included.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Walkthrough
The Android mobile web shell now creates a MobileWebShellSelectionView. The subclass wraps text-selection action-mode callbacks, enables hardware rendering while selections are active, and restores the original layer type when the last selection ends.
Severity of issue fixed: Medium
Merge Risk: Minimal · up to 66e2b
No concrete merge-blocking risk was identified in the reviewed Android selection-rendering changes.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: preventing black flashes during Android text selection.
Linked Issues check
The change satisfies the coding requirements in [#36553]. MobileWebShellView.kt now creates MobileWebShellSelectionView. The subclass switches to LAYER_TYPE_HARDWARE when selection action mode c…
Out of Scope Changes check
The whole-PR change is limited to the Android WebView subclass and the existing WebView factory. The layer handling, callback forwarding, and factory substitution directly support [#36553]. No unrelat…
Description check
The pull request description is complete and follows the required structure. It explains the user impact, implementation, rationale, linked issue, visual proof, testing evidence, AI disclosure, compat…
Full details: Linked Issues check
Explanation
The change satisfies the coding requirements in [#36553]. MobileWebShellView.kt now creates MobileWebShellSelectionView. The subclass switches to LAYER_TYPE_HARDWARE when selection action mode creation succeeds and restores the previous layer when creation is refused or the mode is destroyed. It forwards menu callbacks and Callback2.onGetContentRect, which preserves selection behavior and toolbar positioning. The reported device validation covers the affected Android environment. No linked issue requires an automated test for this compositor-specific defect.
Full details: Out of Scope Changes check
Explanation
The whole-PR change is limited to the Android WebView subclass and the existing WebView factory. The layer handling, callback forwarding, and factory substitution directly support [#36553]. No unrelated platform, bridge, workspace, or product behavior changes are present in the reviewed diff.
Full details: Description check
Explanation
The pull request description is complete and follows the required structure. It explains the user impact, implementation, rationale, linked issue, visual proof, testing evidence, AI disclosure, compatibility considerations, and checklist status. The final checklist leaves broad repository checks unchecked, but it clearly states that CI will cover them and provides substantial Android validation.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 2 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Thanks @gentslava for tracking this down and testing on the handset. We landed #36905, which paints the transcript and tab strip scrollers opaque, so I'm closing this one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Adjusting Android's text-selection handles can flash the chat background black and make the conversation unreadable. Keep the WebView on a dedicated GPU texture while text is selected, then release it when selection ends.
What Changed
Callback2content rectangle so selection actions and toolbar positioning continue to work.Why
The affected phone reproduces this in a full-window WebView during magnifier dragging. Native background color, an opaque HTML background, and a composited page root all still fail. A dedicated hardware layer prevents the flash. Limiting it to selection avoids keeping an extra full-window GPU texture during ordinary chat use.
Linked Issue
Fixes #36553
Visual Proof
Affected Nothing A065, Android 16, WebView 158.0.8127.2. These are English-only captures from an isolated full-window reproduction using production RN Web styles and the production chat scroller. The after capture runs the exact new Java class; private conversations are excluded.
Testing
0 -> 2 -> 0after selection starts and is dismissed, including dark mode.git diff --check.The complete Expo Android release APK builds successfully with this patch. Its checksum and APK signature were verified. Application-level acceptance is now reporter-confirmed on the affected phone (2026-11-01): updating the desktop alone did not remove the flicker; it disappeared only after installing the updated Android APK. This is the reporter's result in Orca Mobile, distinct from the instrumented A/B in the isolated diagnostic app above. The native WebView change is delivered by the APK, so a desktop/page-bundle update alone cannot install this fix. Broad repository checks are left to CI.
Handset revalidation after the page-only fix — 2026-11-03
Retested the actual paired Orca Mobile application on the affected Nothing A065 (Android 16, Adreno 730, WebView 158.0.8127.2), with both opaque-scroller changes from #36905 present. The served transcript/tab-strip files match the merged PR and current main byte for byte; the official 0.0.61 native WebView source also matches current main.
Both variants used normal UI input, were recorded, and were checked by installed APK digest. No DOM selection was injected and no application data was reset. This is evidence for the relevant selection paths, rather than every unrelated change in a clean full-main build. Raw recordings remain local because they contain a private conversation. This native fix is therefore still needed on the affected handset alongside #36905.
AI Disclosure
Implemented and investigated with OpenAI Codex. Device results above were verified through native Android UI input.
Review
Android-only native implementation; desktop platforms and iOS have no source changes. Local/remote hosts, mixed host versions, supported agents/integrations, and folder/git workspaces use the same existing bridge contract. GPU rendering stays enabled; the additional texture is scoped to selection. Menu actions/content rectangles are delegated, and the existing WebView isolation settings remain in their existing factory.
Agent skill upstream boundary
Author
GitHub: @gentslava. X/Twitter: N/A.
Checklist