Repository navigation
fix(mobile): route the bottom drawer's keyboard through the platform seam (OTA phase C follow-up) - #22556
Conversation
…seam Fill-mode sheets called Keyboard.metrics() directly, which react-native-web does not implement, so opening one on the page threw and the shell re-downloaded the workspace. The drawer now reads useSoftKeyboard, whose native half seeds from metrics() and carries the event duration, and whose web half answers from the window (duration 0). The fill/content-sized seed rule and resolveBottomDrawerKeyboardInset are unchanged. A census keeps Keyboard.metrics/addListener inside the seam plus the tab-sheet hide wait. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…nsus The bottom drawer now reads the keyboard seam, so no module in the source-control or review closures names react-native-web's Keyboard stub. The census also flags Keyboard.metrics, which the stub lacks. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…e seam
The seam now exports subscribeSoftKeyboard and currentSoftKeyboardHeight
beside its hooks. The drawer's effect is back to its original shape with
only its Keyboard calls swapped for the pair, and useSoftKeyboard is back
to {height, visible} with no metrics() seed. Seeding every consumer opened
an iOS window between willHide and didHide where metrics() still reads
open. The web pair answers from visualViewport, so it stays silent inside
the shell and lifts sheets in a plain mobile browser.
Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
A keyboard already covering the page when subscribeSoftKeyboard attached never produced onHide when it closed, so the occlusion hook and a seeded fill sheet stayed lifted. Outside the shell only. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 (9)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe change adds native and web functions to read the current soft-keyboard height and subscribe to keyboard events. Merge Risk: ⚪ Minimal · up to The bottom drawer now reads keyboard state through the shared platform layer instead of calling React Native's keyboard API directly. This avoids the crash reported when fill-mode sheets open inside the hybrid web shell, while native keyboard lifting behaves as before. Tests cover native events, cleanup, and web layout when the window resizes. No blocking risk remains. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the problem, implementation, rationale, and validation results, but it omits required template sections, including the linked issue, visual proof or an explicit N/A explanation, the Testing checklist, and the remaining checklist and review sections. Resolution Complete the required template sections. Add the linked issue after “Fixes #”, attach before-and-after visual proof or state N/A with a reason, complete the Testing section and platform coverage, disclose AI use if applicable, complete the Agent skill upstream boundary, Notes, Review, and Checklist sections. ✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
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.
✅ No new issues found.
Reviewed changes
- Drawer routed through the keyboard seam —
mounted-bottom-drawer.tsxdrops the directKeyboard.metrics()seed andKeyboard.addListenerpair forcurrentSoftKeyboardHeight()/subscribeSoftKeyboard; the native effect keeps its fill-only seed, duration fallbacks, and unsubscribe behavior. - Seam gains an imperative pair — both
keyboard-occlusion.tsand.web.tsexportsubscribeSoftKeyboard(onShow, onHide)andcurrentSoftKeyboardHeight(); nativeuseSoftKeyboardnow delegates to the pair, web'suseKeyboardOcclusioncomposes them (seeding its lift from the same strip and starting itsopenflag from it so an already-up keyboard still fires the hide). - Page-safe geometry — the web sibling answers from
visualViewport's uncovered strip and returns 0/noop with no viewport, so a sheet on the hybrid-shell page never asks RN'sKeyboard(whose web stub has nometrics) for geometry. - Censuses tightened — the source-control/review closure test drops the
mounted-bottom-drawer.tsxexemption and now also catchesKeyboard.metrics(; a new whole-srccensus pins geometry readers to the seam plus the named tab-sheet file. - Tests — drawer-vs-seam, drawer-vs-react-native-web, and the new seam pair (already-up seed, hide-once, no-viewport) cover the changed paths.
I traced the native extraction against the previous effect (event/duration/seed semantics preserved), confirmed the web refactor of useKeyboardOcclusion is equivalent to the old read()-on-mount subscription, and verified by grep that the new census's expected two readers are the only non-test files in mobile/src containing Keyboard.metrics(/Keyboard.addListener(. The one behavioral change beyond the crash fix is that content-sized web sheets now lift on keyboard show where they were previously inert — an improvement.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Why
On the hybrid-shell page, opening any fill-mode bottom sheet (the create-worktree name sheet, for one) threw
Keyboard.metrics is not a function, the page's renderer crashed and the shell re-downloaded the workspace.mounted-bottom-drawer.tsxreadKeyboard.metrics()and subscribed toKeyboardevents directly; react-native-web'sKeyboardstub has nometrics. Found by the page-vs-native visual audit.What
The page must not ask React Native's
Keyboardfor geometry: on the page the shell owns the keyboard (it shortens the WebView) and the platform seammobile/src/platform/keyboard-occlusion.ts/.web.tsalready knows that. The seam now exports an imperative pair,subscribeSoftKeyboard(onShow, onHide)andcurrentSoftKeyboardHeight(); native buildsuseSoftKeyboardon the same subscribe (nometrics()seed there, so the iOS will-hide/did-hide window stays confined to the fill-sheet seed exactly as before); web answers fromvisualViewport(0 inside the shell, the covered strip in a plain browser) and starts its open flag from the current strip so a keyboard already up when subscribing still fires the hide. The drawer's effect is the base version with those two calls swapped; nothing else in it changed. The keyboard-geometry census now coversKeyboard.metrics(and has no drawer exemption.Proof
Keyboard.metrics is not a functionon base; seam sequence testexpected [] to deeply equal [ 'hide 0' ]before the open-flag fix; census red on base.$.Keyboard.metrics is not a function+Renderer process crash detectedand the workspace re-downloads; after, the sheet opens and the field focuses with 0 faults; sheet bottom 1847 on WebView bottom 1848 = keyboard top 1848.mobile-web-app-frame-budget-sweep,pr-workflow-parallelism) that pass solo (25/25) and passed in the previous gate on this branch.