Skip to content

fix(core): the keyboard height reads the whole keyboard while Safari pans to a focused field - #9983

Draft
vjeux wants to merge 10 commits into
meta:mainfrom
vjeux:uikit/c08-keyboard-pan
Draft

vjeux wants to merge 10 commits into
meta:mainfrom
vjeux:uikit/c08-keyboard-pan

Conversation

@vjeux

@vjeux vjeux commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Stack: #9983 → #8217
Merge group: #9983, #8217

User impact

While Safari on iOS pans the page to a focused field near the bottom, the keyboard module measured none. Readers such as useMobileKeyboard's recovery check took it as down.

Problem and solution fit

layoutViewportHeight read innerHeight, but the root's client height keeps the layout viewport's 714. At a visual-viewport scale of 1, innerHeight can equal the visual viewport's height while the root is as wide as the visual viewport. In that state, taking the larger of the two restores the keyboard's height; elsewhere nothing changes. A zoomed-out page's scaled innerHeight and unscaled root differ in units; a wider-than-screen layout has a taller root. The scroll clamp reads as on main.

Expected behavior and authority

spec:AST-099 FR2: "A page pan or a visual-viewport offset is a pan to put back (FR4), never a smaller keyboard". The FR2 verification row now names Safari's pan to a focused field and the Simulator.

Smallest restoration

layoutViewportHeight returns the larger of its current value and the root's client height (the body's in quirks mode), in that one state. The keyboard module keeps the layout viewport's height from each report (getKeyboardViewportHeight), for the keyboard's readers and the README's formula. No API change.

Evidence

The module's reading on a page Safari pans (a local probe story, not in the diff), iOS 26.2 Simulator, hostname masked:

Before: keyboard height 0 px with the keyboard up; after: 337 px

  • Reproduction before the change: innerHeight 377, root 714, visual viewport 377 panned 337: the module reads 0 (2 takes).
  • Result after the change: it reads 337, the whole keyboard (2 takes).
  • Representative unchanged path: unit cases keep a zoomed-out page and a too-wide layout at no keyboard, and the scroll clamp at main's reading. On the Android emulator at 280bac1 (table in Testing), the root's client height equals innerHeight in every reading, so the floor returns main's value.
  • Regression test: layoutViewport.test.ts and keyboardHeight.test.ts pan cases, red on main.

Open PRs on these files: #9777 and #10462 change the keyboard module, not layoutViewport.ts, and take keyboard store versions 2 and 3.

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Writing rubric results

R1 narration: none (the row states what verifies FR2). R2 research: none. R3 evidence: the row names its tests and the Simulator, no change. R4 rejected alternatives: none. R5 change references: none. R6 open questions: none.

