Skip to content
Draft
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/browser-support-ios-keyboard-ride.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/cli': patch
---

[docs] The browser-support guide's on-screen keyboard section describes the ride in Safari on iOS. ChatLayout's composer, a Tall BottomSheet's focused field and a TextInput, TextArea or NumberInput in an app's docked bar wait for the keyboard's top. Then they rise with it on a spring a touch quicker than UIKit's keyboard motion. The scroll room stays until Safari reports the keyboard gone. The ride starts once the page has loaded Core's touch support.

@vjeux
7 changes: 7 additions & 0 deletions .changeset/keyboard-ride-ios.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/core': patch
---

[feat] In Safari on iOS, ChatLayout's composer, a Tall BottomSheet's focused field and a TextInput, TextArea or NumberInput in an app's docked bar ride the on-screen keyboard. Before, they moved up in one step at Safari's report. Each now waits until the keyboard's top reaches it, then rises with it on a spring a touch quicker than UIKit's own keyboard motion. The composer and the docked bar also go down with the keyboard from the blur that takes it down, as the sheet already did. The ride starts once the page has loaded Core's touch support, shortly after first paint; before that, they move in one step. Chrome on Android and Firefox for Android are unchanged. Under Reduce Motion nothing travels.

@vjeux
14 changes: 11 additions & 3 deletions docs/architecture/react-component-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,17 @@ those contracts.
once, with no cross-fade; a bottom sheet still drags, and a drag that closes
it takes the stylesheet exit instead of the spring; and a focused TextInput,
TextArea or NumberInput keeps the browser's own reveal, because their
keyboard module (`keyboard/useMobileKeyboard.ts`) is their touch part. A
gesture in that window
does not start the load. The bundler keeps one copy per page however many
keyboard module (`keyboard/useMobileKeyboard.ts`) is their touch part.
ChatLayout loads the touch runtime after first paint under a coarse pointer,
for the keyboard ride; it adds no gesture, and under a fine pointer it never
loads it. The runtime exposes Safari on iOS's keyboard schedule
(`keyboard/uikitKeyboardSchedule.ts`): the show's spring, UIKit's keyboard
spring for the hide, and the layout guide's focus rules there. The keyboard
riders build it with the duration and focus checks they hold, and register
it with the layout guide.
No first-load module imports it. The layout guide cannot hold it, since
nearly every page loads the guide first. A gesture in that
window does not start the load. The bundler keeps one copy per page however many
components use them. If the runtime's chunk fails to load, the page stays as
it is before the load: components work by taps, clicks and keys, and no
gesture retries the load. The loader's `import()` targets
Expand Down
75 changes: 62 additions & 13 deletions docs/specs/AST-099-mobile-keyboard/spec.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions packages/cli/assets/docs/browser-support.doc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ export const docs = {
type: 'prose',
text: 'In Chrome on Android, ChatLayout\u2019s composer rides the keyboard as Gboard slides it up and down. A Tall BottomSheet\u2019s focused field rides the keyboard as Gboard slides it up, and as Gboard slides it down after the field loses focus. The scroll room stays until the keyboard is down. A hide Chrome reports late, such as Back, which keeps the focus, rides down from Chrome\u2019s report. 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 those components measure no keyboard and change nothing: the browser has already made the room.',
},
{
type: 'prose',
text: 'In Safari on iOS, in the browser and as a home-screen app, ChatLayout\u2019s composer, a Tall BottomSheet\u2019s focused field and a TextInput, TextArea or NumberInput in an app\u2019s docked bar ride the keyboard. They rise from Safari\u2019s report of the keyboard, which comes a little after the keyboard starts up. Each waits until the keyboard\u2019s top reaches it, then rises with it. The rise runs a touch ahead of UIKit\u2019s own keyboard motion, which offsets part of that delay. They go down with the keyboard from the blur that takes it down. Safari reports the keyboard gone only once it is down, so the scroll room stays until then. The ride starts once the page has loaded Core\u2019s touch support, shortly after first paint; before that, they move in one step.',
},
{
type: 'code',
lang: 'html',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/__golden__/no-icon-set/docs-topics.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"supporting-older-browsers",
"how-these-tiers-move-over-time"
],
"skeleton": "463a740e90118dea23181c46a2cca01695d9295027863282835518f0bd655bdb",
"skeleton": "5aafc0d8f21d2f2961fb98ee722499ec146ae6cac841b036e019c03e4cdf8073",
"mentions": []
},
"color": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/BottomSheet/BottomSheet.doc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const docs = {
name: 'height',
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. A TextInput, TextArea or NumberInput in it is scrolled above the keyboard by a scroller in the sheet when that scroller can bring it there; otherwise the page brings it into view, which on iOS can shift the whole page. In Firefox for Android, where the page cannot scroll further, the field can stay under the keyboard. 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 sheet places the focused control just above the keyboard as it comes up, and the control rides the rest of Gboard\u2019s slide up, and the slide down after it loses focus; a hide Chrome reports late, such as Back, rides down from Chrome\u2019s report (`astryx docs browser-support`).",
"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. A TextInput, TextArea or NumberInput in it is scrolled above the keyboard by a scroller in the sheet when that scroller can bring it there; otherwise the page brings it into view, which on iOS can shift the whole page. In Firefox for Android, where the page cannot scroll further, the field can stay under the keyboard. 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 sheet places the focused control just above the keyboard as it comes up, and the control rides the rest of Gboard\u2019s slide up, and the slide down after it loses focus; a hide Chrome reports late, such as Back, rides down from Chrome\u2019s report. In Safari on iOS the content waits until the keyboard\u2019s top reaches the field, then rises with it on a spring a touch quicker than UIKit\u2019s keyboard. It goes down with the keyboard from the blur (`astryx docs browser-support`).",
default: "'capped'",
},
{
Expand Down
Loading