Skip to content

fix(mobile): paint the chat transcript and tab strip scrollers opaque - #36905

Merged
AmoabaKelvin merged 1 commit into
mainfrom
issue-36553-android-selection-flash
Nov 2, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
issue-36553-android-selection-flash

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 0 0 0 0
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​21 $\color{#cf222e}{\Huge{\mathbf{−}}}$​10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​11

ELI5

On one Android phone, the chat goes black behind the text while you drag a selection handle. The two scrolling areas that go black (the chat and the tab strip) had no colour of their own and relied on the screen behind them. This gives each one the same colour as the screen behind it, so there is nothing left for the phone to draw as black. Nothing looks different anywhere else.

What Changed

  • Before, on a Nothing A065 (Adreno 730, Android 16, WebView 158) in light mode: while a selection handle is dragged and the magnifier is up, the transcript and the inactive tab backgrounds keep flashing black. The header, selected tab and composer stay light.
  • The page already paints an opaque bgBase under the session screen (app/h/_layout.tsx row and the web HostStack screen), so the WebView's transparent background isn't what shows through. The areas that turn black are exactly the contents of the two scroll containers, which Chromium on Android composites as their own layers: the transcript page scroller and the horizontal tab strip. Neither had a background. Everything that paints its own colour stays light.
  • MobileNativeChatPageScroll now fills its scroller with colors.bgBase (the chat root's colour). tabScroll now fills with colors.bgPanel (the session chrome's colour), in both the portrait row and the landscape tabs-in-top-bar layout. The page scroll subscribes to the colour scheme so a theme switch repaints it.

Why

This is a hypothesis fix. The bug doesn't reproduce on the emulator: neither the reporter's run (API 36, WebView 156, host GPU) nor mine (API 35, WebView 124, swiftshader, 0.0.61 release APK against this branch's page bundle) shows it. The likely mechanism is that, on this GPU, these scroller layers get drawn as opaque during the handle drag, so their transparent pixels come out black. Filling each layer with the colour already behind it removes those transparent pixels without changing a single visible pixel elsewhere, and an opaque scroller layer is no more expensive to draw than a transparent one.

Alternatives ruled out:

  • Forcing software rendering: the issue rules it out.
  • Making the native Android WebView background opaque: needs an app release, and the page is already opaque under these scrollers, so it wouldn't change what gets dropped.

Linked Issue

Refs #36553 and STA-13068. Not "Fixes", because it can't be confirmed without the affected handset.

@gentslava, could you try this branch's page on the Nothing A065? Build the page bundle from this branch (pnpm run build:mobile-web), run that desktop, reopen the chat on the phone, then long-press a word in light mode and drag the end handle across a few lines. Does the transcript still flash black?

Visual Proof

The bug doesn't reproduce on the emulator, so these show that nothing visible changes. All three are on the Android emulator with a selection dragged across four lines.

main, light this branch, light this branch, dark
(screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data)

Before and after the fix with no selection, the header, tab strip and transcript match pixel for pixel (0 of 1.9M pixels differ).

Testing

  • Android emulator (API 35, release APK 0.0.61), paired to a hidden dev desktop serving this branch's page bundle, with a real native Claude chat. I recorded a ~3 s end-handle drag across lines at 30 fps on main and on this branch, and checked every frame: the transcript stays light in all of them, with dark pixels at 4.7–7.9%, which is just the text.

  • Switching the system to dark mode with the chat open repaints the transcript and tab strip dark.

  • Focused tests: mobile/src/session (342 files) plus the two tests outside it that import these modules all pass. Changed-file checks: check:code-quality:changed and check:react-doctor:changed pass.

  • Not tested on the affected handset; the request is above. iOS wasn't run, but it renders the same page with the same colours behind these scrollers.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

No test added: a style colour can't be shown failing in jsdom, and a test asserting the value would only repeat the code.

AI Disclosure

Review

Codex and a Claude reviewer both returned no findings in round 1.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

The change lives in the page bundle, which ships with the desktop, so no phone app release is needed. It doesn't touch the wire format, so mixed versions behave as before. Landed without a handset check; #36892's selection-time hardware layer is the fallback if it still flashes.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a24e3f7b-7148-4044-9b6d-8e635b3437d8
Commits

Reviewing files that changed from the base of the PR and between c546ecb and f72e8b7.

Files selected for processing: 1
  • mobile/src/session/native-chat/transcript/MobileNativeChatPageScroll.tsx

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

Walkthrough

The tab scroller now uses colors.bgPanel as its background. The mobile chat page scroller now uses themed styles and colors.bgBase. Its reverse column layout, disabled browser anchoring, and content sizing remain unchanged.

Merge Risk: Minimal · up to f72e8

The mobile scroll areas now use themed opaque backgrounds without an identified regression; mergeability is minimal risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: making the mobile chat transcript and tab strip scrollers opaque.
Description check Passed The description is mostly complete. It covers the user impact, implementation, rationale, alternatives, linked issues, visual proof, testing, limitations, compatibility, and checklist items. It does n…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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: Description check

Explanation

The description is mostly complete. It covers the user impact, implementation, rationale, alternatives, linked issues, visual proof, testing, limitations, compatibility, and checklist items. It does not include the dedicated Risk section or an explicit risk level, but risk and rollback considerations appear in other sections.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. 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 0 functions across 2 files.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • 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.

Share

On a Nothing A065 (Adreno 730) the transparent pixels of these two
scroll layers turn black while a selection handle is dragged. Fill each
with the colour already behind it so the layer has nothing to drop.

Refs #36553
@AmoabaKelvin
AmoabaKelvin force-pushed the issue-36553-android-selection-flash branch from c546ecb to f72e8b7 Compare November 2, 2026 09:54
@AmoabaKelvin
AmoabaKelvin merged commit a8ccf3b into main Nov 2, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant