Repository navigation
feat(core): one keyboard module; a Tall BottomSheet reads it and rides Gboard - #8559
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
…8549 and meta#8554 into ChatLayout ChatLayout's keyboard ride now stacks on its dependencies, merged as one base (58f88dc): the keyboard module (meta#8559, on main), the sheet's ride on Gboard's slides (on meta#8559, meta#8076 and meta#8484), the split frame evidence (meta#8548 under meta#8549 and meta#8554), and the rendering trace's invalidations with the compositor-update classifier (meta#8554). Every file those carry takes their version; ChatLayout's parts are put back on top: - `useMobileKeyboard.ts`: the sheet ride's version (its coarse-pointer gate, main's Reduce Motion query), plus `claimTapFocus` and the ChatLayout lines of its header; its tests and `index.ts` likewise. - The keyboard README and the guide's, model test's, rideKeyboard's and layoutViewport's headers: theirs, plus ChatLayout's lines. - `keyboardLayoutGuide.ts` takes the frame-watch fix, and `timing.ts` meta#8484's constants with meta#8076's change. - The harness is meta#8554's, beside meta#8549's and meta#8446's content. - The browser-support guide names ChatLayout's composer beside the sheet; the modules' changesets stay theirs, and ChatLayout's own changeset names the guide (and the CLI).
|
Posted by Cindy's agent on her behalf. A naming change to match |
|
|
…e sheet's Gboard ride meta#8559 renames the keyboard module's names (`subscribeKeyboardHeight`, `getKeyboardHeight`, BottomSheet's `useSheetKeyboard`, the file `keyboardHeight.ts`); this pull request's own files take the new names (the guide, rideKeyboard, the README's ride sections and the tests). meta#8076 adds cixzhang's meta#8056 fold on b4e0adb, with no conflict.
…eta#8566) and meta#8554 A dependency-only merge. The base (ad271a7) is the sheet's Gboard ride (meta#8566, on meta#8559 39d37ef, meta#8484 and meta#8076 62ecda1) merged with meta#8554 21ea4dc, which carries cixzhang's meta#8446 66c651f, meta#8549, meta#8548 and meta#8045 at their current heads, so no harness file is resolved here. ChatLayout's own change (this branch's commits since 58f88dc) applies on it with meta#8559's names (`subscribeKeyboardHeight`, `getKeyboardHeight`, `keyboardHeight.ts`).
meta#8176 now stacks on the keyboard module (meta#8559), the sheet's Gboard ride (meta#8566), meta#8549 and meta#8554, and its ride attaches only under a coarse pointer. One conflict, in `useChatKeyboard.ts`: the touch presentation is read once, before both effects (this branch's touch listeners and meta#8176's gated guide subscription), and the transcript's effect keeps its touch listeners beside the gated ride.
meta#8176 now sits on the foundation heads (the sheet's ride on meta#8559 39d37ef and meta#8076 62ecda1, and meta#8554 21ea4dc with cixzhang's meta#8446, meta#8549, meta#8548 and meta#8045). A base move: the dismissal's own change applies on it with meta#8559's names (getKeyboardHeight, subscribeKeyboardHeight).
There was a problem hiding this comment.
Changes requested: the keyboard module follows spec:AST-099 and fixes the Firefox and pinch-zoom cases, but three things need attention before approval.
useKeyboardHeightpassesuseSyncExternalStorea new subscribe function on every render, so a lone consumer re-attaches the module's listeners and measures three times per keyboard change, against INV11's one-layout-read rule; a stable subscribe function, or leaving the hook for its first consumer, fixes it.- At 3,229 authored lines, please split the separable parts (the reveal-pan put-back, the Firefox content-box room,
useKeyboardHeight, the docs section) from the module move, or explain in the description why they cannot land apart. - AST-099's merge gate needs iOS Simulator evidence for this head, and the current recording comes from #8176's earlier head.
[Automated review]
| export function useKeyboardHeight(win?: Window | null): number { | ||
| const target = win ?? (typeof window === 'undefined' ? null : window); | ||
| return useSyncExternalStore( | ||
| onChange => { |
There was a problem hiding this comment.
This subscribe function is recreated on every render, so React unsubscribes and resubscribes useSyncExternalStore each time. With a single consumer the unsubscribe detaches the shared store (lines 203-208) and the new subscribe re-attaches its listeners and measures again (line 150): one keyboard change measures three times, against INV11's "at most one layout read per keyboard change". The INV11 test at keyboardHeight.test.ts:359 passes only because it keeps a second subscriber attached. A useCallback keyed on target (or a module-level subscribe per window) keeps one subscription.
There was a problem hiding this comment.
One subscription matters because a lone reader otherwise detaches the module's listeners and measures again on every keyboard change. Nothing in this pull request renders from useKeyboardHeight, so it moved to #8176, its first consumer, where its subscribe and snapshot functions now stay the same for the component's life (red first: a lone component's keyboard change re-added the listeners; now it reads the layout once). The INV11 tests here read through subscribers only.
meta#8559 moves `useKeyboardHeight` to ChatLayout's ride, its first consumer, and reads the height through subscribers in its INV11 tests. This pull request keeps the keyboard layout guide in those tests (its rider reads the height again; it reads a keyboard already up), and its README's ride section keeps the layout formula the ride example uses.
…ss renders; the base moves to the foundation heads The base (3f66f76) is the sheet's Gboard ride (meta#8566, on meta#8559 6be79f4, meta#8484 and meta#8076 62ecda1) merged with meta#8554 e4f3c8d, on cixzhang's meta#8446 87e516b, meta#8549, meta#8548 and meta#8045, with no conflict. meta#8559 moved `useKeyboardHeight` here, to its first consumer: ChatLayout lays its dock and transcript padding out from it. Its subscribe and snapshot functions are now stable for the component's life (per window), so React keeps one subscription across renders; before, every render unsubscribed and resubscribed, and a lone reader detached the module's listeners and measured again on each keyboard change (INV11). Red first: "reads the layout once per keyboard change for a lone component" expected no listener re-added and one read, and got two `addEventListener` calls. The hook's tests (one re-render per change, a keyboard already up, StrictMode's replay leaving no listener) and the README's layout example come with it.
There was a problem hiding this comment.
Changes requested: the keyboard module, the Chrome ride and this head's late-report landing follow spec:AST-099, but two things block approval.
- The browser-support guide's On-Screen Keyboard section (
packages/cli/assets/docs/browser-support.doc.mjs) says that in Chrome on Android a browser pan to the field is put back within a couple of frames, while this pull request's own description says Chrome's pan runs without page frames and can only be put back when it ends, so please limit the couple-of-frames wording to Firefox for Android, describe Chrome's case as it is, and drop "never pans" fromkeyboard/README.md. spec:AST-099makes Chrome-on-Android evidence the merge gate for FR8, and this head's Chrome runs cover only the show, so please record a tap on the Mobile keyboard story's last field and then Back in Chrome with Gboard (emulator or device, top-level document) at this head, with and without Remove animations.
Non-blocking: keyboard/README.md should say that rideKeyboard now lands a slide that has ended at once, the README and a comment in keyboardHeight.ts still place the room on the body rather than the content box, and the JSDoc for refuseFocusReveal and watchRevealPan sits above the shared WeakMaps instead of the functions. The 5,973-line size is fine as an owner-directed batch.
[Automated review]
| content: [ | ||
| { | ||
| type: 'prose', | ||
| text: "On a phone, a fully expanded `height='tall'` BottomSheet responds to the on-screen keyboard: it measures the keyboard as the layout viewport's height minus the visual viewport's height times its scale. Where the visual viewport shrinks for the keyboard, as in Safari on iOS in the browser and as a home-screen app, in Firefox for Android and in Chrome on Android, it keeps the focused field above the keyboard and leaves the page where it was: if the browser pans to the field, the sheet puts the page back within a couple of frames.", |
There was a problem hiding this comment.
This promises a pan put back "within a couple of frames" in Chrome on Android too, but the description says Chrome's reveal pan runs without page frames and the sheet can only put it back when it ends; the couple-of-frames numbers come from Firefox for Android. Suggest scoping that clause to Firefox, and for Chrome saying the ride usually keeps the browser from panning and a pan Chrome makes while the page is busy is put back when it ends.
There was a problem hiding this comment.
Fixed in 1d58d03: the couple-of-frames clause is Firefox only, and Chrome's paragraph says the ride usually keeps Chrome from panning and a busy page's pan is put back when it ends. The README's "never pans" lines are gone.
| // One capture-phase `blur` listener per document serves every caller of | ||
| // refuseFocusReveal in it, so document listeners do not grow with the number | ||
| // of instances. The first caller adds it, and the last removes it. | ||
| const focusTakeovers = new WeakMap< |
There was a problem hiding this comment.
Non-blocking: the JSDoc block above (lines 292-310) attaches to focusTakeovers, so the exported refuseFocusReveal at line 322 shows no documentation. Moving the block directly above the function fixes it; watchRevealPan's block at lines 406-424 has the same problem with touchStartWatches at line 428.
There was a problem hiding this comment.
Moved in 1d58d03: both JSDoc blocks sit directly above refuseFocusReveal and watchRevealPan.
558dbc4 to
1d58d03
Compare
There was a problem hiding this comment.
Changes requested: the keyboard module and the Chrome ride follow spec:AST-099, and the browser-support guide's Chrome sentence now matches the evidence, but one thing still blocks approval.
spec:AST-099's merge gate needs Chrome-with-Gboard evidence (emulator or device, top-level document) of this code's hide and Reduce Motion path, so please record Back over the Mobile keyboard story's last field, with and without Remove animations, and link it in the description.
The size is a non-blocking note under the owner-directed batch.
[Automated review]
1d58d03 to
e7b79b8
Compare
There was a problem hiding this comment.
Recommended for approval: the keyboard module and the Chrome ride follow spec:AST-099, and this push moves the module's document-wide listeners onto Core's shared input stream and resize observer without changing what the sheet does.
No blocking findings. One small follow-up: the keyboard README (lines 33–34 and 55–57) and the RevealPanWatch.stop doc comment still describe document listeners, which are now subscriptions on the window's shared input stream; the inline comments suggest wording. The size is a non-blocking note under the owner-directed batch.
[Automated review]
| * the layout viewport's top, or else a probe fixed where the viewport sat. | ||
| */ | ||
| putBack: (anchor?: Element | null) => void; | ||
| /** Ends the watch; the document's touch listener goes with its last watch. */ |
There was a problem hiding this comment.
Non-blocking: since this push the watches' touchstart is one shared subscription on the window's input stream (watchTouchStarts, line 443), not a document listener. Suggest: /** Ends the watch; the shared touch subscription goes with the last watch. */
| full-viewport dialog). Every watch in a document shares one listener, a | ||
| passive capture-phase `touchstart` on the document, which lives only while | ||
| a surface watches. BottomSheet's hook watches while its sheet is presented |
There was a problem hiding this comment.
Non-blocking: the watches now share a passive touchstart subscription on the window's shared input stream (subscribeInput), not a capture-phase listener on the document; lines 33–34 say the same of the focus listeners. Suggest: “Every watch in a document shares one passive touchstart subscription on the window's input stream, which lives only while a surface watches.”
e7b79b8 to
d9bc14c
Compare
There was a problem hiding this comment.
Approval needs an engineering owner's decision first. This head adds a named exception to spec:AST-099 FR8 and a new DEC-5 so that, in Chrome on Android, the sheet places the focused field just above Gboard in one frame at Chrome's report, which FR8 currently rules out (“no one-step jump”); an engineering owner approves that update to the existing spec by commenting /approve-spec <full head SHA> here (the author may do so as an engineering owner), or says what FR8 should require instead.
Blocking findings to fix either way:
BottomSheetPanel.tsx:686-692adds its own close-dismissal Effect beside the shared keyboard hook, which already takesisOpen, so move the close blur intouseMobileKeyboardand delete the panel's Effect..changeset/bottomsheet-rides-gboard.mdand theheightrow inBottomSheet.doc.mjssay the field rides Gboard's slide up, but this head places it above the keyboard in the report's frame and rides only the last 44 px, so reword both as the browser-support guide already does.- At 6,295 authored lines the change needs its size exception: the owner-directed batch exemption applies once the AST-099 update is approved at this head, and otherwise the Chrome ride and placement belong in their own pull request.
Smaller notes: keyboardHeight.ts keeps 14 unused imports from the hook's old home, useMobileKeyboard's move option is never read, and a few comments still describe document listeners.
[Automated review]
| dismissKeyboardRef.current = dismissKeyboard; | ||
| // Syncs the on-screen keyboard with closing: a closing sheet blurs its | ||
| // focused field, which dismisses the keyboard. | ||
| useEffect(() => { |
There was a problem hiding this comment.
Blocking (one shared path): this close dismissal is a second, component-level path beside the shared keyboard hook, which owns dismissing the keyboard when a surface moves and already receives isOpen. Suggest moving it into useMobileKeyboard (dismiss when enabled and isOpen turns false) and deleting this Effect, so the next keyboard-aware surface makes one call and nothing else.
There was a problem hiding this comment.
Done at 2b1fcb6: the close dismissal is now useMobileKeyboard's one Effect, and BottomSheetPanel's Effect is gone.
| '@astryxdesign/cli': patch | ||
| --- | ||
|
|
||
| [feat] In Chrome on Android, on a touch screen, a Tall BottomSheet's focused field rides the on-screen keyboard as Gboard slides it up and down: a field revealed during the show rises with the keyboard, and through the hide the sheet's scroll room stays while its content rides down, so nothing jumps while the keyboard is still on screen. Under Reduce Motion it cross-fades instead of moving. The browser-support guide says so. |
There was a problem hiding this comment.
Blocking (claims match scope): at this head the field does not rise with the keyboard from where it was. The reveal places it 4 px above the keyboard's resting top in the report's commit and rides only the last 44 px. Suggest: “In Chrome on Android, on a touch screen, a Tall BottomSheet places the focused field just above the keyboard when Chrome reports it, then rides the rest of Gboard's slide; through the hide …”
| type: "'hug' | 'capped' | 'tall' | number | string", | ||
| description: | ||
| "How tall the sheet is. Named budgets: 'hug' fits its content up to 92% of the viewport, 'capped' is a scrolling mid-height panel (~62%), and 'tall' is a pinned near-full panel (~92%) for content that streams in. Or pass a number (px) / CSS length for a custom budget. Give snapPoints to let the user drag between heights. On shorter viewports the sheet fills the available height. Only a fully expanded 'tall' sheet provides mobile-keyboard accommodation: it stays put and scrolls each focused control above the keyboard. Hug, Capped, numeric and CSS-length heights never do, and a Tall sheet stops doing it the moment the user drags it to a shorter detent, resuming when they drag it back. Outside that state the sheet neither moves nor adds keyboard scroll space, and the browser's own focus reveal is left in place; on iOS that reveal can shift the whole page.", | ||
| "How tall the sheet is. Named budgets: 'hug' fits its content up to 92% of the viewport, 'capped' is a scrolling mid-height panel (~62%), and 'tall' is a pinned near-full panel (~92%) for content that streams in. Or pass a number (px) / CSS length for a custom budget. Give snapPoints to let the user drag between heights. On shorter viewports the sheet fills the available height. Only a fully expanded 'tall' sheet provides mobile-keyboard accommodation: it stays put and scrolls each focused control above the keyboard. Hug, Capped, numeric and CSS-length heights never do, and a Tall sheet stops doing it the moment the user drags it to a shorter detent, resuming when they drag it back. Outside that state the sheet neither moves nor adds keyboard scroll space, and the browser's own focus reveal is left in place; on iOS that reveal can shift the whole page. This accommodation applies where the visual viewport shrinks for the keyboard, as in Safari on iOS, Firefox for Android and Chrome on Android, where the focused control rides Gboard\u2019s slide up and down (`astryx docs browser-support`).", |
There was a problem hiding this comment.
Blocking (claims match scope): “the focused control rides Gboard’s slide up and down” no longer matches the head, which places the field just above the keyboard at Chrome's report and rides only the rest. Suggest: “… and Chrome on Android, where the focused control is placed just above the keyboard as it comes up and rides the rest of Gboard’s slide up and down.”
There was a problem hiding this comment.
Reworded at 2b1fcb6: the sheet places the focused control just above the keyboard as it comes up, and the control rides the rest of Gboard's slide.
| import {useMediaQuery} from '../hooks/useMediaQuery'; | ||
| import {TOUCH_QUERY} from '../utils/touchPresentation'; | ||
| import {animatorFor, type Animator} from '../motion/animator'; | ||
| import {getKeyboardLayoutGuide, keyboardProfileOf} from './keyboardLayoutGuide'; | ||
| import {rideKeyboard} from './rideKeyboard'; | ||
| import type {KeyboardTransition} from './keyboardModel'; | ||
| import {useEffect, useRef, useState, type RefObject} from 'react'; | ||
| import {flushSync} from 'react-dom'; | ||
| import {subscribeInput} from '../utils/inputStream'; | ||
| import {layoutViewportHeight} from '../utils/layoutViewport'; | ||
| import {observeResize} from '../utils/sharedResizeObserver'; |
There was a problem hiding this comment.
Non-blocking: 14 of these imports are unused since the hook moved to useMobileKeyboard.ts (ESLint warns on each), and they make this file import keyboardLayoutGuide.ts, which imports it back. Only subscribeInput and layoutViewportHeight are used here.
There was a problem hiding this comment.
Removed at 2b1fcb6. keyboardHeight.ts no longer imports keyboardLayoutGuide.
| * How the target moves the field: `'ride'` reveals it with the scroller | ||
| * and rides the scroller's content on the keyboard's slide. | ||
| */ | ||
| move: 'ride'; |
There was a problem hiding this comment.
Non-blocking: move is required but never read (the destructuring below skips it), so it selects nothing. Suggest dropping it until a second value exists.
There was a problem hiding this comment.
Kept: the owners' API names move: 'reveal' | 'ride', and the next slice adds 'reveal' and reads it.
There was a problem hiding this comment.
Fair point — keeping it. If the owners' API already names move: 'reveal' | 'ride' and the next slice adds 'reveal' and reads it, removing the option here would just churn the API for one slice. Within this PR it stays unread, but that's a forward-compatibility placeholder rather than dead code to delete, so the next full review can re-evaluate it once 'reveal' lands.
| * layout viewport. Since the report there is no touch, document scroll or | ||
| * zoom, and a text field the caller owns has focus. The watch reads the | ||
| * behavior, never the user agent. The caller lands its field itself and | ||
| * puts the pan back. Every keyboard-aware surface can use it, as BottomSheet's |
There was a problem hiding this comment.
Non-blocking: the hook no longer lives below in this file. Suggest: “Every keyboard-aware surface can use it.”
|
/approve-spec 2b1fcb6 |
There was a problem hiding this comment.
Approved pending CI: CI's build, lint and test jobs have not run on this draft head yet, so this is not ready to merge until they pass. Every change matches spec:AST-099 or its new FR8 exception and DEC-6, which an engineering owner approved for this head, and the earlier findings (the panel's own close dismissal, and the changeset and height doc wording) are fixed.
Smaller notes, none blocking: the description's “now resolves to keyboard/useMobileKeyboard.ts” should say the CLI no longer finds a doc for useMobileKeyboard, BottomSheetPanel's SYNC list should name useMobileKeyboard.ts, and two test names still describe the content riding up “from where it was”.
[Automated review]
| * - /packages/core/src/BottomSheet/BottomSheetPanel.test.tsx | ||
| * - /packages/core/src/BottomSheet/snapOffsets.ts | ||
| * - /packages/core/src/BottomSheet/useMobileKeyboard.ts | ||
| * - /packages/core/src/keyboard/keyboardHeight.ts |
There was a problem hiding this comment.
Non-blocking: the panel imports ../keyboard/useMobileKeyboard, so that is the file this SYNC list should name.
There was a problem hiding this comment.
Fixed at a48d4a4: the SYNC list names keyboard/useMobileKeyboard.ts.
|
/approve-spec 69b81ab |
There was a problem hiding this comment.
Approval waits on an engineering owner's decision: spec:AST-099 FR8 requires the sheet to ride a keyboard hide within one frame, DEC-6 excepts only the show, and on Back the content rides down only after Chrome's report, which the description's own recording puts about 140 ms into Gboard's slide. An engineering owner records an FR8 exception for a hide Chrome reports late by commenting /approve-spec <full head SHA> on the head that adds it (the author may do so as an engineering owner), or says what FR8 should require on Back.
Blocking findings to fix either way:
- Miss:
browser-support.doc.mjs:155and theheightdoc inBottomSheet.doc.mjssay the field rides Gboard's slide up and down, but a Back hide rides only after Chrome's late report, so scope both to a hide that follows a blur and say what Back does. - Miss:
hideReportLagMsinmotion/android/keyboard.tsis documented for Back but sourced from scripted blurs, andkeyboardModel.ts, the keyboard README and the browser spec repeat that premise, so measure Back or document the constant as the blur lag that Back reuses. - Miss: at 6,291 authored lines the change needs the owner-directed batch exemption, which applies only once every batched change is settled, so it waits on the Back decision.
Smaller notes, none blocking: BottomSheetPanel's SYNC list should name useMobileKeyboard.ts, two test descriptions still say the content rides up "from where it was", and the description should say the CLI no longer finds a doc for useMobileKeyboard.
[Automated review]
| }, | ||
| { | ||
| type: 'prose', | ||
| text: 'In Chrome on Android, a Tall BottomSheet\u2019s focused field rides the keyboard as Gboard slides it up and down, its scroll room staying until the keyboard is down. When the keyboard is reported, the sheet places the field just above it in that same frame, so Chrome has no covered field to pan to; if Chrome pans anyway, the sheet puts the page back when that pan ends. Chrome follows your viewport setting, which Astryx documents and never sets: your app owns its viewport `<meta>` element. By default (`interactive-widget=resizes-visual`) Chrome lays the keyboard over the page and pans to a focused field elsewhere on the page. With `interactive-widget=resizes-content` it shrinks the layout viewport instead, so content anchored to the bottom sits above the keyboard, and the sheet measures no keyboard and changes nothing: the browser has already made the room.', |
There was a problem hiding this comment.
Miss (blocking): this promises the hide rides Gboard's slide down, but a Back hide, which Chrome reports late (about 140 ms in, per the description's recording), rides only from Chrome's report. Suggest scoping it, for example: "…rides the keyboard as Gboard slides it up, and down after the field loses focus; a hide Chrome reports late, such as Back, rides down from Chrome's report."
There was a problem hiding this comment.
Scoped at a48d4a4: "…rides the keyboard as Gboard slides it up, and as Gboard slides it down after the field loses focus. … A hide Chrome reports late, such as Back, which keeps the focus, rides down from Chrome's report." The BottomSheet height row says the same.
| /** | ||
| * How long after Gboard starts to slide down Chrome's report of the hide | ||
| * fires, in ms, for a hide nothing predicted (Back). | ||
| * | ||
| * @source measured: Chromium 158 with Gboard on Android 15 (API 35 | ||
| * emulator); twelve scripted blurs: the visual viewport's resize came | ||
| * 42 to 52 ms after the blur (median 49), less `hideAfterBlurMs`, | ||
| * Oct 25 2026 | ||
| */ | ||
| hideReportLagMs: 33, |
There was a problem hiding this comment.
Miss (blocking): this is documented for a hide nothing predicted (Back), but its source measured twelve scripted blurs. The description's Back recording has Chrome's report about 140 ms into Gboard's hide, so the ride on Back trails the keyboard by over 100 ms. Either measure Back here or say this is the blur-measured lag that Back reuses, and update the comment in keyboardModel.ts and the README to match.
There was a problem hiding this comment.
Documented at a48d4a4 as the lag measured on blurs, which a hide nothing predicts, such as Back, reuses; keyboardModel.ts, the README and the spec's Back comments say the same. The Back behavior is recorded in AST-099 DEC-6 at this head.
|
/approve-spec a48d4a4 |
|
/approve-spec 62c40c8 |
There was a problem hiding this comment.
Requesting changes for one record fix; the keyboard behavior itself and its spec direction are settled, since an engineering owner approved the FR8 exceptions and DEC-6 on this head.
- Miss:
docs/specs/AST-099-mobile-keyboard/spec.mdstill describes main after this change: Gap 1 sayspackages/core/src/keyboard/does not exist, Gap 5 (and Gap 7) say the sheet's claim is iOS-only and Android gets nothing, Gap 11 cites the missing module, and the two "Today's hook" bullets in Current-state impact describe the old hook, so update those rows to what the module now does (the pre-review checklist's item k treats a gap row left for a claim the change builds as a finding).
Because that edits the record, the new head needs an engineering owner's /approve-spec <full head SHA> again (the author may give it as an engineering owner). CI's build, lint and test jobs have not run on this draft head yet.
[Automated review]
|
/approve-spec c796c21 |
There was a problem hiding this comment.
Requesting changes for one mechanical fix; the keyboard behavior and its spec direction are settled, since an engineering owner approved the FR8 exceptions and DEC-6 on this head.
- Regression: merged with current
main,packages/cli/test/__golden__/no-icon-set/search-icon-set.jsonandsearch-icon-set.txtread 378 matches while the CLI now prints 379 (mainmade the same 377 to 378 edit for its own new doc, so git merges the two silently), andexperimental-isolation.test.mjsfails its two icon-set search snapshots; mergemainand regenerate both goldens.
The rewritten gap and current-state rows in spec:AST-099 now match the keyboard module. A new commit needs its own approval, so the new head needs an engineering owner's /approve-spec <full head SHA> again (the author may give it as an engineering owner). CI's build, lint and test jobs have not run on this draft head yet.
[Automated review]
| "data": { | ||
| "query": "icon set", | ||
| "matchCount": 377, | ||
| "matchCount": 378, |
There was a problem hiding this comment.
Regression: main has since made the same 377 to 378 edit for its own new doc block, so a merge keeps 378 while the merged CLI prints 379, and experimental-isolation.test.mjs fails both icon-set search snapshots. Merge main and regenerate this file and search-icon-set.txt.
…t and rides Gboard's slides The keyboard module (packages/core/src/keyboard/) measures the on-screen keyboard from the viewports: the layout viewport's height minus the visual viewport's height times its scale. A page pan or a pinch zoom never reads as a keyboard, and nothing reads the user agent. A fully expanded Tall BottomSheet reads it. It adds the keyboard's height as room at the end of its content, reveals the focused field in the keyboard report's own event, and puts back a browser's own reveal pan. In Chrome on Android, on a touch screen, it rides Gboard's measured slides. Through the hide the room stays while the content rides down to where the scroll rests. Main's handling of iOS's downward keyboard dismissal moves into the module with the sheet's hook. AST-099's path-applicability gains the module's paths, so the files stay linked to the record now that their comments cite none.
|
/approve-spec 78d097c |
There was a problem hiding this comment.
Requesting changes for one missing piece of evidence. The keyboard behavior and its spec direction are settled, since an engineering owner approved the FR8 exceptions and DEC-6 on this head.
- Newly live check:
spec:AST-099Platform support now requires Android emulator evidence at the exact head, with animations at normal scale and removed plus a slow-device profile, and the description's Chrome-with-Gboard and Firefox for Android passes are from earlier heads, so run them on the head that will merge and link them in the description.
The icon-set goldens now match current main and pass. Linking the runs in the description needs no new commit, so this head's spec approval stands. CI's build, lint and test jobs have not run on this draft head yet.
[Automated review]
There was a problem hiding this comment.
Approved pending CI: build, typecheck, lint and most test shards already pass on this head, and the rest are still running or re-queued (test-node 3/4 and 4/4, test-ui 4/4, pr-interaction 1/2 and 2/2, docsite-test), so please do not merge until they pass.
The keyboard behavior and its spec direction are settled: an engineering owner approved the FR8 exceptions and DEC-6 on this head, and the description now reports the Android pass at this head that spec:AST-099 asks for, in Chrome with Gboard and Firefox for Android, at normal animation scale, with animations removed and under a slow-device profile.
One note, not blocking: that Android pass is described but not linked, and a link to its recordings would let later readers check it.
[Automated review]
User need
A Tall BottomSheet's last fields sit under a phone's keyboard. On Android, main lets the browser pan the page by up to 312 px, pushing the sheet's top off screen. On desktop, main reads a pinch zoom as a keyboard and adds 448 px of empty space.
Problem and solution fit
packages/core/src/keyboard/) measures the keyboard from the viewports, so a pan or zoom never reads as one.useMobileKeyboard(panelRef, {move: 'ride', inset: true, offset}): a fully expanded Tall sheet reserves the inset after its content, reveals the focused field in the report's own event, and undoes a browser's reveal pan.Current specification
spec:AST-099FR1–FR8, DEC-4 and DEC-6.For the owner: FR8's named exceptions and DEC-6, placement and Back, in your wording; the gap and current-state rows describe the module;
path-applicability:v1gainskeyboard/**,motion/android/**andutils/layoutViewport*. This needs/approve-spechere.Public delta and caller burden
No public API change; the CLI no longer finds a doc for the internal
useMobileKeyboard. Only a fully expandedheight="tall"sheet changes. Reduce Motion moves nothing; a fine pointer registers no touch listener.Design and alternatives
The VirtualKeyboard API misses Safari and reports late in Chrome. Without the inset, the field stayed covered in 3 of 8 Firefox shows.
Size
Authored lines: 5,649 added, 649 removed, 2,974 of them tests.
Batch:
S6 · On-screen keyboard (BottomSheet, ChatLayout).BottomSheet's import, gzip (esbuild, minified, from source): JavaScript 35,853 to 54,284 B; CSS 7,648 to 7,650 B. The addition is the shared animator and keyboard module, loaded eagerly because the reveal starts in the report's event.
Supersedes #8566.
Evidence
Android: the maintainers' Code Quality run at this head, 78d097c, on Chrome and Firefox (Testing), beside the owner's iPhone pass. Firefox's pan timings: firefox-shows.json.
Scope
Writing rubric results
R1, R3, R5, R6: none. R2: DEC-6 cites the two measured sets the owner asked for, as counts. R4: one
Rejected:line.Testing
pnpm build, core typecheck, CI'spnpm lint(strict) on the changed files, main'spnpm review:pre,pnpm check:knowledge, and 1,441 unit tests of BottomSheet, the keyboard module, the motion module, layoutViewport, inputStream, sharedResizeObserver and the hooks pass.BottomSheetKeyboardInset.interaction.browser.spec.tspasses 9 of 9 twice in Chromium's phone profile; its ride and Reduce Motion cases fail on d9bc14c's parent. BottomSheet's other browser specs pass 51 of 51. The browser spec takes main's hermetictestfrom@astryxdesign/a11y-spec/playwright. The CLI's resolution fixture is regenerated:useMobileKeyboardnow resolves tokeyboard/useMobileKeyboard.ts, andresolution-compat.test.mjspasses 14 of 14.merge-base;check-cli-structure, a temporary-fixture race) and main's extra one (host/index) pass 24 of 24 in both arms, run together twice in alternating order. None fails because of this change.rideKeyboard's curve read, the shared text-entry predicate, the pan check, the late report, the shared input and resize owners, the field's placement at the report, the hook's move intouseMobileKeyboard.tsand comments:pnpm typecheck,pnpm check:knowledgeandpnpm api:report(no change) pass.pnpm test:nodepasses 16,062 tests andpnpm test:ui19,068.Chrome on Android: placement at the first report (DEC-6)
Chrome pans the page itself if the focused field is still drawn below the keyboard about 100 to 170 ms after the keyboard report, with no page frames until that pan ends. So the field is placed 4 px above the keyboard's top in the report's own commit, and only the rest of Gboard's slide rides. On the same emulator, the banked entry within 50 ms panned in 1 of 8 default runs and 1 of 4 at 4× CPU; the placement, now this head's behavior, panned in none of 12.