Repository navigation
feat(mobile): paint browser screencast frames through web siblings (OTA phase C, C6.2) - #21754
Conversation
…TA phase C, C6.2) The pane's frame path is written against React Native's native-prop writer, which does not exist on React Native Web: a ref there is the DOM node, so both writes throw and the pane never shows a frame. Three `.web.ts` siblings, each for a measured gap. - The image and layer writes move out of `mobile-browser-frame-state.ts` into `browser-frame-layer-paint.ts`, whose sibling paints the frame as a `background-image` on the element RN Web sizes and flips the double buffer with one opacity write per layer. The pane still never re-renders while it streams. - A `background-image` write fires no load event, so the offscreen layer would never become visible. The sibling arms the flip from an image decode instead, and the flip itself is shared with the native `onLoad` path rather than written twice. - The data URI keeps the base64 the bridge already carried instead of encoding the bytes back into the same string. Measured in this tree against the `buffer` shim the page bundle resolves: 0.256 ms per frame at 45,815 bytes and 2.61 ms at 463,942, against under a microsecond for the carried string. Per C6 ruling 5 the pane asks for binary frames only when the shell granted the lane, and renders its existing stream-error state otherwise, so a page never waits on frames a shell without the encoder cannot send. The grant name is a placeholder until C6.1 reports it. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe browser pane now checks binary screencast grants before creating a stream subscription. Bridge frames preserve sender-provided base64 data, with byte encoding as a fallback. Frame painting and layer state logic moved into shared native and web modules. Web frame application now waits for image decoding before flipping double-buffered layers. Tests cover grant handling, URI generation, platform painting, decoding, and stale frame replacement. Priority: ➖ Normal 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description gives detailed change scope, rationale, implementation details, exclusions, tests, and verification results. It does not follow the required template structure and omits the required linked issue declaration, visual proof or an explicit N/A explanation, checklist status, and several required review sections. Resolution Add the required template sections. Include a valid
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 46f0162a-7ca1-4cf1-83a2-8eccebf42470
📒 Files selected for processing (21)
mobile/src/browser/MobileBrowserPane.tsxmobile/src/browser/browser-frame-data-uri.tsmobile/src/browser/browser-frame-data-uri.web.test.tsmobile/src/browser/browser-frame-data-uri.web.tsmobile/src/browser/browser-frame-layer-flip.tsmobile/src/browser/browser-frame-layer-paint.tsmobile/src/browser/browser-frame-layer-paint.web.test.tsmobile/src/browser/browser-frame-layer-paint.web.tsmobile/src/browser/mobile-browser-frame-state.tsmobile/src/browser/mobile-browser-frameless-stream.test.tsxmobile/src/browser/use-browser-binary-screencast-grant.tsmobile/src/browser/use-browser-binary-screencast-grant.web.test.tsxmobile/src/browser/use-browser-binary-screencast-grant.web.tsmobile/src/browser/use-mobile-browser-frame-apply.tsmobile/src/browser/use-mobile-browser-frame-apply.web.test.tsxmobile/src/browser/use-mobile-browser-pane-layers.tsmobile/src/browser/use-mobile-browser-stream.tsmobile/src/mobile-web-shell/bridge/bridge-rpc-client-frames.test.tsmobile/src/mobile-web-shell/bridge/bridge-screencast-binary.tsmobile/src/transport/browser-screencast-protocol.tsmobile/web-entry/web-overrides.json
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
C6.1 has decided the name: `screencastBinary`, one camelCase token. Replaces the placeholder this PR landed with while C6.1 was still choosing. The placeholder was also unusable, which the test added here would have caught: `GRANT_NAME_PATTERN` in the manifest contract admits a bare name or a `native.`-prefixed verb and nothing else, so a route declaring `browser.screencast.binary` would have been refused by the bundle before any shell saw it, and the pane would have taken its stream-error branch for a reason no screen could report. The name is now checked against `MobileWebBundleRouteSchema` itself rather than against a restated regex, with the dotted spelling as the failing case beside it. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
Important
One real bug in the new web flip path: onUndecodable is missing the stale-frame guard that onDisplayable has, so a late decode rejection from an older frame can free the pending layer and strand the pane on the previous frame. Fix is a few lines. Everything else reads clean — the RN Web DOM assumptions check out against [email protected].
Reviewed changes
- Web paint siblings —
browser-frame-layer-paint.web.tspaints each frame as abackground-imageon the RN Web<Image>'s first child and flips the double buffer with onestyle.opacitywrite per layer, replacing the nativesetNativePropswrites that throw on a DOM ref. - Web flip arming —
whenBrowserFrameDisplayableis a no-op natively and, on the web, arms the flip from anew Image()+decode()probe because abackground-imagewrite fires no load event; the flip itself is shared with the nativeonLoadpath throughbrowser-frame-layer-flip.ts. - Base64 passthrough —
BrowserScreencastFrame.b64is added and set only bydecodeBridgeScreencastFrame; the web data-URI sibling reuses it instead of re-encoding through the page's JSbuffershim, with the native encoding as fallback for frames that carried none. - Grant gate — the pane requests binary frames only when the shell granted
browser.screencast.binary(native always answers true); otherwise it withholds the subscription and renders the existing stream-error state with the app-update message. - Writer extraction — the two native writers move out of
mobile-browser-frame-state.tsintobrowser-frame-layer-paint.ts;web-overrides.jsongains three reasoned entries for the new siblings.
ℹ️ Nitpicks
use-browser-binary-screencast-grant.web.ts:9defines the placeholder grant as'browser.screencast.binary', but the PR description names itscreencastBinary. Since the web lane turns on only if this string matches the name C6.1 adds toMOBILE_WEB_SHELL_GRANTS, it is worth confirming the exact token before C6.1 lands. The test already restates the constant, so a rename touches both.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…phase C, C6.2) Round 1 folds on #21754. The undecodable arm freed the pending slot without checking whose frame had failed, while the displayable arm checked. Reproduced: frame 2 goes pending on layer 1, frame 3 repoints the same layer, frame 2's decode rejects and clears the slot layer 1 is holding for frame 3, then frame 3 decodes and the flip is refused because the slot no longer names its layer. The newest frame sits decoded at opacity 0 behind an older one, and a page that has gone still sends no further frame to recover with. Web only; native never calls this. Both arms now answer for the frame they were armed with. The displayable arm's own guard had no test: deleting it left `src/browser/` and the full suite green, because the case that exercised it settled both decodes and asserted an end state both orders produce. The harness now settles one decode at a time, keyed on the source it was given, and the ordered case reds without the guard. Also: the paint sibling's opacity test claimed "no re-render" while asserting two style strings, so it is named for what it checks and the claim is counted where React is — across ten streamed frames the three state setters are called once each, on the mount frame. And the overrides allowlist is rebuilt from main's bytes plus the new entries, so two pre-existing reasons keep their literal em dash instead of a re-serialized escape. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The delta since the prior pullfrog review (401884e8bd → 1bdda61add) closes the reported stale-decode hole and tightens the two contracts it rests on.
- Stale decode guarded symmetrically —
onUndecodablenow answers through the sameisCurrentFrame()predicate asonDisplayable, so a late failure from a frame the layer has moved past no longer frees a pending slot a newer frame owns. Verified by tracing the 2→3 repoint path: with the guard,frame-2's rejection is a no-op andframe-3's resolve still settles layer 1. - Red-first ordering tests — the new cases settle one held decode at a time, keyed on its source, so the stale-success and stale-failure orderings are observable rather than collapsed into the same end state. Deleting the guard reds the stale-failure case.
- "No re-render" claim counted — the frame-apply test now counts the three render-triggering setters across ten streamed frames and asserts exactly one write each, replacing the weaker two-opacity-string assertion.
- Grant renamed to
screencastBinary— the placeholder is gone. Confirmed against C6.1 (#21758): itsbridge-screencast-grant.tsdeclaresBRIDGE_SCREENCAST_BINARY_GRANT = 'screencastBinary'and adds it toMOBILE_WEB_SHELL_GRANTS, so the web lane's reader matches the shell's implemented set. The new test pins the name againstMobileWebBundleRouteSchemaand uses the old dotted spelling as the failing case, whichGRANT_NAME_PATTERNrefuses.
Prior review's inline thread on the missing guard is resolved.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…mage (OTA phase C, C6.2) Round 2 folds on #21754. Every test for the web paint sibling handed it a `div > div` of its own making, so the assumption it rests on — that the host's first element child is the one carrying the frame — was only ever checked against a shape written to match it. React Native Web also renders an accessibility `<img>` in there, and a release that reorders those children would keep all of them green while the pane painted nothing. One test now renders the real component, asks it which child it painted, and checks the write lands on that one. Pointing the sibling at `lastElementChild` reds it and leaves the hand-built cases passing, which is the gap. A second case records what the `<img>` does: the streaming path writes styles and never props, so it keeps the source it mounted with for the life of the pane, and that is what a screen reader and the image context menu see. react-native-web ships no type declarations, so the component comes through `createRequire`, whose return is `any` at its own signature; the one prop it renders with is declared rather than asserted, and the file stays inside the tests-typecheck ratchet. The module docstring also claimed more than the code does. The frame path adds no render, but a render from any of the pane's other state — address focus, a dialog, the view mode, zoom — repaints both layers from `renderedFrameSource`, which reads `frameUriRef.current`, so both land on the newest frame whether or not it has decoded. Native clobbers the same way through `setNativeProps`. Said plainly, along with what restores the buffering. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
🧹 Nitpick comments (1)
mobile/src/browser/browser-frame-layer-paint.web.test.ts (1)
183-212: 🎯 Functional Correctness | 🔵 Trivial | 🏗️ Heavy liftAdd browser coverage for the RN Web painted frame.
browser-frame-layer-paint.web.test.tsruns inhappy-domand checks onlystyle.backgroundImageand the accessibility<img>source. It does not verify raster output. Add a Playwright test with a decodable image fixture, such asFRAME_URI, and assert that the streamed frame renders while the accessibility image remains present.Source: Learnings
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: ec7757ec-a551-4da1-af31-1877cf317b06
📒 Files selected for processing (2)
mobile/src/browser/browser-frame-layer-paint.web.test.tsmobile/src/browser/browser-frame-layer-paint.web.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- mobile/src/browser/browser-frame-layer-paint.web.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
There was a problem hiding this comment.
ℹ️ No critical issues — one docstring claim to reconcile with the code it describes.
Reviewed changes
The delta since the prior pullfrog review (1bdda61add → 0d9d5feaeb) is test-and-comment only, and it pins the RN Web DOM shape the new paint sibling stands on.
- Real RN Web
<Image>test — a newdescriberendersreact-native-web's actualImagethroughreact-dominto happy-dom, finds the child carrying the mountedbackground-imageby its URI rather than by child position, and asserts the sibling's write lands on that element. It also records that the accessibility<img>keeps its mountedsrcacross that imperative write. - Web paint docstring expanded —
browser-frame-layer-paint.web.tsnow states that the frame path adds no render at any rate (rather than "never re-renders") and documents the re-render clobber fromrenderedFrameSource.
The one comment below asks that the accessibility-<img> sentence be scoped the same way, since a re-render also updates its src (and the parallel reason in web-overrides.json still carries the older phrasing).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…phase C, C6.2) pullfrog is right, and the test carried the same wrong claim. The note said the hidden `<img>` keeps the frame it mounted with for the life of the pane, two paragraphs after saying a render from the pane's other state passes `renderedFrameSource` as `source` — and React Native Web derives that image's `src` from the same prop it paints the background from, so the first such render moves it. Measured here rather than reasoned about: rendering the real component, writing a frame imperatively, then re-rendering with a new source moves the `src` and leaves the background where the imperative write put it. The two halves are now two cases, named for what each one shows, and the note says the streaming writes never touch it while a render does — so it holds the frame the pane last rendered with, not the one on screen. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The delta since the prior pullfrog review (0d9d5feaeb → 8917dd8280) is doc-and-test only, and it resolves the one docstring claim flagged last round.
- Accessibility-
<img>docstring scoped —browser-frame-layer-paint.web.tsno longer reads as a lifetime guarantee: the streaming writes never touch the hidden<img>, and a render from the pane's other state moves itssrcbecause RN Web derives it from the samesourcethe background is painted from. - Re-render case added — the real-RN-Web test grew a
rerenderWith(uri)harness and a second case asserting the hidden<img>'ssrcfollows a newsourceprop, so the old "for the life of the pane" claim is now pinned as false. The imperative-only case stays, andaccessibilityImageSourcethrows unless exactly one<img>is present. Verified locally: 11 tests pass.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
… carries (OTA phase C, C6) (#21769) C6.1 (#21758) pinned the frame `decodeBridgeScreencastFrame` hands back with an exact `toEqual`; C6.2 (#21754) made that decoder carry the wire's `b64` on the frame so the page's data URI can reuse it. Each PR was green against the main it branched from, and their squashes together red two of C6.1's cases on main. The pins stay exact and gain the field, with the encoded string spelled out rather than wildcarded. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…the web seam (OTA phase C, C6.3+C6.4) (#21760) * feat(mobile): paint browser screencast frames through web siblings (OTA phase C, C6.2) The pane's frame path is written against React Native's native-prop writer, which does not exist on React Native Web: a ref there is the DOM node, so both writes throw and the pane never shows a frame. Three `.web.ts` siblings, each for a measured gap. - The image and layer writes move out of `mobile-browser-frame-state.ts` into `browser-frame-layer-paint.ts`, whose sibling paints the frame as a `background-image` on the element RN Web sizes and flips the double buffer with one opacity write per layer. The pane still never re-renders while it streams. - A `background-image` write fires no load event, so the offscreen layer would never become visible. The sibling arms the flip from an image decode instead, and the flip itself is shared with the native `onLoad` path rather than written twice. - The data URI keeps the base64 the bridge already carried instead of encoding the bytes back into the same string. Measured in this tree against the `buffer` shim the page bundle resolves: 0.256 ms per frame at 45,815 bytes and 2.61 ms at 463,942, against under a microsecond for the carried string. Per C6 ruling 5 the pane asks for binary frames only when the shell granted the lane, and renders its existing stream-error state otherwise, so a page never waits on frames a shell without the encoder cannot send. The grant name is a placeholder until C6.1 reports it. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * feat(mobile): budget the mobile view's frame area against the bridge cap (OTA phase C, C6.3) A screencast frame crosses the bridge as one message under BRIDGE_MAX_MESSAGE_BYTES. Measured here: the phone's mobile view at the native device scale factor asks for a 390x712 viewport at 2x, which is 1,110,720 device pixels, and at the worst case JPEG has at quality 72 that is a 807,559-byte message against a 655,360-byte cap — 123% of it. The `.web.ts` sibling holds the mobile view inside that. The budget is computed rather than written down: the cap, less an envelope this measures from the frame's own shape at its widest (435 bytes), is what the base64 may occupy; three quarters of that is the JPEG; divided by one named worst-case constant of 0.545 bytes per pixel it is an area of 901,271 pixels. The phone lands on a device scale factor of 1.80 and a 654,205-byte message, 99.8% of the cap. A cap that moved and a budget that did not would be a pane going dark on a page it could have streamed. Web view mode is untouched, and byte-identical to the native request: there the frame is a desktop viewport letterboxed into maxWidth/maxHeight, which the page cannot predict, so C6 ruling 1's drop-the-over-cap-frame rule is its only protection. Native is unchanged. The constants and the assembly move to a third module because a `.web.ts` cannot import a value from the file it shadows — the bundler resolves the specifier back to the sibling itself — and two copies of them would drift. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * feat(mobile): put the browser pane's text inputs on the web font-size seam (OTA phase C, C6.4) The pane has two text inputs, the address bar at 12px and the key row's "Type on page…" at 14px, and neither went through TEXT_INPUT_FONT_SIZE. In a browser an input under 16px makes iOS zoom the page on focus and never zoom back, and keyboard-occlusion.web.ts reads a visual viewport scale other than 1 as "no keyboard" — so one focus would leave the pane's keyboard lift at 0 for the rest of the typing session. C4.2's failure exactly, on a screen its census does not walk: that census walks the source-control hub and the review route, and the pane is in neither until C7 lists a route that mounts it. The key row's input goes straight onto the seam, whose native value is the theme's body size, so it renders at the 14px it already did. The address bar is a `.web.ts` split instead, so native keeps the 12px meta size it has always shown; the input and the label painted over it move together, or the address would resize on every focus. The address bar also gets inputMode="url" on the web only. keyboardType is a native enum a browser does not read, so the page's address bar was falling back to a plain keyboard; inputMode takes precedence over keyboardType, so it stays undefined on both native platforms. One consequence recorded rather than fixed, and pinned in config/scripts/mobile-web-app-browser-pane-text-inputs.test.mjs: the C4.2 census resolves an import through .ts/.tsx only, never .web.ts, so it reads the native address style that no browser loads and reports it as an offender. Whoever lists the pane's route either teaches resolveLocal the extensions the builder already prefers, or moves the address bar onto the seam natively at 14px. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): name C6.1's binary screencast grant (OTA phase C, C6.2) C6.1 has decided the name: `screencastBinary`, one camelCase token. Replaces the placeholder this PR landed with while C6.1 was still choosing. The placeholder was also unusable, which the test added here would have caught: `GRANT_NAME_PATTERN` in the manifest contract admits a bare name or a `native.`-prefixed verb and nothing else, so a route declaring `browser.screencast.binary` would have been refused by the bundle before any shell saw it, and the pane would have taken its stream-error branch for a reason no screen could report. The name is now checked against `MobileWebBundleRouteSchema` itself rather than against a restated regex, with the dotted spelling as the failing case beside it. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): keep the address field test inside the typecheck ratchet (OTA phase C, C6.4) `findByType('TextInput')` does not typecheck: a host-component string is not an `ElementType`, so the file fell out of `tsc -p tsconfig.test.json` and the tests-typecheck ratchet reported it. Found by reading the ratchet's exit code rather than its piped tail, which is how it was missed the first time. The element is looked up by its placeholder instead, and the ratchet is green with 732 test files in the program. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): answer a frame decode for the frame, not the layer (OTA phase C, C6.2) Round 1 folds on #21754. The undecodable arm freed the pending slot without checking whose frame had failed, while the displayable arm checked. Reproduced: frame 2 goes pending on layer 1, frame 3 repoints the same layer, frame 2's decode rejects and clears the slot layer 1 is holding for frame 3, then frame 3 decodes and the flip is refused because the slot no longer names its layer. The newest frame sits decoded at opacity 0 behind an older one, and a page that has gone still sends no further frame to recover with. Web only; native never calls this. Both arms now answer for the frame they were armed with. The displayable arm's own guard had no test: deleting it left `src/browser/` and the full suite green, because the case that exercised it settled both decodes and asserted an end state both orders produce. The harness now settles one decode at a time, keyed on the source it was given, and the ordered case reds without the guard. Also: the paint sibling's opacity test claimed "no re-render" while asserting two style strings, so it is named for what it checks and the claim is counted where React is — across ten streamed frames the three state setters are called once each, on the mount frame. And the overrides allowlist is rebuilt from main's bytes plus the new entries, so two pre-existing reasons keep their literal em dash instead of a re-serialized escape. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): find the address input by its imported type (OTA phase C, C6.4) `findByType('TextInput')` does not typecheck — a host-component string is not an `ElementType` — so the file dropped out of `tsc -p tsconfig.test.json` and the tests-typecheck ratchet reported it. The imported component is what the element is looked up by now; the react-native mock stands it up as that same string at runtime, so the lookup is unchanged and the file is back inside the ratchet's program. Why the earlier run reported 0: the command was `node scripts/check-tests-typecheck-ratchet.mjs 2>&1 | tail -2; echo $?`, and `$?` after a pipeline is the exit code of `tail`, which is always 0. The banner line that printed was the last line of the failure banner, not the success one. Every gate in this branch's report is now read from the command itself, unpiped. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(scripts): read a text input's size from the file the page loads (OTA phase C, C6.4) The census followed an import through `.ts`/`.tsx` only, while the closure it walks comes from esbuild, which prefers `.web.tsx`/`.web.ts`. So a style module with a platform sibling was judged on the half no browser loads. That fails in the direction that matters: a split whose web half sits under the focus-zoom floor reads as clean because its native half is on the seam, which is the exact shape the seam exists to catch. `resolveLocal` now tries the extensions in the builder's own order. The seam comparison collapses a resolved path onto its module identity before matching, because the seam is itself a split — `text-input-font-size.web.ts` is where the raise lives — and without that every binding in the tree would stop naming the seam: deleting it reds both C4 route closures. The browser pane's own census flips from pinning its address field as an offender to expecting none. The two C4 route closures still answer 0 offenders and 0 unresolved, run with the closure tests enabled. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): bound the frame envelope above every double it can carry (OTA phase C, C6.4) Round 1 folds on #21760. The envelope estimate serialized each metadata field as a 16-character double, so the bound was 435 where a real frame event at its widest measures 516. Since the budget spends whatever the cap leaves, that 81-byte shortfall was the whole margin: a frame on the budget would have gone over the cap and been dropped. The bound is now the skeleton plus the widest a double can print, for the nine metadata keys imported from the protocol module rather than copied, so a tenth field cannot be added without being paid for. Two corrections to the fold as written, both measured here. The widest is 25 characters, not 24. Exponential form tops out at 24 (`-1.7976931348623157e+308`), but ToString only leaves fixed notation below 1e-6, and just above it a double prints as sign, `0.`, five zeros and seventeen digits: `-0.0000012345678901234567`. A sweep over four million random bit patterns found 25 and nothing longer; a deterministic sweep over both forms is in the test. And the base64 expansion has to count padding. Three quarters of the room claims up to two characters base64 does not have for an image of 3k+1 bytes, which at a margin the budget now spends exactly is a dropped frame. The two agree at today's envelope size because the room happens to divide by four, so this is a latent fix rather than a reproduced one, and the test pins the discrepancy directly instead of implying it. Budget moves from 901,271 to 901,161 pixels; the phone's mobile view stays at a device scale factor of 1.80. Pinning the bound against C6.1's real encoder is C6.5's, once both are on main; the docstring says so, and says what the bound does not cover: the metadata object is loose, so unknown keys and web view mode's letterboxed frame are ruling 1's to drop rather than this budget's to predict. Also: the pane census listed its own closure by hand, so "no unresolved styles" said the walk read those files, not that they are the pane's set. It now scans `src/browser` for every non-test module that renders a `TextInput` and asserts the list matches; a third module planted there reds it. And the seam's native-consumer pin names the key row and the address bar directly rather than transitively, matched at the `fontSize` property instead of anywhere in the file — a file-wide search survives the change, because the import line does. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): check the frame write against a real react-native-web Image (OTA phase C, C6.2) Round 2 folds on #21754. Every test for the web paint sibling handed it a `div > div` of its own making, so the assumption it rests on — that the host's first element child is the one carrying the frame — was only ever checked against a shape written to match it. React Native Web also renders an accessibility `<img>` in there, and a release that reorders those children would keep all of them green while the pane painted nothing. One test now renders the real component, asks it which child it painted, and checks the write lands on that one. Pointing the sibling at `lastElementChild` reds it and leaves the hand-built cases passing, which is the gap. A second case records what the `<img>` does: the streaming path writes styles and never props, so it keeps the source it mounted with for the life of the pane, and that is what a screen reader and the image context menu see. react-native-web ships no type declarations, so the component comes through `createRequire`, whose return is `any` at its own signature; the one prop it renders with is declared rather than asserted, and the file stays inside the tests-typecheck ratchet. The module docstring also claimed more than the code does. The frame path adds no render, but a render from any of the pane's other state — address focus, a dialog, the view mode, zoom — repaints both layers from `renderedFrameSource`, which reads `frameUriRef.current`, so both land on the newest frame whether or not it has decoded. Native clobbers the same way through `setNativeProps`. Said plainly, along with what restores the buffering. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * docs(mobile): say what a render does to the accessibility image (OTA phase C, C6.2) pullfrog is right, and the test carried the same wrong claim. The note said the hidden `<img>` keeps the frame it mounted with for the life of the pane, two paragraphs after saying a render from the pane's other state passes `renderedFrameSource` as `source` — and React Native Web derives that image's `src` from the same prop it paints the background from, so the first such render moves it. Measured here rather than reasoned about: rendering the real component, writing a frame imperatively, then re-rendering with a new source moves the `src` and leaves the background where the imperative write put it. The two halves are now two cases, named for what each one shows, and the note says the streaming writes never touch it while a render does — so it holds the frame the pane last rendered with, not the one on screen. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

Summary
Phase C, C6.2: the browser pane's frame path on the web (
design-ota-c6.md§1 (b), §4; rulingsrulings-ota-c6.md5 and 6). Five commits onee61e3bd41, inert: no route reaches the pane (it mounts from the session screen, C7's route), no manifest entry, no grant declared by any route.The pane's frame writes are written against React Native's native-prop writer, which does not exist on React Native Web: an
ImageorViewref there is the DOM node itself, so both writes throw (setNativeProps is not a function, pinned by the sibling's test against a DOM node) and the pane never shows a frame. Three.web.tssiblings, each for a measured gap and each with its reason inweb-entry/web-overrides.json:browser-frame-layer-paint.web.ts(the two writers move out ofmobile-browser-frame-state.tsintobrowser-frame-layer-paint.tsfirst)background-imageon the element RN Web sizes and flips the double buffer with one opacity write per layer; the pane still never re-renders while it streamswhenBrowserFrameDisplayablein the same sibling, armed fromuse-mobile-browser-frame-apply.tsbackground-imagewrite fires no load event, so the offscreen layer would never become visible; the sibling arms the flip fromnew Image()+decode(), the flip itself shared with the nativeonLoadpath throughbrowser-frame-layer-flip.ts, and a stale decode cannot flip (guarded on the current frame URI)browser-frame-data-uri.web.tsBrowserScreencastFramegains an optionalb64, set only bydecodeBridgeScreencastFrame;imagestays the field every consumer reads) instead of encoding the bytes back into the same stringPer ruling 5 the pane asks for binary frames only when the shell granted the lane (
use-browser-binary-screencast-grant.tsanswers true natively, its.web.tsreadsinit.grants.native), and otherwise withholds the binary listener and renders its existing stream-error state with "Update the Orca app to stream browser tabs here." The grant name isscreencastBinary(C6.1's, #21758; verified against the manifest's one-token pattern and both open readers; a local constant here until both have landed, then an import ofbridge/bridge-screencast-grant.ts); it is absent from the shell's implemented set until C6.1 lands, so today every web pane takes the error branch, which is the correct and inert answer.8917dd8280<img>note said it keeps the mount frame for the life of the pane; measured against the real RN WebImage, a render from the pane's other state moves itssrcwith thesourceprop while the background stays where the imperative write put it, so it holds the frame the pane last rendered with rather than the one on screen; the one case became two (streaming writes leave it alone; a render moves it)0d9d5feaebImagethrough react-dom into happy-dom, finds the child it painted by the mounted frame rather than by position, hands the host to the sibling and asserts the write lands on that element (red-first: pointing the sibling atlastElementChildreds it while the four hand-built cases stay green; the host is aDIVwith childrenDIV, IMG, the first carrying the inlinebackground-image); a second case pins that the accessibility<img>keeps the source it mounted with, because the streaming path writes styles and never props. react-native-web ships no type declarations, so the component comes throughcreateRequirewith its one prop declared rather than asserted (a bare import is an implicitanyand drops the file out of the tests-typecheck ratchet). The docstring now says the frame path adds no render, and that a render from the pane's other state (address focus, a dialog, the view mode, zoom) repaints both layers fromrenderedFrameSource, natively too throughsetNativeProps, with the next streamed frame restoring the buffering1bdda61addonUndecodablefreed the pending layer unguarded whileonDisplayablewas guarded on the current frame, so an older frame's late decode failure stranded a newer frame repointed onto the same layer at opacity 0 (web-only; native's singleImagesource cancels the older load); both arms now answer for the frame they were armed with through oneisCurrentFrame()predicate, red-first with exactly that sequence; a case for the stale-decode guard that reds when it is deleted (the harness settles one decode at a time, keyed on its source); the "no re-render" claim counted where React is (ten frames, each of the three state setters called once, on the mount frame) instead of asserted by two opacity strings; the overrides list rebuilt from main's bytes plus the new entries so the diff touches only them00223f75fbscreencastBinary(C6.1's), pinned againstMobileWebBundleRouteSchemaitself with the dotted placeholder beside it as the failing case: the placeholderbrowser.screencast.binaryfailedGRANT_NAME_PATTERN, so a route declaring it would have been refused by the bundle before any shell saw it401884e8bdMeasured
Re-encode cost per frame with the
buffershim the page bundle resolves (not Node's builtin, which is ~20× faster and would understate it; the test imports the shim and says why):b64Red first
b64passthrough: the bridge frames test red on the decode assertion until the decoder set it.Not in this PR
screencastBinarygrant in the implemented set (C6.1, in flight). Until it lands the granted branch of the web hook's test is a page-side read: the port-pair harness passes route grants straight intoinitwithout filtering through the shell's implemented set, so it is not an end-to-end shell verdict.Verified
401884e8bd: mobile tsc, ratchet, whole-tree oxlint, oxfmt, root oxlint on the changed files, full mobile suite (733 files, 8267 passed, noErrorsline; the lane reported 8268, both reviewers and the lead measured 8267), config/scripts with mobile deps required (223 files, 2053 passed; the overrides census green on the three new entries), changed-code quality (20 files, 0 findings) and react-doctor againstee61e3bd41, merge-tree max-lines clean, machine-path grep clean.401884e8bd): approve with folds, all in1bdda61add; the frame-loss sequence reproduced in a throwaway tree; CodeRabbit (Major) and pullfrog found the same guard.1bdda61add): approve; all six mutations red as claimed; notes: no test pinned the real RN Web<Image>DOM shape the sibling rests on (folded); a render from the pane's other state rewrites the imperative frame write fromrenderedFrameSource, natively too (docstring corrected); the accessibility<img>keeps the mount frame (recorded, not fixed: the frame is not readable content); frame identity is the URI, so two byte-identical frames share one, which only matters for a decode failure on bytes that just decoded.verify-gates.shon401884e8bd,1bdda61add,0d9d5feaeband8917dd8280againstee61e3bd41(mobile 733/8267, 733/8272, 733/8274 and 733/8275, config 2053, exit 0, machine paths 0; merge-tree clean against8dee68a8d1); on1bdda61add, dropping the guard ononUndecodablereds the new case and nothing else ; removing the grant guard reds the never-subscribes case; commenting out the flip arm reds both web frame-apply cases; the only casts without aSAFETY:line predate the PR.Part of the mobile OTA plan (Phase C). Reference PR #13386, never merged.