Skip to content

fix(mobile): measure the keyboard from visualViewport inside the page (OTA phase C, C4.2) - #21735

Merged
Jinwoo-H merged 10 commits into
mainfrom
ota-c4-2-keyboard
Sep 20, 2026
Merged

Jinwoo-H merged 10 commits into
mainfrom
ota-c4-2-keyboard

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​796 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​796
Prod 18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​584 $\color{#cf222e}{\Huge{\mathbf{−}}}$​36 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​548

Summary

Phase C, C4.2: keyboard geometry inside the page (design-ota-c4.md §4, keyboard row). React Native Web's Keyboard.addListener is a no-op and Keyboard.isVisible() is always false, so inside the shell's page the source-control commit bar never lifted and the review note composer's KeyboardAvoidingView was inert: the software keyboard covered the input. Inert today: no registered route reaches either consumer; C4.4 registers them.

commit what
d4d8ac1994 src/platform/keyboard-occlusion.ts and .web.ts, the same shape as the external-link, clipboard and haptics seams; the override entry with its reason
f545569fa7 the hub's lift hook becomes a thin consumer (its name stays because it is what the hub's state calls the number); the note composer takes bottom padding on web where KeyboardAvoidingView cannot; the census
0834d5e235 the hoisted test harness typed instead of cast
823239f941 CodeRabbit on c94890b5a3, three holes in the census, each of which read as 0 offenders and 0 unresolved before: an inline style literal (style={{ fontSize: 14 }}, or one inside a style array) was never a reference, so style props now flatten through arrays, spreads, ?:, && and parentheses to what can land, with a call or other unfollowable element named as unresolved; a direct key was answered before a later spread that overrides it at runtime, so properties and spreads are read in one reverse-source-order pass; the seam was matched by initializer text, so a local const TEXT_INPUT_FONT_SIZE = 14 or the name imported from another module passed, and the seam is now resolved as a binding (an import from src/platform/text-input-font-size whose imported name is the seam export). Six fixtures, all red on the previous walk
c94890b5a3 the input census answers for every TextInput it walks: a style it cannot follow (an object it cannot find, a spread it cannot open) is reported as path:line (key) and both closures assert that list is empty, so an input off the seam cannot hide behind an unresolvable style; measured 12 TextInputs, 13 style refs, 12 on the seam, 1 sizeless (styles.disabled), 0 unresolved; a fourth fixture pins the report
22f8eec482 pullfrog: the floor covered two inputs while both closures hold more (iOS never zooms back out, so one focus in any sub-16 px input leaves scale !== 1 for the session); every TextInput in both closures takes the seam, eight more sites (search field, smart-workspace source and advanced fields, new-worktree form, link-PR form, PR sidebar, comment composer and title editor, source drawer), all of which declared typography.bodySize, so the phone is byte-identical; a census under config/scripts resolves each TextInput's style to the module that declares its size (following spreads, which the two original inputs need) and names anything off the seam by path:line, red-first with those eight
3175f137da CodeRabbit: maximum-scale=1 blocks user pinch zoom on engines that honour it (Android), so it is gone from both metas; the two consumers' inputs take their size from src/platform/text-input-font-size.ts (the body size natively, byte-identical 14 px on the phone) and its .web.ts (raised to 16 px through Math.max, so a theme above 16 keeps its own), which stops the iOS focus auto-zoom without capping zoom; pinned by three cases, one of which reads the styles' source so a revert to typography.bodySize cannot ship 14 px to the web
c0fd9d7722 round 2: maximum-scale=1 on the page's viewport meta (since reverted, see above; the rest stands); the census plants its fixture under mkdtemp through a root parameter instead of the real tree (a sibling census lists mobile/src in a parallel worker); a case for scale 2 with a keyboard-shrunken viewport (answers 0 by ruling); the absent-viewport guard names both shapes (null on the DOM type, absent on an older WebView; the ?? undefined coalesce had been folding them and removing it alone threw on the absent case); the native padding test renders through the test renderer with a Keyboard.addListener counter
fd874a2584 round 1 and CodeRabbit: a clamp case (a visual viewport taller than the layout one, which mobile Safari reports mid-scroll); the dead viewport === undefined guard removed and the surviving case names the guard it proves; zoom answers 0 with scale read defensively (absent → 1); the false inset sentence deleted from the moved comment; the census exempts the two seam files by name, not the directory, with a planted subscriber beside them as the fixture

The seam

Native: the measurement the hook made, moved not rewritten (iOS keyboardWill*, Android keyboardDid*, the event's end height, reset on hide, listeners removed on unmount). Web: window.innerHeight - (visualViewport.height + visualViewport.offsetTop), clamped at 0, read at mount and on resize and scroll, 0 when visualViewport is absent. offsetTop is in it because a scrolled visual viewport moves the offset without resizing anything; dropping it reds the offset and scroll cases. A pinch-zoomed viewport (scale other than 1) answers 0: geometry alone cannot tell a zoom from a keyboard and a stored "no keyboard" baseline would be a heuristic. Round 2 showed that is not rare on iOS: WKWebView auto-zooms on focus of any input under 16 px and both consumers' inputs are 14 px. A maximum-scale=1 meta was tried and rejected (it caps user zoom on Android); the inputs are 16 px on web instead, so a scale other than 1 means the user pinched, not that an input took focus. The device proof (C4.6 step i) is what settles it; nothing here was measured on a device.

Two exports, on purpose. useKeyboardOcclusion is the measurement. useKeyboardAvoidingPadding is 0 on a phone and subscribes to nothing there, because KeyboardAvoidingView has already moved the composer and padding would move it twice; on the web it is the whole of the avoidance. The alternative, one hook and a Platform.OS branch at the call site, would have added two listeners and a re-render per keyboard toggle to a shared component on native. The phone renders exactly what it rendered before: the padding is 0, so the style prop is undefined.

Census, red first

config/scripts: over the two future C4 route closures (derived through mobileWebAppRouteClosure), the seam's web file is present and no module other than the two seam files subscribes to Keyboard directly (a planted src/platform/other.web.ts subscriber is named; restoring the directory-wide exemption reds that case). Before the fix it named use-mobile-source-control-keyboard-lift.ts as a stub subscriber and found keyboard-occlusion.web.ts in neither closure (run in a throwaway worktree at the base; no stash). mounted-bottom-drawer.tsx is exempt by name, and the census asserts the exemption is in both closures so it cannot outlive its subject: the drawer reads Keyboard.metrics() for a sheet opened over a raised keyboard and each event's duration to animate with it, neither of which the seam models, and it sits in C1's, C2's, C3's and C5's closures too, so moving it is a change to every page. Its listeners are inert on the web the same way, which is why the composer inside it takes its own padding. Open item in the plan.

Unit tests: native, both event names, show sets the lift to the event's height, hide resets, listeners removed on unmount; web (happy-dom), resize lifts by the uncovered part, offset and scroll count, restore resets, absence answers 0, an already-raised keyboard is read at mount, listeners removed on unmount.

Not in this PR

  • A render-check case: none of the five registered routes reaches the seam, the commit bar or the composer (the closure was run for each), and a headless browser cannot shrink visualViewport independently of the layout viewport anyway. C4.4's render check carries it, and C4.6 step i measures it on both simulators.
  • The bottom drawer's own keyboard tracking on the web (above).

Verified

  • Round 1 (on 0834d5e235): approve, every number reproduced (native parity byte-identical, composer padding 336/236/undefined on web, census red-first at the base); its three folds and CodeRabbit's exemption point are in fd874a2584.
  • Lane gates on 0834d5e235: mobile tsc, ratchet, whole-tree oxlint, oxfmt, root oxfmt and oxlint on the changed root file, full mobile suite (722 files, 8209 passed, no Errors line), config/scripts with mobile deps required (221 files, 2004 passed), changed-code quality and react-doctor against 9309350864, merge-tree max-lines clean, machine-path grep clean.
  • Round 2 (on fd874a2584): approve; its five items are in c0fd9d7722.
  • Merge of main b766f512ec (4378220671, no conflicts) for the DiffViewer.tsx max-lines fix.
  • Lead reproduction: verify-gates.sh on 0834d5e235 and fd874a2584 against 9309350864, and on 4378220671, 3175f137da, 22f8eec482, c94890b5a3 and 823239f941 against b766f512ec; on 823239f941, an inline { fontSize: 14 } on the commit input names MobileSourceControlContent.tsx:208 and a local shadow of the seam constant names mobile-source-control-list-styles.ts:143; pointing one input's style at an undeclared object reds the census naming MobileSourceControlContent.tsx:207 (commitInput); reverting one input to typography.bodySize reds the input census on both routes naming the line; the offsetTop mutation reds the two viewport cases; the native consumer's diff is the import and the doc comment.

Part of the mobile OTA plan (Phase C). Reference PR #13386, never merged.

…e (OTA phase C, C4.2)

react-native-web's `Keyboard` is a stub: `addListener` returns a
subscription that never fires and `isVisible()` is always false. A screen
inside the shell's page that waits for `keyboardDidShow` waits for the
life of the document, and the software keyboard covers whatever sits at
the bottom of it. Two C4 screens are text entry at the bottom.

`platform/keyboard-occlusion` is the pair. The native file carries the
source-control hook's logic unchanged, events and clamp and the comment
that travels with it. The web sibling reads `visualViewport`: the layout
viewport keeps its size and the visual one shrinks, so the occluded strip
is `innerHeight - (height + offsetTop)`. `offsetTop` is in it because a
scrolled or pinched visual viewport sits partway down the layout viewport
and the strip below it is not keyboard; dropping the term reds two cases.
It listens on `resize` and `scroll` — the browser scrolling a focused
input into view moves the offset without resizing anything — and reads
once at mount, because a composer opened over an already-raised keyboard
receives no event at all; dropping that read reds a third case.

`useKeyboardAvoidingPadding` is a second name rather than a `Platform.OS`
branch at the call site. Natively it is 0 and subscribes to nothing, so a
composer that asks for it renders exactly as often as it does today;
`KeyboardAvoidingView` has already moved it and padding would move it
twice. On the web it is the whole of the avoidance, that view being
driven by the events this file exists because the page never receives.

No `visualViewport` answers 0 rather than guessing.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…e (OTA phase C, C4.2)

The two consumers move onto the seam. The hub's hook becomes one line and
keeps its name, which is what the hub's state calls the number. The note
composer takes the padding as a style on the `KeyboardAvoidingView` it
already had: natively that is 0, so the prop is `undefined` and the phone
renders exactly what it rendered before; inside the page it is the strip
the keyboard covers, which is the only thing that moves the composer
there.

The census is over both future route closures rather than over the two
call sites: `platform/keyboard-occlusion` is the one module in either
closure allowed to name the stub. Red first at the base commit — run in a
throwaway worktree at `9309350864` rather than by setting the fix aside —
it named `use-mobile-source-control-keyboard-lift.ts` as a subscriber
outside the seam and found the seam's web file in neither closure.

`mounted-bottom-drawer.tsx` is exempt by name, and the census asserts the
exemption is really in both closures so it cannot outlive its subject. It
reads more than a height — `Keyboard.metrics()` for a sheet opened over a
raised keyboard, and each event's `duration` to animate with it — which
the seam does not model, and it sits in C1's, C2's, C3's and C5's closures
too, so moving it is a change to every page rather than to this domain.
Its listeners are inert on the web the same way, which is why the composer
inside it takes its own padding rather than inheriting one.

No render-check case: measured, none of the five registered routes reaches
the seam, the commit bar or the composer, and a headless browser cannot
shrink the visual viewport independently of the layout one anyway. C4.4
carries it.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…ds (OTA phase C, C4.2)

The changed-code gate flagged the two `as` casts in the hoisted harness.
A return type on the `vi.hoisted` callback says the same thing and is
checked rather than asserted, which is the shape the host-list route test
already uses.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
@coderabbitai

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 01bf5ac2-80c9-4324-aa3e-808176cb3802

📥 Commits

Reviewing files that changed from the base of the PR and between c94890b and 823239f.

📒 Files selected for processing (2)
  • config/scripts/mobile-web-app-source-control-text-inputs.test.mjs
  • config/scripts/mobile-web-app-text-input-font-size-seam.mjs
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/scripts/mobile-web-app-text-input-font-size-seam.mjs

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The change adds native and web keyboard-occlusion hooks and uses them in source-control and diff-review flows. It adds a platform text-input font-size seam and updates mobile input styles to use it. New tests cover keyboard events, viewport behavior, font-size resolution, route closures, and unexpected subscribers.

Priority: ➖ Normal

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 28 functions across 23 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: measuring mobile web keyboard occlusion from visualViewport. It is concise and specific.
Description check ✅ Passed The description is detailed and covers the implementation, rationale, testing, scope, deferred work, and known behavior. It provides sufficient context for review, although it does not follow every te…
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

Warning

Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use path_filters to narrow the review scope.


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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: a31d6448-a1cc-4469-8f31-c14af4b8c33e

📥 Commits

Reviewing files that changed from the base of the PR and between cef4416 and 0834d5e.

📒 Files selected for processing (8)
  • config/scripts/mobile-web-app-source-control-keyboard.test.mjs
  • mobile/src/components/MobileDiffReviewDrawers.tsx
  • mobile/src/platform/keyboard-occlusion.test.tsx
  • mobile/src/platform/keyboard-occlusion.ts
  • mobile/src/platform/keyboard-occlusion.web.test.tsx
  • mobile/src/platform/keyboard-occlusion.web.ts
  • mobile/src/source-control/use-mobile-source-control-keyboard-lift.ts
  • mobile/web-entry/web-overrides.json

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Reviewed the complete diff at 0834d5e235 (8 files), the two new unit suites, and the closure census, then reran the new tests locally.

  • Platform seam — keyboard-occlusion.ts / .web.ts centralize the measurement. The native file is a verbatim move of the old source-control hook; the web sibling reads visualViewport (innerHeight - (height + offsetTop), clamped, read at mount and on resize/scroll, 0 when absent).
  • Consumers — the hub hook now delegates to useKeyboardOcclusion; the review note composer takes useKeyboardAvoidingPadding as paddingBottom (0 on native, where the drawer/KeyboardAvoidingView already lifts).
  • Census — config/scripts/mobile-web-app-source-control-keyboard.test.mjs pins the web seam in both route closures and pins the single exempt Keyboard.addListener subscriber, with the exemption asserted to exist in both closures.
  • Override entry — web-overrides.json documents why the web sibling exists.

I confirmed the native test pins exact event names/heights/cleanup, the web test pins the offsetTop and scroll cases at exact values (so dropping offsetTop reds them), and the census test is non-vacuous via its "carries the seam" case. Reran mobile/src/platform/keyboard-occlusion*.test.tsx (14 passed) and config/scripts/mobile-web-app-source-control-keyboard.test.mjs (5 passed). The composition with BottomDrawer/MountedBottomDrawer checks out: on web those Keyboard listeners are inert (RNW Keyboard.addListener returns a no-op subscription), so the composer padding is the only avoidance and does not double-count.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…A phase C, C4.2 round 1)

Round-1 folds plus CodeRabbit's exemption point.

**A pinch zoom read as a keyboard.** A 2x zoom shrinks the visual viewport
by exactly as much as a half-screen keyboard, so the commit bar and the
composer moved on a page nobody was typing into. A `scale` other than 1
answers 0. Geometry alone cannot tell the two apart and a stored "no
keyboard" baseline would be a heuristic, so a keyboard raised while zoomed
is the accepted rare case rather than a guess. `scale` is read defensively
because older WebViews do not implement it, and taking its absence for
zoomed would answer 0 for every keyboard on them; mutating the guard to
key on absence reds both cases.

**The clamp had no test.** A bare subtraction left all nine cases green.
The case is a visual viewport taller than the layout one, which mobile
Safari reports mid-scroll and which would have pushed the commit bar down
the screen instead of up.

**One guard, where the test reaches it.** `occlusion`'s `viewport ===
undefined` arm was unreachable: the effect returns before calling it, and
the absence case exercised that one. Deleted, and the remaining case says
which guard it proves.

**The census exempts two files, not a directory.** `startsWith('src/platform/')`
would wave through a later `src/platform/*.web.ts` that subscribed to the
stub directly, which is the defect this census exists for. Named exactly,
with a planted subscriber beside the seam as the fixture; restoring the
directory filter reds it.

**And the moved comment claimed an inset it never subtracted.** Deleted.
Correcting a comment that was false where it came from is not a rewrite of
the logic the move carried: no statement moved with it.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Re-reviewed the delta at fd874a2584 against the prior pullfrog review at 0834d5e235, reading the full PR diff for context and rerunning the three touched suites.

  • Tightened the census exemption — keyboardSubscribers now exempts the two seam files by exact path (SEAM_FILES) instead of all of src/platform/, with a planted src/platform/other.web.ts subscriber test that a directory-wide filter would fail.
  • Added a pinch-zoom guard — the web seam answers 0 when visualViewport.scale !== 1, reading scale defensively (?? 1) for older WebViews; the cost (a keyboard raised while zoomed is not lifted) is documented rather than guessed at.
  • Added the missing edge cases — a clamp case for a visual viewport taller than the layout one, zoom-in and zoom-release cases, and a scale-absent case.
  • Removed dead code and a false comment — dropped the unreachable viewport === undefined guard from occlusion and the inaccurate safe-area-inset sentence from the native hook comment.

Both prior CodeRabbit threads are resolved, and the new tests are non-vacuous: the clamp, zoom, and scale-absent cases each red on the code they guard.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Jinwoo-H and others added 2 commits September 19, 2026 19:58
…yboard path (OTA phase C, C4.2 round 2)

Round 2's finding changes what the zoom guard costs. iOS auto-zooms on
focus of any input under 16px; both consumers' inputs are 14px
(`typography.bodySize`), and the page's viewport meta set no
`maximum-scale`. So `scale !== 1` was not the rare pinch the guard was
written for, it was every focus — and the seam would have answered 0 on
the one flow it exists for.

The guard stays and the premise is fixed instead: `maximum-scale=1` in
both places the page's meta is written, the built document in
`build-mobile-web-app-bundle.mjs` and the bootstrap `index.html`. iOS
honours it for the focus auto-zoom and has ignored `user-scalable=no`
since 10, so a deliberate pinch still works; the input sizes are
untouched. C4.6 step i is what settles it on a device.

Three test changes and one correction.

The census took a `rootDir`, as `findWebSiblings` does: it planted
`src/platform/other.web.ts` in the real tree while the overrides census
walks `mobile/src` in a parallel worker and would read it as an unlisted
override. It plants under `mkdtemp` now, and writes the two seam files
there too, so the empty result for them is the name exemption working
rather than those files happening not to subscribe.

A case for the ruling itself: scale 2 with a viewport shrunk past what
the zoom explains answers 0. Dropping the guard reds it and the pinch
case together.

`useKeyboardAvoidingPadding` is rendered through the test renderer now
instead of called outside one, with a counter on `Keyboard.addListener`.
Making the native hook return `useKeyboardOcclusion()` reds it at two
calls; the old shape could not see that, because a hook read outside a
component never runs its effects.

Item 4 did not hold as written. `window.visualViewport ?? undefined` is
not a no-op: the DOM declares the property `VisualViewport | null` and an
older WebView omits it entirely, so the coalesce was normalising both
shapes into one `=== undefined` check. Removing it and testing only for
`null` throws on the absent-viewport case (reproduced: `Cannot read
properties of undefined (reading 'scale')`). The coalesce is gone and the
guard names both shapes instead.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: eccf66c6-7054-4182-8687-993d7aaebaae

📥 Commits

Reviewing files that changed from the base of the PR and between fd874a2 and 4378220.

📒 Files selected for processing (6)
  • config/scripts/build-mobile-web-app-bundle.mjs
  • config/scripts/mobile-web-app-source-control-keyboard.test.mjs
  • mobile/src/platform/keyboard-occlusion.test.tsx
  • mobile/src/platform/keyboard-occlusion.web.test.tsx
  • mobile/src/platform/keyboard-occlusion.web.ts
  • src/mobile-web/index.html

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

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

maximum-scale=1 removes user pinch-zoom in both shells' WebViews, which contradicts the comment's claim that "a deliberate pinch still works". The iOS shell creates a bare WKWebViewConfiguration() and never sets ignoresViewportScaleLimits (default false), so WKWebView honors the page's scale cap and blocks pinch; Android WebView honors maximum-scale per spec and never focus-auto-zooms at all, so there the tag only removes zoom. Details inline.

Reviewed changes — Re-reviewed the delta at 4378220671 against the prior pullfrog review at fd874a2584, reading the full PR diff for context, rerunning the mobile typecheck, both keyboard suites and the closure census.

  • Page viewport capped at scale 1 — both src/mobile-web/index.html and the generated bundle HTML in build-mobile-web-app-bundle.mjs now carry maximum-scale=1, to stop the iOS focus auto-zoom that would otherwise trip the scale !== 1 guard and answer 0 on the ordinary focus path.
  • Absent-viewport guard names both shapes — the web effect checks null and undefined explicitly rather than coalescing to undefined, so a WebView without the property is not treated as though it has one.
  • Census fixture moved under mkdtemp — the planted-subscriber case writes through a rootDir parameter instead of into mobile/src, avoiding a race with the parallel web-overrides census; the seam files are planted with the same subscriber body, proving the exemption is by exact name rather than the directory.
  • Test hardening — the native padding case now renders through the test renderer with an addListenerCalls counter, and a zoom-while-keyboard case pins the accepted loss.

I reran pnpm --dir mobile typecheck (clean, including the viewport === undefined branch), the two keyboard suites (19 passed) and the closure census (6 passed) at 4378220671.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread src/mobile-web/index.html Resolved
…ing the page scale (OTA phase C, C4.2 round 2)

`maximum-scale=1` is reverted from both metas. It fixed the right problem
in the wrong place: Android WebView honours it and iOS ignores it for
pinch, so the cost of stopping an iOS focus auto-zoom was deliberate
zoom on Android, taken from the users who need it most.

The font size is where it belongs. `src/platform/text-input-font-size.ts`
is the app's body size and `.web.ts` is that raised to 16, the size below
which iOS zooms on focus and does not zoom back. The commit bar and the
review note composer take their `fontSize` from it. A phone renders what
it rendered before: the native constant is `typography.bodySize`, so both
style objects are unchanged there.

`Math.max` rather than the literal, so a theme that raises the body size
past 16 keeps its own value.

The zoom guard stays and its rationale is rewritten to say what now keeps
the ordinary path off it: the inputs clear the floor, so a scale other
than 1 means a user pinched rather than an input took focus.

The pin is a unit case because the render check has no route to open yet.
Three assertions and what reds each: the web constant below 16 reds the
first, and a style going back to `typography.bodySize` reds the third,
which reads the two stylesheets as source because a node test resolves
the native sibling and would otherwise pass while shipping 14px to the
web. The overrides census covers the swap itself.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The 16px floor is applied to only the two seam-served inputs, but both page closures also contain other 14px inputs (the PR sidebar's comment composer and title editor, search field, link-PR form, and reviewer picker). Because iOS does not zoom back out, one focus in any of them leaves the document at scale !== 1 and the seam answers 0 for the commit bar and note composer for the rest of the session.

Reviewed changes — Re-reviewed the delta at 3175f137da against the prior pullfrog review at 4378220671, reading the incremental range-diff and the full PR diff, and enumerating both route closures to check what else the page contains.

  • Reverted the viewport cap — maximum-scale=1 is gone from src/mobile-web/index.html and the generated page HTML in build-mobile-web-app-bundle.mjs, restoring user pinch zoom; the prior Pullfrog [!IMPORTANT] thread on this is resolved.
  • Added a text-input size seam — src/platform/text-input-font-size.ts (native body size, byte-identical 14px) and .web.ts (Math.max(bodySize, 16)), plus its web-overrides.json entry.
  • Raised the two seam-served inputs — the commit bar and the note composer take TEXT_INPUT_FONT_SIZE, so an ordinary web focus no longer auto-zooms the page.
  • Added a source-reading test — text-input-font-size.test.ts pins the web floor, native parity, and that both stylesheets import the seam.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…m (OTA phase C, C4.2 round 2)

The 16px floor reached two inputs and the rationale claimed a page. Eight
more text inputs in the same two closures still declared 14px, so a focus
on any of them zoomed the document and the occlusion seam — which reads a
scale other than 1 as no keyboard — stopped lifting for the rest of that
session. "A scale other than 1 means a pinch" was false while they were
there.

All eight go through `TEXT_INPUT_FONT_SIZE`, named by the census before
the change:

  src/components/MobileSearchField.tsx:175
  src/components/SmartWorkspaceAdvancedFields.tsx:84
  src/components/SmartWorkspaceSourceField.tsx:137
  src/components/new-worktree-form-styles.ts:125
  src/components/pr-sidebar/MobileLinkPrForm.tsx:120
  src/components/pr-sidebar/mobile-pr-sidebar-styles.ts:299
  src/components/pr-sidebar/pr-comment-composer-styles.ts:20
  src/components/smart-workspace-source-drawer-styles.ts:60

Every one declared `typography.bodySize`, so there was no input carrying
a size of its own to preserve and the phone is byte-identical again. Each
of those style keys was checked for consumers first: all of them are read
by a `TextInput` and nothing else, so raising the web value moves no
other element.

The census is the rule rather than the list. Over both closures it
resolves each `TextInput`'s style to the module that really declares the
size — following a spread, because both seam-served inputs are reached
through `{ ...base, ...list }` and a walk that stopped at the first
module would have called their offence absent — and names anything not on
the seam as `path:line`. A style with no `fontSize` inherits and is not
an offender. Presence precondition: the seam's web file is in the
closure, so an empty list cannot mean a page with no inputs.

Run against the previous head it prints exactly those eight for both
routes; three fixtures under mkdtemp cover the cross-module line, the
spread, and the two non-offender shapes.

The web test's rationale named `maximum-scale=1`, which is gone; it names
the input floor now.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…ase C, C4.2 round 2 addendum)

The offender list only says every text input is on the seam if every text
input was read, and the walk could not tell "this key sets no size" from
"I could not follow this style" — both answered nothing, so a resolution
failure would have read as a clean input and the rule would have gone
quietly vacuous.

`resolveStyleKey` answers three ways now: not found, found with no size,
found with one. `unresolvedTextInputStyles` reports the first as
`path:line (key)`, and the census asserts it is empty for both closures
beside asserting the offender list is.

Measured rather than assumed, which is what the addendum asks for. The
two closures hold 12 `TextInput` elements and 13 style references; none
uses an inline style object and none is without a style prop. All 13
resolve, 12 to `TEXT_INPUT_FONT_SIZE` and one — `styles.disabled`,
combined with `styles.input` on the same input — to a style that really
sets no size. The reviewer picker is in that list at
`mobile-pr-sidebar-styles.ts:300`; it was already on the seam from the
previous commit, which enumerated from the closure rather than from the
review.

A fourth fixture plants both shapes side by side: a style with no size,
which is not an offender, and a style reached through a package import,
which is named.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Re-reviewed the delta at 22f8eec482 against the prior pullfrog review at 3175f137da, reading the incremental range-diff and the full PR diff, and exercising the new census helper.

  • Raised every text input in both route closures to the size seam — eight more TextInput styles (search field, smart-workspace source and advanced fields, new-worktree form, link-PR form, PR sidebar picker search, comment composer and title editor, source drawer) now take TEXT_INPUT_FONT_SIZE, closing the gap where one 14px focus on iOS would leave the page at scale !== 1 and stop the seam lifting.
  • Added a closure-wide input census — config/scripts/mobile-web-app-text-input-font-size-seam.mjs resolves each TextInput's style through imports and spreads to the fontSize declaration and flags anything that is not the seam literal; the test asserts both closures are clean and carry the seam, with three planted-fixture cases proving the resolver is not vacuous.
  • Updated the stale zoom-guard comment — the web test now names the 16px input floor instead of the removed maximum-scale=1.

Both prior open threads are resolved by this commit. I ran the new census file: the three helper fixture cases pass (the four closure cases skip here without mobile deps).

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Re-reviewed the addendum at c94890b5a3 against the prior pullfrog review at 22f8eec482, reading the incremental range-diff and the census helper's final form, and rerunning the new test file.

  • Made the input census prove its own enumeration — resolveStyleKey now separates "the key exists and sets no size" ({ size: null }, inherits) from "the walk could not follow this style" (null), and a new unresolvedTextInputStyles reports the latter; both closures assert it is empty, so an input whose style the walk cannot follow fails the census instead of passing silently.
  • Added a fixture for the unresolved report — a fourth planted case proves an off-package style ref is reported as path:line (key) while a sizeless local style is not, and each style ref now carries its TextInput's line so the report can point at the input.

The helper's four fixture cases pass here (the six closure cases skip without mobile deps).

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 597cb635-c6bf-4126-bef2-b4d7113dfcc4

📥 Commits

Reviewing files that changed from the base of the PR and between 4378220 and c94890b.

📒 Files selected for processing (18)
  • config/scripts/mobile-web-app-source-control-text-inputs.test.mjs
  • config/scripts/mobile-web-app-text-input-font-size-seam.mjs
  • mobile/src/components/MobileSearchField.tsx
  • mobile/src/components/SmartWorkspaceAdvancedFields.tsx
  • mobile/src/components/SmartWorkspaceSourceField.tsx
  • mobile/src/components/mobile-diff-review-control-styles.ts
  • mobile/src/components/new-worktree-form-styles.ts
  • mobile/src/components/pr-sidebar/MobileLinkPrForm.tsx
  • mobile/src/components/pr-sidebar/mobile-pr-sidebar-styles.ts
  • mobile/src/components/pr-sidebar/pr-comment-composer-styles.ts
  • mobile/src/components/smart-workspace-source-drawer-styles.ts
  • mobile/src/platform/keyboard-occlusion.web.test.tsx
  • mobile/src/platform/keyboard-occlusion.web.ts
  • mobile/src/platform/text-input-font-size.test.ts
  • mobile/src/platform/text-input-font-size.ts
  • mobile/src/platform/text-input-font-size.web.ts
  • mobile/src/source-control/mobile-source-control-list-styles.ts
  • mobile/web-entry/web-overrides.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • mobile/src/platform/keyboard-occlusion.web.test.tsx
  • mobile/src/platform/keyboard-occlusion.web.ts

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

const offenders = new Set()
for (const entry of textInputStyleResolutions(mobileDir, closure)) {
const size = entry.resolved?.size
if (size !== undefined && size !== null && size.text !== SEAM_EXPORT) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '220,270p' config/scripts/mobile-web-app-text-input-font-size-seam.mjs
sed -n '105,140p' config/scripts/mobile-web-app-source-control-text-inputs.test.mjs

Repository: stablyai/orca

Length of output: 3057


🏁 Script executed:

set -eu
printf '%s\n' '--- definitions and imports ---'
rg -n -C 5 'SEAM_EXPORT|textInputStyleResolutions|TEXT_INPUT_FONT_SIZE|resolveStyleKey|fontSize' config/scripts/mobile-web-app-text-input-font-size-seam.mjs config/scripts/mobile-web-app-source-control-text-inputs.test.mjs src/platform config 2>/dev/null | head -n 260
printf '%s\n' '--- file outline ---'
ast-grep outline config/scripts/mobile-web-app-text-input-font-size-seam.mjs
printf '%s\n' '--- fixture context ---'
cat -n config/scripts/mobile-web-app-source-control-text-inputs.test.mjs | sed -n '1,155p'

Repository: stablyai/orca

Length of output: 50370


🏁 Script executed:

set -eu
printf '%s\n' '--- analyzer imports/constants ---'
sed -n '1,90p' config/scripts/mobile-web-app-text-input-font-size-seam.mjs
printf '%s\n' '--- resolver and offender definitions ---'
rg -n -C 12 'function resolveStyleKey|export function textInputStyleResolutions|export function textInputFontSizeOffenders|SEAM_EXPORT|resolveStyleKey' config/scripts/mobile-web-app-text-input-font-size-seam.mjs
printf '%s\n' '--- cited fixture imports and test ---'
sed -n '1,35p' config/scripts/mobile-web-app-source-control-text-inputs.test.mjs
sed -n '108,132p' config/scripts/mobile-web-app-source-control-text-inputs.test.mjs
printf '%s\n' '--- seam declaration locations ---'
rg -l --glob '!config/patches/**' 'TEXT_INPUT_FONT_SIZE_SEAM|TEXT_INPUT_FONT_SIZE' src config | head -n 40

Repository: stablyai/orca

Length of output: 11990


🏁 Script executed:

set -eu
printf '%s\n' '--- binding and value resolution ---'
sed -n ' seventy,205p' config/scripts/mobile-web-app-text-input-font-size-seam.mjs 2>/dev/null || sed -n '70,205p' config/scripts/mobile-web-app-text-input-font-size-seam.mjs
printf '%s\n' '--- all analyzer call sites and relevant assertions ---'
rg -n -C 6 'textInputFontSizeOffenders|unresolvedTextInputStyles|TEXT_INPUT_FONT_SIZE_SEAM' config/scripts --glob '*.mjs'
printf '%s\n' '--- candidate seam files ---'
find mobile src -type f \( -name '*text-input-font-size*' -o -name '*font-size*' \) -print 2>/dev/null | head -n 40

Repository: stablyai/orca

Length of output: 18956


Require fontSize to resolve to the platform seam. The check compares only the initializer text. A local or imported TEXT_INPUT_FONT_SIZE therefore passes without binding to mobile/src/platform/text-input-font-size.web.ts. The fixture at config/scripts/mobile-web-app-source-control-text-inputs.test.mjs:122 currently expects this bare identifier to pass, so it does not test the binding.

Resolve the fontSize identifier and accept it only when its module is TEXT_INPUT_FONT_SIZE_SEAM and its exported name is TEXT_INPUT_FONT_SIZE. Add fixtures for a local shadow and an import from another module.

…, C4.2 fold 3)

All three of CodeRabbit's findings are on the completeness property the
addendum bought, and all three reproduced before the change: each shape
below answered 0 offenders and 0 unresolved, which is to say it vanished.

Inline style literals. The walk recorded only `object.key` references, so
`style={{ fontSize: 14 }}` was neither an offender nor a hole. Style
props are flattened structurally now — arrays, spreads, `?:`, `&&` and
parentheses down to the expressions that can really land — rather than
walked as a subtree, which had the second bug of descending into an
inline literal's own properties. `&&` is followed because
`[styles.input, disabled && styles.disabled]` is the shape this tree
actually uses; `null`, `undefined` and `false` branches contribute no
style and are dropped rather than called unfollowable. An inline literal
resolves in place, and any other shape — a call, a bare identifier —
lands in the unresolved list.

Source-order precedence. `{ input: safe, ...legacy }` is `legacy.input`
at runtime, and answering direct keys before spreads read `safe` and
called the override clean. Properties are walked in reverse source order
now, direct keys and spreads in one pass, first answer wins.

The seam by binding. `size.text !== SEAM_EXPORT` accepted anything
spelled `TEXT_INPUT_FONT_SIZE`, so a local `const TEXT_INPUT_FONT_SIZE =
14` two lines up passed, and so did an import of that name from any other
module — the regression the seam exists to stop, wearing its name. The
identifier is resolved in the declaring module and accepted only as an
import from `src/platform/text-input-font-size`.

That last one changes what a fixture must say: the existing seam case
spelled the name without importing it, so it plants the seam module and
imports from it now. Six new fixtures, all six red on the previous walk.

Re-measured at this head, both closures: 12 `TextInput` elements, 13
style references, 12 on the seam, 1 sizeless (`styles.disabled`, combined
with `styles.input` on one element), 0 offenders, 0 unresolved.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Re-reviewed the delta at 823239f941 against the prior pullfrog review at c94890b5a3, reading the incremental range-diff and the full PR diff for context, and running the new census suite.

  • Closed three census holes, red first — styleExpressions now flattens an inline style literal (through arrays, spreads, ?:, &&, ||/??, parentheses and as), so style={{ fontSize: 14 }} is read rather than dropped; resolveStyleKey scans an object's properties and spreads in a single reverse source-order pass, so { input: safe, ...legacy } answers with legacy's; and the seam is resolved as an import binding of TEXT_INPUT_FONT_SIZE from src/platform/text-input-font-size instead of matching the initializer's text.
  • Added six planted-fixture cases — one per hole plus the spread-override ordering and the two TEXT_INPUT_FONT_SIZE shadows (a local constant and an import from another module), each asserting an exact offender or unresolved list.

I ran config/scripts/mobile-web-app-source-control-text-inputs.test.mjs at 823239f941 (10 fixture cases passed, 6 closure cases skipped without mobile deps) and confirmed every real stylesheet imports the seam from the extensionless path that isSeamBinding resolves to src/platform/text-input-font-size.ts. A targeted search for a resolver soundness hole inside the asserted HUB/REVIEW closures found none; the one shape the walk cannot see (a TextInput receiving its style through a JSX spread or a wrapper prop, e.g. MobileWorkspaceNameInput in the tasks route) is outside those closures and already an author-scoped blind spot.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit ee61e3b into main Sep 20, 2026
58 of 60 checks passed
@Jinwoo-H
Jinwoo-H deleted the ota-c4-2-keyboard branch September 20, 2026 05:29
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.

2 participants