Skip to content
Draft
Show file tree
Hide file tree
Changes from 9 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
21 changes: 14 additions & 7 deletions docs/architecture/react-component-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,15 @@ those contracts.
shared internal hook in the keyboard module (`packages/core/src/keyboard/`)
measures the on-screen keyboard, keeps the page from panning on focus, and
dismisses the keyboard when a surface moves (`spec:AST-099`); it is not
exported. The keyboard height and each keyboard change's transition (start
time, resting value, curve) reach styles only as the hook's value and live
only in the hook: each consumer applies them through a StyleX functional style
exported. Apps read its value, read-only, from the public keyboard entry, and
Lab reads it from Core's internal keyboard entry (`spec:AST-099` FR3): the
height, whether a keyboard is up, and whether it has settled, with a
notification when it settles. The keyboard height
and each keyboard change's transition (start
time, resting value, curve) reach styles only as the hook's value, or as a
Core host's read-only layout value that includes the keyboard's lift
(`spec:AST-099` FR3), and live nowhere else: each consumer applies them
through a StyleX functional style
on its own element, and no CSS custom property on the document root or a
shared ancestor carries them. The keyboard module may also write, and remove,
a CSS `translate` on the nearest fixed-position ancestor of a focused Core
Expand Down Expand Up @@ -236,9 +242,10 @@ those contracts.
the hook makes at most one layout read per keyboard change. A component
outside Core does not ride; it commits the resting value once. Packages
outside Core cannot import the hook; a component there that responds to the
keyboard keeps one listener that measures as `spec:AST-099` FR2 defines, keeps
focus from panning as FR4 does, blurs as FR5 does, applies the height through
a functional style on its own elements, and follows INV3 and INV5. The hook
keyboard reads the hook's value through its entry and keeps no listener of its
Comment thread
astracat-bot[bot] marked this conversation as resolved.
Resolved
own that measures the keyboard. It keeps focus from panning as
`spec:AST-099` FR4 does, blurs as FR5 does, applies the height through a
functional style on its own elements, and follows INV3 and INV5. The hook
follows INV3 and INV5.
- **INV12 — Size changes inside a container have one module.** In
`@astryxdesign/core`, one internal module produces the size-change glide
Expand Down Expand Up @@ -676,7 +683,7 @@ component suite is not blanket conformance with every invariant.
| INV8 | Owner-observable behavior across documented composition replacement; optional focused internal mechanism tests | Behavior disappears or changes owner when a documented subpart is replaced |
| INV9 | Provider/external-store identity and render-count tests | Unchanged semantic payload changes identity, or snapshot identity creates a render loop |
| INV10 | Shared test over every adopter of the announcement module | An adopter holding its own Effect, observer, timer, or listener for its own-content announcement |
| INV11 | Source boundary check plus hook tests across StrictMode replay and unmount | A second keyboard listener or measurement in Core; a consumer reading a CSS custom property on the root or a shared ancestor for the height; an export of the hook; a component outside Core measuring by a rule other than AST-099 FR2, or riding the keyboard; a listener left after unmount; a translate left on an app element after the keyboard hides once focus has left the field, or after the field unmounts; any other write on an app element; a translate on a container whose layout box is not at the bottom edge, that fills the viewport, or whose own `translate` is not `none`; a translate on a container whose position the app is animating with CSS when the module measures; on a docked container too tall to fit above the keyboard once moved (a full-height side drawer, a pane below a fixed header), a translate when a scroller holds the field or one larger than the focused field needs to clear the keyboard; a translate measured before the page's own keyboard listeners run; a covered field deciding its keyboard behavior in an Effect that reacts to focus; a Core rider driven by JavaScript per frame or by its own transition; or more than one layout read per keyboard change beyond the docked bar's one read INV11 names |
| INV11 | Source boundary check plus hook tests across StrictMode replay and unmount | A second keyboard listener or measurement in Core; a consumer reading a CSS custom property on the root or a shared ancestor for the height; an export of the hook; a component outside Core with a keyboard listener or a measurement of its own, or riding it; a listener left after unmount; a translate left on an app element after the keyboard hides once focus has left the field, or after the field unmounts; any other write on an app element; a translate on a container whose layout box is not at the bottom edge, that fills the viewport, or whose own `translate` is not `none`; a translate on a container whose position the app is animating with CSS when the module measures; on a docked container too tall to fit above the keyboard once moved (a full-height side drawer, a pane below a fixed header), a translate when a scroller holds the field or one larger than the focused field needs to clear the keyboard; a translate measured before the page's own keyboard listeners run; a covered field deciding its keyboard behavior in an Effect that reacts to focus; a Core rider driven by JavaScript per frame or by its own transition; or more than one layout read per keyboard change beyond the docked bar's one read INV11 names |
Comment thread
astracat-bot[bot] marked this conversation as resolved.
Resolved
| INV12 | Source boundary check plus real-browser tests on a throttled phone profile over a 10-level by 50-sibling tree and two changes in one frame | A per-frame height or layout, a walk past the area or into a subtree other than `display: contents`, an element moved twice for one frame, an added element other than a swap's one transient copy, that copy left after the swap ends, an exported reporting function, a slide that moves a child outside the band, or a moving clip on an element whose parts slide fails |
| INV13 | Source boundary check plus bundle analysis of a page with several touch components, and real-browser tests on a throttled phone profile, under a fine pointer, and on a hybrid device | A second copy of a touch module on one page, a component bundling its own copy of a module's primitive, an `import()` whose target is one of these modules, other than `Item`'s released loader for its deprecated swipe props, a swipe module (the gesture core, the animator, the panels' rendering, the row's gesture code) imported by `Item` or `ListItem`, swipe code in `Item` other than its deprecated path (that loader, the released row style, the role gate, the `commit` warning, the bridge, the click guard, the event forwarders, and the coexistence diagnostic), or any of it outside the deprecated path, a public export or doc entry for the modules, an install call or installed check in the public API, a gesture listener in a component that uses no gesture, or an idle document listener outside a press other than the one shared press controller and the one stray-click swallower, an import of `@astryxdesign/core/internal/*` outside Core and Lab, a class outside the recognizer family, an `instanceof` check on a recognizer, an internal factory with a public factory's name, or a direct module import for a job the public layer covers fails |
| INV15 | Unit tests of the animator's value mode and real-browser proofs of its adopters | A value off its channels' timing (the theme's tokens for a program-started change, a spring only where `spec:AST-094` FR45 keeps one), a count past the component's swap size, a count or cross-fade under reduced motion with a coarse or a fine pointer, an intermediate value announced, or a public export fails |
Expand Down
Loading