Testing

  • 68c8231 merges main a4595ef, with no conflicts. The change's own lines are unchanged.
  • 2c322c1 merges main 9b5ad42 into 68c8231, with no conflicts. The change's own lines are unchanged.
  • 739a211 merges main 36f68b0 into 2c322c1, with no conflicts. The change's own lines are unchanged.
  • At 739a211: build, pnpm typecheck 0 errors, CI=true pnpm lint 0 errors, knowledge records, and the shared-identity and touch-bundle checks pass (18/18). Keyboard, Layer, BottomSheet, Text, Tooltip, field, Chat, motion, click-guard and resize-observer units: 4,043. Eight interaction specs pass in Chromium (73) and in WebKit's CI container (58, 15 skipped). pnpm review:pre has no findings, and the merge into main is clean.
  • History: main since 9b5ad42 changes utils/clickGuard.ts (fix(layer): a release does not dismiss the layer it opened #11258) and utils/sharedResizeObserver.ts (feat(Lightbox): a gallery's caption sits in a two-line band #9810), which keyboard/keyboardHeight.ts and keyboard/useMobileKeyboard.ts, changed here, import directly. It also changes Layer/useLayer.tsx (fix(layer): a release does not dismiss the layer it opened #11258, fix(layer): a press on another trigger of an open layer opens it there #11337), one of the shared layer modules DEC-31 lists. So evidence from earlier heads does not carry (spec:AST-094 DEC-31). Device runs at 739a211: Chrome with Gboard on a Pixel 8, below; Firefox for Android is pending.
  • Real Pixel 8, Android 17, Chrome 156 with Gboard 18.5, at 739a211, with version.json read before every take. Four of four cells kept and none failed in each profile.
    • The profiles are normal speed, 4× CPU slowdown, and animations removed with reduced motion set in the page. Each read the same, keyboard up and down.
    • AI chat's composer, default viewport: the visual viewport goes from 760 to 464 px with no pan. The composer's text ends 64 px above the keyboard.
    • AI chat under resizes-content: the layout viewport shrinks to 463 px with the keyboard. The composer's text ends 192 px above the layout viewport's bottom, as at 7952b5f.
    • BottomSheet's last field ends 48 px above the keyboard in the default viewport, and on the keyboard's top under resizes-content.
    • Keyboard down returns the viewport to 760 px at offsetTop 0 in every cell. Firefox for Android is not in this run.
  • 78d8a2a78c registers the keyboard store's shared key as version 4, as spec:AST-110 FR3 requires. viewportHeight changes the store's shape. Beside a copy with the earlier shape, the package could read a layout height that an earlier attach left. A two-copy case puts an earlier copy's listening store under version 1. The package keeps its own store and reads its own heights. On version 1 it reads the other copy's 300 px.
  • At 78d8a2a: CI=true pnpm lint 0 errors, and pnpm review:pre has no findings, with a clean merge into main. eb7aee3 differs from this head only in one comment. There, build, pnpm typecheck 0 errors, knowledge records, and the shared-identity and touch-bundle checks pass (18/18). Keyboard, Layer, BottomSheet, Text, Tooltip and Chat units: 2,697. Eight interaction specs pass in Chromium (73) and in WebKit's CI container (58, 15 skipped).
  • 3e01aa1 merges main be99721, with no conflicts. Main's Text and Tooltip fix (fix(Text, Tooltip): on Android, the first tap on a button or link in truncated text opens its tooltip; a tap on a text field never does #11213) changed keyboardHeight.ts after this change's base. The change's own lines are unchanged. At 3e01aa1, build, typecheck 0, CI=true pnpm lint 0 errors, pnpm check:knowledge and the shared-identity check pass. Keyboard, Layer, Chat, BottomSheet, Text and Tooltip units: 2,336. Six keyboard interaction specs pass in Chromium (70) and in WebKit's CI container (55, 15 skipped). They are BottomSheet's keyboard inset, ChatLayout's keyboard, the search field, field focus timing, the input hold and capped lists.
  • At 348b522, merged with main b6b0c68. The conflicts were import blocks only: useChatKeyboard.ts takes main's interaction-modality and focus-return imports, and keyboardTarget.ts main's nearestScroller import. Neither imports layoutViewport now, as their readers use getKeyboardViewportHeight. The change's own lines are unchanged. At the merge, ChatLayout's INV11 browser test passes 3 of 3 in Chromium. The Chat, keyboard and Layer interaction specs pass: Chromium 60, WebKit 45 with 15 skipped. Keyboard, Chat, Layer and layoutViewport units: 1,262 of 1,262. pnpm test:ui: 965 files, 23,490 tests pass. Typecheck 0, CI=true pnpm lint 0 errors, pnpm check:knowledge clean.
  • Merged with main 9a690d5 (no conflicts). On the plain merge, the pan check re-read the visual viewport's height in every keyboard measurement and in every reader laying out against it. ChatLayout's INV11 browser test read it 3 times per report. The keyboard module now passes its one read to layoutViewportHeight, and keeps the layout viewport's height with each report (getKeyboardViewportHeight). ChatLayout's keyboard hook, useMobileKeyboard, the Layer's keyboard clearance and the keyboard target read it there. INV11 browser test, Chromium ×3: 3 of 3 fail on the plain merge, 3 of 3 pass here. Two new units count one read per report under the pan, the second with a reader laying out; each fails without the fix (2 reads). Chat, keyboard and Layer interaction specs: Chromium 53 passed; WebKit 41 passed, 12 skipped. Core UI suite (pnpm test:ui): 920 files, 22,546 tests pass; CI=true pnpm lint 0 errors.
  • Red-first: on main's layoutViewport.ts, the 2 pan cases fail (one per test file); with the change all pass. The wide-layout, zoomed-out and scroll-clamp cases pass on main and here. The wide-layout cases fail on the previous head (a 1,105 px keyboard with none shown).
  • vitest --project ui keyboard module and layoutViewport: 74/74. Core units: 21,147 of 21,151 pass. The other 4, in Switch.focusRing.source-build.test.mjs and RadioListItem.press.source-build.test.mjs, fail on main too (a fresh install has no @babel/preset-react at the root).
  • Core typecheck 0 errors; strict ESLint (CI=true) 0 errors; Prettier; pnpm check:knowledge.

Android emulator readings at 280bac1, the pan floor's patch before the one-read report, in CSS px. A local probe page, not in the diff, reads the module built from that head. Android 16 BE2A.250530.026.D1, Chrome 133.0.6943.137 with Gboard 15.1.08, Firefox 159.0.1. Each reading taps a field at the page's bottom, then presses Back:

Browser, page Keyboard innerHeight Root client height Visual viewport (height @ offsetTop, scale) Module's keyboard height
Chrome + Gboard, default down 811 811 811.43 @ 0, 1 0
Chrome + Gboard, default up 811 811 499.43 @ 312, 1 311.57
Chrome + Gboard, resizes-content down 811 811 811.43 @ 0, 1 0
Chrome + Gboard, resizes-content up 499 499 499.43 @ 0, 1 0
Firefox, default down 796 796 795.6 @ 0, 1 0
Firefox, default up 796 796 486.2 @ 245.93, 1 309.8
Firefox, resizes-content down 796 796 795.6 @ 0, 1 0
Firefox, resizes-content up 486 486 486.2 @ 0, 1 0
  • Every row reads the same at normal animation scale, with animations removed (window, transition and animator scales 0), and under a slow-device profile. That profile holds the emulator to one host core. Only Firefox's slow default pass read offsetTop 0, before its pan. Back returns every pass to its "down" row. 12 passes, every screenshot viewed; a second run of the same 12 read the same numbers.
  • Under resizes-content, innerHeight equals the visual viewport's height at scale 1 with the keyboard up, so the new branch runs. The root shrinks with them, so it returns the same value as main.
  • Emulator readings on 76289f2's own deployment, on the Android 16 emulator with Chrome 133 and Gboard. They read the AI chat template's composer and the last field of BottomSheet's Mobile keyboard story. Default viewport: the page pans 288 px and the composer sits 193 px above the keyboard. resizes-content: no pan, and 193 px. BottomSheet's field sits 48.2 px above the keyboard (default) and on its top (resizes-content). The same numbers at 4× CPU slowdown and with animations removed, and Back returns the viewport to 783.2 px at offsetTop 0. In one take with animations removed, Back left the keyboard up; it hid in every other take.
  • A retake at 7952b5f ran on the Android 16 emulator, in Chrome 133 with Gboard and in Firefox 159. Chrome ran at normal animation scale, with Remove animations, and at 4× CPU. Each take read the AI chat template's composer and BottomSheet's last field, keyboard up, then down with Back. Each ran in the default viewport and under resizes-content. Chrome: AI chat 64.2 px clear with no pan (default) and 193 px (resizes-content); BottomSheet 48.2 px (default) and flush (resizes-content). Firefox matches within 1 px, with no pan: 64.1, 193, 48.1 px and flush. Keyboard down returns the viewport to full at offsetTop 0 in every reading (Chrome 783.2 px, Firefox 779.3 px). With Remove animations (reduced motion active) and at 4× CPU, Chrome's eight readings equal those at normal speed, to 0 px. In Firefox a real tap on "Add a comment" opens the sheet, 3 of 3 on main and on 7952b5f.
  • The one change from 76289f2 is AI chat in the default viewport. There Chrome panned 288 px and the field ended 193 px clear; now nothing pans, and the composer card rests on the keyboard's top. It is intended: feat(ChatLayout): the composer rides the software keyboard #8176's dock rests above the keyboard (spec:AST-099 FR3, with FR4: focus never pans the page). It came in with the main merge. Chromium's phone emulation with a 312 px virtual keyboard shows it, as a proxy with no real keyboard and no browser pan. In 3 takes each, 76289f2 leaves the composer under the keyboard. The merge without the one-read commit, and 7952b5f, both put the card on the keyboard's top.
  • Not read there, as rig limits: AI chat with resizes-content at 4× CPU, whose composer did not render in time in 7 tries. Firefox was not read either: no keyboard report reached the page in 2 tries. The probe-page rows above read Firefox at 280bac1.
  • iOS 26.2 Simulator (iPhone 17 Pro, Mobile Safari): a tap focuses a field at the page's bottom. A local probe story shows the module's reading. There were 2 takes per build at 280bac1 (the same patch), order-balanced, with every frame viewed.

@vercel

vercel Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 13, 2026 5:37am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 4, 2026
@astracat-bot

astracat-bot Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Nov 13, 2026, 6:03 AM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 4, 2026
@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 0dbf6f3

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot astracat-bot 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.

Requesting changes: the fix restores the keyboard height in the Safari focus pan it targets, but the new root-height floor makes a zoomed-out page report a keyboard that is not there.

  • layoutViewportHeight (packages/core/src/utils/layoutViewport.ts:49-52) compares the root's unscaled client height with the scaled innerHeight * scale reading, so a page with no width=device-width viewport or a fixed width=1024 viewport now reads a 984–1,246 px keyboard with none shown (0 before), against AST-099 FR2; apply the floor only where the units match (for example at a visual-viewport scale of 1) and add a no-keyboard test for a zoomed-out page.
  • The ride formula in packages/core/src/keyboard/README.md (line 96) still computes the keyboard's top as innerHeight − height, which is now 40 px during Safari's focus pan instead of the 377 px the hook uses, so it should read layoutViewportHeight(window) − height.
  • The Android claims (resizes-content still reading 0, Chrome's toolbar-hidden height kept) and the scroll-clamp change rest on unit fixtures with assumed root heights, while AST-099 DEC-3 asks for emulator evidence for Android claims, so please add emulator readings (Chrome with Gboard and Firefox for Android) and a Simulator reading of the clamp state at the fixed head.

The four red-first unit cases and the Simulator capture show the focus-pan fix itself.

[Automated review]

@astracat-bot astracat-bot 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.

Still requesting changes: the scale-1 gate restores the keyboard height during Safari's focus pan, but it lets a fixed-width page wider than the screen read a keyboard that is not there, and the Android readings the keyboard record requires are missing.

  • layoutViewportHeight (packages/core/src/utils/layoutViewport.ts:52-56) takes the root's client height whenever the scale is 1 and innerHeight equals the visual viewport's height, so a width=1024, initial-scale=1, user-scalable=no (or minimum-scale=1) page with no keyboard reads a 1,246 px keyboard in Chromium's Pixel 7 emulation where it read 0 before, against AST-099 FR2; also require the root to be as wide as the visual viewport, and add a no-keyboard test for a wider layout at scale 1.
  • The new branch also runs on Android, but the change has no emulator evidence, which AST-099's Platform support and DEC-3 require at the exact head before merge; please add keyboard-height readings in Chrome with Gboard (default and resizes-content) and in Firefox for Android at the fixed head.

The red-first pan tests and the Simulator capture show the focus-pan fix itself.

[Automated review]

@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 280bac1

@astracat-bot astracat-bot 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.

Requesting changes: the scale-1 root floor now restores the keyboard height during Safari's focus pan and keeps a layout wider than the screen at no keyboard, but the Android emulator readings the keyboard record requires at this head are not on the pull request.

  • The new branch in layoutViewportHeight (packages/core/src/utils/layoutViewport.ts:54-61) also runs on Android, and AST-099's Platform support and DEC-3 make emulator evidence at the exact head a merge gate, so please post here the readings the description attributes to another run: innerHeight, the root's client height, the visual viewport and the module's keyboard height, keyboard up and down, in Chrome with Gboard (default and resizes-content) and in Firefox for Android.

The red-first pan tests, the new wide-layout tests and the Simulator capture cover the iOS fix itself.

[Automated review]

expect(layoutViewportHeight(win)).toBe(377);
});

