Repository navigation
fix(mobile): paint the chat transcript and tab strip scrollers opaque - #36905
Conversation
|
No actionable comments were generated in the recent review.
|
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
c546ecb to
f72e8b7
Compare
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
bgBaseunder the session screen (app/h/_layout.tsxrow and the webHostStackscreen), 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.MobileNativeChatPageScrollnow fills its scroller withcolors.bgBase(the chat root's colour).tabScrollnow fills withcolors.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:
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.
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:changedandcheck:react-doctor:changedpass.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
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
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)