it('keeps innerHeight where it is taller than the root, as in Chrome on Android with its toolbar hidden', () => {

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.

This case and the resizes-content case above encode Android readings from assumed root heights. AST-099's Platform support makes emulator evidence at the exact head a merge gate, so please post the emulator's own readings at this head on the pull request: Chrome with Gboard (default and resizes-content) and Firefox for Android, keyboard up and down.

…pans to a focused field

While Safari on iOS 26.2 pans the page to a focused field near the bottom,
it reports innerHeight as the visual viewport's height (377 of 714 with
the keyboard up). layoutViewportHeight read innerHeight, so the keyboard
module measured 0, as if no keyboard were up, against AST-099 FR2 ("a page
pan is never a smaller keyboard"). The root's client height keeps the
layout viewport's height. At a visual-viewport scale of 1, where
innerHeight equals the visual viewport's height and the root is as wide
as the visual viewport, layoutViewportHeight now takes the larger of the
two. Everywhere else it is unchanged: a zoomed-out page's scaled
innerHeight and the root's unscaled height are in different units, a
layout wider than the screen gives a root taller than the screen, and the
scroll clamp reads as before.

The README's ride formula now takes the keyboard's top from
layoutViewportHeight(window), not innerHeight.

@astracat-bot astracat-bot 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.

Requesting changes: the scale-1 root floor restores the keyboard height during Safari's pan to a focused field and keeps zoomed-out and wider-than-screen layouts at no keyboard, but the Android emulator readings the keyboard record requires at the exact head are still not on the pull request.

  • The new branch in layoutViewportHeight (packages/core/src/utils/layoutViewport.ts:54-61) also runs on Android, and AST-099's Platform support makes emulator evidence at the exact head a merge gate, so please post here the readings the description attributes to another run (innerHeight, the root's client height, the visual viewport and the module's keyboard height, keyboard up and down) in Chrome with Gboard, default and resizes-content, and in Firefox for Android.

The red-first pan tests and the Simulator capture cover the iOS fix itself.

[Automated review]

@vjeux

vjeux commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

The readings at this head are now in the description's Testing section. They come from the Android 16 emulator: Chrome 133 with Gboard, default and resizes-content, and Firefox 159, keyboard down and up. A local probe page reads the module built from 86c74e8.

  • Chrome default, keyboard up: innerHeight 811, root 811, visual viewport 499.43 @ 312, keyboard 311.57.
  • Chrome resizes-content, keyboard up: 499, 499, 499.43 @ 0, keyboard 0.
  • Firefox default, keyboard up: 796, 796, 486.2 @ 245.93, keyboard 309.8.
  • Firefox resizes-content, keyboard up: 486, 486, 486.2 @ 0, keyboard 0.
  • Keyboard down: all four browser and page pairs read 0, with innerHeight and the root equal (811 or 796).

The root's client height equals innerHeight in every reading, so the floor returns main's value. Under resizes-content the new branch runs, and the root shrinks with the viewport. The readings are the same with animations at normal scale, with animations removed, and under a slow-device profile.

@astracat-bot

astracat-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

In reply to @vjeux

I'll run a full review to re-check this with your note.

@astracat-bot astracat-bot 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.

Approving: the scale-1 root floor in layoutViewportHeight restores the whole keyboard height during Safari's pan to a focused field and keeps zoomed-out and wider-than-screen layouts at no keyboard, and the Android emulator readings at this head now cover Chrome with Gboard (default and resizes-content) and Firefox for Android.

Approved pending CI: CI has not run on this head yet, because its branch is in a fork; a maintainer adds the ci:run label so CI runs.

[Automated review]

@vjeux
vjeux marked this pull request as ready for review November 5, 2026 15:18
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 6, 2026
@cixzhang
cixzhang marked this pull request as draft November 6, 2026 17:26
useChatKeyboard.ts takes main's modality and focusReturn imports, and
keyboardTarget.ts main's nearestScroller import. Neither imports
layoutViewport: their readers use getKeyboardViewportHeight.
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 348b522

@astracat-bot astracat-bot 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.

Requesting changes: the scale-1 root floor in layoutViewportHeight restores the whole keyboard height during Safari's pan to a focused field (the pan cases fail on main and pass here), and the code shows no defect; one evidence item remains.

  • The Android emulator readings that spec:AST-099 Platform support requires at the exact head are missing: the newest are from earlier heads, and spec:AST-094 DEC-31 cannot carry them because this main merge changed useChatKeyboard.ts and keyboardTarget.ts (both changed here) and motion/animator.ts, which they import.

Next: take Chrome with Gboard and Firefox for Android in the emulator on a build of this head (default and resizes-content, keyboard up and down) at normal animation scale, with animations removed and under a slow-device profile, and add them to the Testing section. Required CI has not run on this head yet, as the pull request is a draft.

[Automated review]

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 3e01aa1

@astracat-bot astracat-bot 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.

Requesting changes: the scale-1 root floor restores the whole keyboard height during Safari's pan to a focused field, and the stored layout height keeps one visual-viewport read per keyboard report, but three items remain.

  • Regression: KeyboardStore gains viewportHeight (keyboardHeight.ts:122) under the version-1 slot that main now shares across Core copies (keyboardHeight.ts:130-133), and the function attach returns never clears it, so after a package reader unmounts and a component swizzled from 0.7.14 or later takes over the listeners, the package keeps its old layout height (844 px in a 390 px landscape viewport) and reports a field 110 px under the keyboard as clear; add store.viewportHeight = null; to that detach, or bump the slot's version.
  • Newly live check: the description says #9777 adds layoutViewport.ts from an older base, but #9777 already merges the same main and none of its commits touch that file, while it does change keyboardHeight.ts, keyboardTarget.ts, useMobileKeyboard.ts, the keyboard README, keyboardHeight.test.ts and the AST-099 record.
  • AST-099's Platform support needs Android emulator readings at this exact head, and AST-094 DEC-31 cannot carry the newest ones in the description because the two main merges since changed keyboardHeight.ts, keyboardTarget.ts, useMobileKeyboard.ts, useChatKeyboard.ts and the shared motion and layer modules.

Next: clear the stored height on detach, correct the #9777 note, and state Chrome with Gboard and Firefox for Android readings on a build of this head (default and resizes-content, keyboard up and down) at normal animation scale, with animations removed and under a slow-device profile. CI has not run on this head yet, as the pull request is a draft.

Claims and files checked
  • Changeset: the keyboard height reads the whole keyboard while Safari on iOS pans to a focused field — verified (layoutViewport.ts:58-66; main's code reads 0 and this head 337 on the pan values).
  • Changeset: during that pan Safari reports innerHeight at the visual viewport's height, so the height read 0 — verified for main's code on the stated values.
  • Changeset: at scale 1, with innerHeight equal to the visual viewport's height and the root as wide as the visual viewport, the layout height takes the root's client height where larger — verified (layoutViewport.ts:58-66).
  • Readers such as the mobile keyboard hook's recovery check took the keyboard as down — verified (useMobileKeyboard.ts:148-150 treats a height of 0 as recovered).
  • Elsewhere nothing changes: a zoomed-out page, a layout wider than the screen and the clamped scroll read as on main — verified for one copy of Core (0, 0 and 289 px on both); false beside an older Core copy (store finding).
  • The FR2 verification row now names Safari's pan to a focused field and the Simulator — verified (AST-099 spec.md:391).
  • The body's client height stands in for the root's in quirks mode — verified (layoutViewport.ts:74-76).
  • The module keeps each report's layout height for its readers and the README formula — verified (keyboardHeight.ts:171-191, :334-339; keyboard/README.md:179).
  • No API change — verified from source (no entry point re-exports the keyboard module or layoutViewport.ts).
  • Simulator before and after: 0, then 337 px — stated in text for an earlier head with the same floor; consistent with the code on those values.
  • On the Android emulator the root's client height equals innerHeight, so the floor returns main's value — follows from the code; the readings name earlier heads.
  • The pan regression tests are red on main, and the wide-layout, zoomed-out and clamp cases pass on both — verified on the cases' values (main's code returns 377 and 0 for the pan cases); suites not rerun.
  • #9777 adds layoutViewport.ts from an older base and takes this fix when it rebases — false.
  • This head merges main with no conflicts, main's Text and Tooltip fix changed keyboardHeight.ts, and the change's own lines are unchanged — verified, but incomplete (the same merge brought the shared keyboard store and a useMobileKeyboard change into these files).
  • Build, typecheck, lint, the knowledge and shared-identity checks, the unit counts and the Chromium and WebKit keyboard interaction specs pass at this head — not verified (not rerun).
  • Testing notes for earlier heads (merges, browser tests, unit counts, emulator and Simulator readings, the four source-build failures on main) — describe earlier heads; not checked against this head.

Files:

  • .changeset/keyboard-height-safari-pan.md — clear (claims verified).
  • docs/specs/AST-099-mobile-keyboard/spec.md — clear (FR2 row, owner-approved at this head).
  • packages/core/src/utils/layoutViewport.ts — clear.
  • packages/core/src/utils/layoutViewport.test.ts — clear.
  • packages/core/src/keyboard/keyboardHeight.ts — finding: the stored layout height survives detach under the shared version-1 slot.
  • packages/core/src/keyboard/keyboardHeight.test.ts — clear.
  • packages/core/src/keyboard/keyboardTarget.ts — clear (reads the stored height).
  • packages/core/src/keyboard/useMobileKeyboard.ts — clear (reads the stored height).
  • packages/core/src/Chat/useChatKeyboard.ts — clear (reads the stored height).
  • packages/core/src/Layer/useLayerKeyboardClearance.ts — clear (reads the stored height).
  • packages/core/src/keyboard/README.md — clear (matches the code).

Automated review (maintainer link)

The layout viewport's height changes the keyboard store's shape, so its
shared key moves to version 4. A copy of Core built against the earlier
shape keeps its own store, as spec:AST-110 FR3 requires. Beside such a
copy, the package could read a layout height that an earlier attach
left.

A case puts an earlier copy's listening store under version 1: the
package keeps its own store and reads its own heights, and the other
store keeps its height and shape. On version 1 the package reads the
other copy's 300 px.
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 78d8a2a

@astracat-bot astracat-bot 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.

Requesting changes: the scale-1 root floor restores the whole keyboard height during Safari's pan to a focused field, and the version-4 store key keeps the package's keyboard readings apart from older Core copies; one evidence item remains.

  • AST-099's Platform support needs Android emulator readings for a build of this exact head, and AST-094 DEC-31 cannot carry the earlier readings, because this head adds its own commit to keyboardHeight.ts rather than only merging main.

Next: state in the description Chrome with Gboard (default and resizes-content) and Firefox for Android readings for a build of this head, keyboard up and down, at normal animation scale, with animations removed and under a slow-device profile. This pull request is the bottom of the #9983 → #8217 stack and is reviewed on its own here; #8217 lands only once this one is approved. CI has not run on this head yet, as the pull request is a draft.

Claims and files checked
  • Changeset: the keyboard height reads the whole keyboard while Safari on iOS pans to a focused field — verified (layoutViewport.ts:59-66; main's code reads 0 and this head 337 on the stated values).
  • Changeset: during that pan Safari reports innerHeight at the visual viewport's height, so the height read 0 — verified for main's code on the stated values.
  • Changeset: at scale 1, with innerHeight equal to the visual viewport's height and the root as wide as the visual viewport, the layout height takes the root's client height where it is larger — verified (layoutViewport.ts:59-66).
  • Readers such as the mobile keyboard hook's recovery check took the keyboard as down — verified (useMobileKeyboard.ts:148-150 treats a height of 0 as recovered).
  • Elsewhere nothing changes: a zoomed-out page and a layout wider than the screen read no keyboard, and the clamped scroll reads as on main — verified (0, 0 and 289 px on main and this head; layoutViewport.test.ts:98-166).
  • The FR2 verification row names Safari's pan to a focused field and the Simulator — verified (AST-099 spec.md:391).
  • The body's client height stands in for the root's in quirks mode — verified (layoutViewport.ts:74-76).
  • The keyboard module keeps each report's layout height for its readers and the README formula — verified (keyboardHeight.ts:173-193, :336-341; keyboard/README.md:179).
  • No API change — verified from source (no package entry point reaches the keyboard module or layoutViewport.ts).
  • The Simulator reads 0 before and 337 px after — stated for an earlier head with the same floor; consistent with the code.
  • On the Android emulator the root's client height equals innerHeight, so the floor returns main's value — follows from the code; the readings name earlier heads.
  • The pan regression tests fail on main, and the wide-layout, zoomed-out and clamp cases pass on both — verified on the cases' values (main's code returns 377 and 0 for the two pan cases); suites not rerun.
  • The two other open pull requests on these files change the keyboard module, not layoutViewport.ts, and take store versions 2 and 3 — verified against their current patches.
  • This head registers the keyboard store under version 4; beside a copy with the earlier shape the package keeps its own store and reads its own heights, and on version 1 it would read the other copy's 300 px — verified (keyboardHeight.ts:130-135, keyboardHeight.test.ts:628-670); the swizzle record it cites is a draft, so the keyboard record's one-height requirement is what governs the split.
  • A clean merge into main at this head — verified; lint and the review checklist not rerun.
  • Build, typecheck, unit and interaction-spec results at earlier heads — not verified (other revisions; not rerun).
  • The Android and iOS reading tables and notes — describe earlier heads; not checked against this head.

Files:

  • .changeset/keyboard-height-safari-pan.md — clear (claims verified).
  • docs/specs/AST-099-mobile-keyboard/spec.md — clear (FR2 row, owner-approved for this head).
  • packages/core/src/utils/layoutViewport.ts — clear.
  • packages/core/src/utils/layoutViewport.test.ts — clear.
  • packages/core/src/keyboard/keyboardHeight.ts — clear.
  • packages/core/src/keyboard/keyboardHeight.test.ts — clear.
  • packages/core/src/keyboard/keyboardTarget.ts — clear (reads the stored height).
  • packages/core/src/keyboard/useMobileKeyboard.ts — clear (reads the stored height).
  • packages/core/src/Chat/useChatKeyboard.ts — clear (reads the stored height).
  • packages/core/src/Layer/useLayerKeyboardClearance.ts — clear (reads the stored height).
  • packages/core/src/keyboard/README.md — clear (matches the code).

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 68c8231

@astracat-bot astracat-bot 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.

Requesting changes: the scale-1 root floor restores the whole keyboard height during Safari's pan to a focused field, and the version-4 store key keeps the package's keyboard readings apart from older Core copies; one evidence item remains at this head.

  • AST-099's Platform support needs Android emulator readings for a build of this exact head, and AST-094 DEC-31 cannot carry the earlier readings, because this pull request's own store-key commit came after them and this merge changes motion/animator.ts and utils/clickGuard.ts, which the changed keyboard files import directly.

Next: state in the description Chrome with Gboard (default and resizes-content) and Firefox for Android readings for a build of this head, keyboard up and down, at normal animation scale, with animations removed and under a slow-device profile. This pull request is the bottom of the #9983 → #8217 stack and is reviewed on its own here; #8217 lands only once this one is approved. CI has not run on this head yet, as the pull request is a draft.

Claims and files checked
  • Changeset: the keyboard height reads the whole keyboard while Safari on iOS pans to a focused field — verified (layoutViewport.ts:59-66; main's code reads 0 and this head 337 on the stated values).
  • Changeset: during that pan Safari reports innerHeight at the visual viewport's height, so the height read 0 — verified for main's code on the stated values.
  • Changeset: at scale 1, with innerHeight equal to the visual viewport's height and the root as wide as the visual viewport, the layout height takes the root's client height where it is larger — verified (layoutViewport.ts:59-66).
  • Readers such as the mobile keyboard hook's recovery check took the keyboard as down — verified (they read the module's height, which was 0).
  • Elsewhere nothing changes: a zoomed-out page and a layout wider than the screen read no keyboard, and the clamped scroll reads as on main — verified (layoutViewport.test.ts:98-168).
  • The FR2 verification row names Safari's pan to a focused field and the Simulator — verified (AST-099 spec.md:391).
  • The body's client height stands in for the root's in quirks mode — verified (layoutViewport.ts:74-76).
  • The keyboard module keeps each report's layout height for its readers and the README formula — verified (keyboardHeight.ts:173-190, :336-341; keyboard/README.md:179).
  • No API change — verified from source (no package entry point reaches the keyboard module or layoutViewport.ts).
  • This head merges main with no conflicts and leaves the change's own lines unchanged — verified (the pull request's patch is identical to the previous head's).
  • The merged main changes motion/animator.ts and utils/clickGuard.ts, which this change's code imports, so earlier device runs do not carry; device runs at this head are pending — verified (history and imports).
  • The version-4 store key keeps the package's own store beside a copy with the earlier shape — verified (keyboardHeight.ts:132-135, keyboardHeight.test.ts:628-669).
  • The other two open pull requests on these files take store versions 2 and 3 and do not touch layoutViewport.ts — verified earlier against their patches; unchanged here.
  • The Simulator reads 0 before and 337 px after — stated for an earlier head with the same floor; consistent with the code.
  • The pan regression tests fail on main, and the wide-layout, zoomed-out and clamp cases pass on both — verified on the cases' values; suites not rerun.
  • Build, typecheck, lint, unit and interaction-spec results at this head and earlier heads — not verified (not rerun; CI skipped on the draft).
  • The Android and iOS reading tables and notes — describe earlier heads; not checked against this head.

Files:

  • .changeset/keyboard-height-safari-pan.md — clear (claims verified).
  • docs/specs/AST-099-mobile-keyboard/spec.md — clear (FR2 row restates the record's existing Simulator row).
  • packages/core/src/utils/layoutViewport.ts — clear.
  • packages/core/src/utils/layoutViewport.test.ts — clear.
  • packages/core/src/keyboard/keyboardHeight.ts — clear.
  • packages/core/src/keyboard/keyboardHeight.test.ts — clear.
  • packages/core/src/keyboard/keyboardTarget.ts — clear (reads the stored height).
  • packages/core/src/keyboard/useMobileKeyboard.ts — clear (reads the stored height).
  • packages/core/src/Chat/useChatKeyboard.ts — clear (reads the stored height).
  • packages/core/src/Layer/useLayerKeyboardClearance.ts — clear (reads the stored height).
  • packages/core/src/keyboard/README.md — clear (matches the code).

Automated review (maintainer link)

@astracat-bot astracat-bot 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.

Requesting changes: the scale-1 root floor restores the whole keyboard height during Safari's pan to a focused field and the code is ready, but one evidence item remains at this head.

  • AST-099's Platform support needs Android emulator readings for a build of this exact head, and AST-094 DEC-31 cannot carry the earlier readings, because this pull request's own store-key commit came after them and the main merges since then change motion/animator.ts and utils/clickGuard.ts, which the changed keyboard files import directly.

Next: state in the description Chrome with Gboard (default and resizes-content) and Firefox for Android readings for a build of this head, keyboard up and down, at normal animation scale, with animations removed and under a slow-device profile. The FR2 verification-row edit is owner-approved for this head, and this pull request, the bottom of the #9983 → #8217 stack, is reviewed on its own; #8217 lands only once this one is approved.

Claims and files checked
  • Changeset: the keyboard height reads the whole keyboard while Safari on iOS pans to a focused field — verified (layoutViewport.ts:59-66; the pan cases read 0 on main's rule and 337 here).
  • Changeset: during that pan Safari reports innerHeight at the visual viewport's height, so the height read 0 — verified for main's rule on the stated values.
  • Changeset: at scale 1, with innerHeight equal to the visual viewport's height and the root as wide as the visual viewport, the layout height takes the root's client height where it is larger — verified (layoutViewport.ts:58-66).
  • Readers such as the mobile keyboard hook's recovery check took the keyboard as down — verified (they read the module's height, which was 0).
  • Elsewhere nothing changes: a zoomed-out page and a layout wider than the screen read no keyboard, and the clamped scroll reads as on main — verified (layoutViewport.test.ts:98-168, keyboardHeight.test.ts:155-185; they pass on main's rule and here).
  • The FR2 verification row names Safari's pan to a focused field and the Simulator — verified (AST-099 spec.md:391).
  • The body's client height stands in for the root's in quirks mode — verified (layoutViewport.ts:74-76).
  • The keyboard module keeps each report's layout height for its readers and the README formula — verified (keyboardHeight.ts:175-188, :336-341; keyboard/README.md:179).
  • No API change — verified (the built surface of Core and the seven themes shows no added, changed or removed entry).
  • The Simulator reads 0 before and 337 px after — stated for an earlier head with the same rule; consistent with the code.
  • The pan regression cases fail on main's rule and pass here, and the wide, zoomed-out and clamp cases pass on both — verified (with main's layoutViewport.ts, the two pan cases and the two read-count cases, which also run in the pan state, fail; every other case passes).
  • Two unit cases count one visual-viewport read per report under the pan, a reader laying out included — verified (keyboardHeight.test.ts:199-256).
  • This head merges main with no conflicts and leaves the change's own lines unchanged — verified (a clean merge of the previous head and main gives exactly this head's tree, and the pull request's patch is identical to the previous head's).
  • The merged main changes five files the change reaches through its imports, so earlier device runs do not carry, and device runs at this head are pending — verified.
  • The version-4 store key keeps the package's own store beside a copy with the earlier shape — verified (keyboardHeight.ts:132-135, keyboardHeight.test.ts:628-669).
  • The bump follows the swizzle-output record's shared-key rule — stated there; that record is a draft, and the keyboard record's single-height rule covers the bump.
  • The other two open pull requests on these files take store versions 2 and 3 and do not touch layoutViewport.ts — verified against their changed files.
  • Typecheck, lint and formatting at this head — verified for Core (typecheck with no errors; ESLint with no errors and Prettier clean on the changed files); keyboard and layout-viewport units 74 of 74 — verified.
  • The full UI suite, the build of every package, interaction specs and other repository checks — not rerun.
  • The Android and iOS reading tables and notes — describe earlier heads; not checked against this head.

Files:

  • .changeset/keyboard-height-safari-pan.md — clear (claims verified).
  • docs/specs/AST-099-mobile-keyboard/spec.md — clear (FR2 row restates the record's existing Simulator row; owner-approved for this head).
  • packages/core/src/utils/layoutViewport.ts — clear.
  • packages/core/src/utils/layoutViewport.test.ts — clear.
  • packages/core/src/keyboard/keyboardHeight.ts — clear.
  • packages/core/src/keyboard/keyboardHeight.test.ts — clear.
  • packages/core/src/keyboard/keyboardTarget.ts — clear (reads the stored height).
  • packages/core/src/keyboard/useMobileKeyboard.ts — clear (reads the stored height).
  • packages/core/src/Chat/useChatKeyboard.ts — clear (reads the stored height).
  • packages/core/src/Layer/useLayerKeyboardClearance.ts — clear (reads the stored height).
  • packages/core/src/keyboard/README.md — clear (matches the code).

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 2c322c1

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 739a211

@astracat-bot astracat-bot 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.

Requesting changes: the scale-1 root floor restores the whole keyboard height during Safari's pan to a focused field and the code is ready, but one evidence item remains at this head.

  • AST-099's Platform support needs Android emulator readings for a build of this exact head, and AST-094 DEC-31 cannot carry the earlier readings, because they predate this pull request's own store-key commit and the main merged here changes utils/clickGuard.ts, utils/sharedResizeObserver.ts and Layer/useLayer.tsx.

Next: state in the description, in text, Chrome with Gboard (default and resizes-content) and Firefox for Android readings for a build of this head, keyboard up and down, at normal animation scale, with animations removed and under a slow-device profile. This pull request, the bottom of the #9983 → #8217 stack, is reviewed on its own, and #8217 lands only once this one is approved.

Claims and files checked
  • Changeset: the keyboard height reads the whole keyboard while Safari on iOS pans to a focused field — verified (layoutViewport.ts:58-67; the pan cases read 0 with main's rule and 337 here).
  • Changeset: during that pan Safari reports innerHeight at the visual viewport's height, so the height read 0 — verified for main's rule on the stated values.
  • Changeset: at scale 1, with innerHeight equal to the visual viewport's height and the root as wide as the visual viewport, the layout height takes the root's client height where it is larger — verified (layoutViewport.ts:58-67).
  • Readers such as the mobile keyboard hook's recovery check took the keyboard as down — verified (they read the module's height, which was 0).
  • Elsewhere nothing changes: a zoomed-out page and a layout wider than the screen read no keyboard, and the clamped scroll reads as on main — verified (layoutViewport.test.ts:98-167, keyboardHeight.test.ts:155-185, :258-262; they pass with main's rule and here).
  • The FR2 verification row names Safari's pan to a focused field and the Simulator — verified (AST-099 spec.md:391).
  • The body's client height stands in for the root's in quirks mode — verified (layoutViewport.ts:74-76).
  • The keyboard module keeps each report's layout height for its readers and the README formula — verified (keyboardHeight.ts:173-193, :336-341; keyboard/README.md:179).
  • No API change — verified (the built surface of Core and the seven themes shows no added, changed or removed entry).
  • The Simulator reads 0 before and 337 px after — stated for an earlier head with the same rule; consistent with the code.
  • The pan regression cases fail on main's rule and pass here — verified (with main's layoutViewport.ts, the two pan cases and the two read-count cases fail; every other case passes).
  • Each report reads the visual viewport once under the pan, a reader laying out included — verified (keyboardHeight.test.ts:199-256).
  • This head merges main with no conflicts and leaves the change's own lines unchanged — verified (a clean merge of the previous head and main gives exactly this head's tree, and the pull request's own patch is unchanged).
  • The merged main changes utils/clickGuard.ts, utils/sharedResizeObserver.ts and Layer/useLayer.tsx, which the changed keyboard files import or the carry rule lists, so earlier device runs do not carry; device runs at this head are pending — verified.
  • The version-4 store key keeps the package's own store beside a copy with the earlier shape — verified (keyboardHeight.ts:130-135, keyboardHeight.test.ts:628-669).
  • The bump follows the swizzle-output record's shared-key rule — that record is a draft; the shared-key versioning rule in utils/sharedRealm.ts and the keyboard record's single-height rule cover the bump.
  • The other two open pull requests on these files take store versions 2 and 3 and do not touch layoutViewport.ts — verified against their changed files.
  • Typecheck, lint and formatting at this head — verified for Core (typecheck passes; ESLint clean on the changed files; Prettier clean on all changed files); keyboard and layout-viewport units 158 of 158 — verified.
  • The full UI suite, the build of every package, interaction specs and other repository checks — not rerun.
  • The Android and iOS reading tables and notes — describe earlier heads; not checked against this head.

Files:

  • .changeset/keyboard-height-safari-pan.md — clear (claims verified).
  • docs/specs/AST-099-mobile-keyboard/spec.md — clear (the FR2 row edit is owner-approved for this head).
  • packages/core/src/utils/layoutViewport.ts — clear.
  • packages/core/src/utils/layoutViewport.test.ts — clear.
  • packages/core/src/keyboard/keyboardHeight.ts — clear.
  • packages/core/src/keyboard/keyboardHeight.test.ts — clear.
  • packages/core/src/keyboard/keyboardTarget.ts — clear (reads the stored height).
  • packages/core/src/keyboard/useMobileKeyboard.ts — clear (reads the stored height).
  • packages/core/src/Chat/useChatKeyboard.ts — clear (reads the stored height).
  • packages/core/src/Layer/useLayerKeyboardClearance.ts — clear (reads the stored height).
  • packages/core/src/keyboard/README.md — clear (matches the code).

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor

Decision: D-20261113-136

Records the Specs consistency stamp at 739a211 (spec:AST-099 FR2: the keyboard height a pan or zoom cannot corrupt). This pull request carries no owner device row. Still required: the Chrome for Android cells on an emulator (they ran on a physical Pixel, which AST-094 DEC-27 does not accept); the Firefox for Android cells already ran on the emulator.

This branch was successfully deployed

1 active deployment
Preview — 739a2117 Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants