Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Approval is waiting on an engineering owner. The branch adds INV13 ("One exit copy per closing layer") and an Exit copy section to the current architecture:layer-runtime record, which main does not state yet. An engineering owner needs to approve or amend that text by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner. Whatever that decision is, these need changes before merge:
- Compared with
main, the diff carries all of #8187 and its stack (about 29.5k authored lines), so please land or retarget the dependencies until this pull request is only its own 250-line change. - A close before the first frame leaves
will-change: scale, opacityand a 500 ms timer on the hidden popover (popoverSurfaceMotion.ts:364callsreset()), so that branch should cancel the pending frame without writing anything. - The touch springs play as literals rather than motion roles (
spec:AST-094FR4), and nothing implements or tests FR35's "a touch during its growth is ignored", whichcomponent:PopoverFR9 requires.
[Automated review]
| if (pendingFrame != null) { | ||
| // Closed before the frame that would have presented it: nothing is on | ||
| // screen to dismiss. | ||
| reset(); |
There was a problem hiding this comment.
A close before the frame lands here, and reset() calls animator.set({scaleX: 1, scaleY: 1, opacity: 1}) (line 282) without {promote: false}. That set promotes the hidden element. In jsdom, after enter() then exit() in one task, the element is left with will-change: scale, opacity; and one pending timer, which writes the style again about 500 ms later. Nothing was written before the frame, so cancelPending(), clearing the state and returning would leave the element exactly as the component styles it. The new unit case could also assert will-change.
| // The popover's two springs are this component's measured values, not | ||
| // motion roles (touch motion stays internal, spec:AST-094 DEC-11): they | ||
| // play as given, so no table is registered and no other row is bundled. |
There was a problem hiding this comment.
spec:AST-094 FR4 says every spring a touch presentation plays MUST be a motion role, and that a component MUST NOT play a literal. FR31 asks for the popover's growth "on its motion roles". DEC-11 keeps roles internal, which is not the same as exempting a component from them. Registering the popover's two springs through a Popover motion table (DEC-5) and reading them as roles would conform.
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| LayerProvider | 4.1 kB (0) · 20 B CSS (0) | — | ✓ · ✓ · ✗ |
| lab/ChatEmojiPicker | 🔴 92.3 kB (+17.7 kB) · 773 B CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 🔴 92.9 kB (+17.7 kB) · 1.1 kB CSS (0) | — | — · — · — |
112 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| lab/CommentComposer | 🔴 132.7 kB (+17.4 kB) · 1.9 kB CSS (0) | — | — · — · — |
| Popover · Storybook | 🔴 77.8 kB (+17.0 kB) · 13.4 kB CSS (0) | 1,494 (+455) | ✓ · ✓ · ✓ |
| lab/TourStep | 🔴 83.8 kB (+16.9 kB) · 590 B CSS (0) | — | — · — · — |
| lab/CommentThread | 🔴 291.2 kB (+15.2 kB) · 2.4 kB CSS (0) | — | — · — · — |
| lab/Comments | 🔴 296.9 kB (+15.2 kB) · 2.5 kB CSS (0) | — | — · — · — |
| SideNav | 81.8 kB (+249 B) · 10.7 kB CSS (0) | — | — · — · — |
| AppShell | 81.8 kB (+191 B) · 12.8 kB CSS (0) | — | — · — · — |
| DateTimeInput | 193.5 kB (+97 B) · 18.0 kB CSS (0) | — | — · — · — |
| Tokenizer | 80.3 kB (+66 B) · 17.8 kB CSS (0) | — | — · — · — |
| ChatComposerInput | 66.2 kB (+65 B) · 10.6 kB CSS (0) | — | — · — · — |
| ChatComposerTokenElement | 66.2 kB (+64 B) · 10.6 kB CSS (0) | — | — · — · — |
| lab/TransferListSelector | 92.4 kB (+57 B) · 1.9 kB CSS (0) | — | — · — · — |
| ChatComposer | 68.2 kB (+56 B) · 11.2 kB CSS (0) | — | — · — · — |
| BreadcrumbItem | 75.8 kB (+49 B) · 11.5 kB CSS (0) | — | — · — · — |
| DropdownMenuSubMenu | 64.5 kB (+48 B) · 9.4 kB CSS (0) | — | — · — · — |
| FieldLabel | 42.9 kB (+47 B) · 5.2 kB CSS (0) | — | — · — · — |
| PowerSearch | 264.2 kB (+47 B) · 23.1 kB CSS (0) | — | — · — · — |
| charts/Chart | 173.8 kB (+44 B) · 494 B CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 239.8 kB (+43 B) · 454 B CSS (0) | — | — · — · — |
| CheckboxListItem | 66.2 kB (+42 B) · 10.9 kB CSS (0) | — | — · — · — |
| Slider | 97.0 kB (+42 B) · 8.3 kB CSS (0) | — | — · — · — |
| Toast | 89.1 kB (+42 B) · 9.6 kB CSS (0) | — | — · — · — |
| lab/TransferList | 85.4 kB (+42 B) · 1.7 kB CSS (0) | — | — · — · — |
| TabMenu | 63.0 kB (+39 B) · 10.4 kB CSS (0) | — | — · — · — |
| RadioListItem | 63.0 kB (+37 B) · 9.7 kB CSS (0) | — | — · — · — |
| Switch | 94.8 kB (+37 B) · 9.5 kB CSS (0) | — | — · — · — |
| lab/ListInput | 91.0 kB (+37 B) · 1.6 kB CSS (0) | — | — · — · — |
| richtext/RichTextView | 270.9 kB (+37 B) · 2.3 kB CSS (0) | — | — · — · — |
| Tooltip | 25.8 kB (+36 B) · 4.3 kB CSS (0) | — | — · — · — |
| Table | 99.6 kB (+35 B) · 17.2 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditor | 290.6 kB (+35 B) · 2.6 kB CSS (0) | — | — · — · — |
| MultiSelector | 88.3 kB (+33 B) · 16.2 kB CSS (0) | — | — · — · — |
| Thumbnail | 55.9 kB (+33 B) · 10.9 kB CSS (0) | — | — · — · — |
| lab/Schedule | 98.9 kB (+33 B) · 3.9 kB CSS (0) | — | — · — · — |
| SideNavItem | 61.6 kB (+32 B) · 10.4 kB CSS (0) | — | — · — · — |
| HoverCard | 24.3 kB (+31 B) · 4.3 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 91.0 kB (+31 B) · 16.7 kB CSS (0) | — | — · — · — |
| TextInput | 59.4 kB (+31 B) · 10.5 kB CSS (0) | — | — · — · — |
| ListItem | 65.2 kB (+30 B) · 10.9 kB CSS (0) | — | — · — · — |
| Typeahead | 69.9 kB (+30 B) · 11.8 kB CSS (0) | — | — · — · — |
| Carousel | 59.5 kB (+29 B) · 10.3 kB CSS (0) | — | — · — · — |
| Field | 46.8 kB (+29 B) · 6.7 kB CSS (0) | — | — · — · — |
| charts/ChartTooltip | 151.2 kB (+28 B) · 423 B CSS (0) | — | — · — · — |
| FileInput | 60.2 kB (+28 B) · 10.3 kB CSS (0) | — | — · — · — |
| lab/EmojiPicker | 77.6 kB (+28 B) · 751 B CSS (0) | — | — · — · — |
| CodeBlock | 66.2 kB (+27 B) · 10.6 kB CSS (0) | — | — · — · — |
| StatusDot | 27.5 kB (+27 B) · 5.3 kB CSS (0) | — | — · — · — |
| TableCell | 91.4 kB (+27 B) · 16.9 kB CSS (0) | — | — · — · — |
| lab/SelectableCardGroup | 56.1 kB (+27 B) · 162 B CSS (0) | — | — · — · — |
| InputGroup | 48.5 kB (+25 B) · 7.3 kB CSS (0) | — | — · — · — |
| ChatSendButton | 52.0 kB (+24 B) · 9.3 kB CSS (0) | — | — · — · — |
| CheckboxList | 50.0 kB (+24 B) · 7.5 kB CSS (0) | — | — · — · — |
| Link | 48.5 kB (+24 B) · 6.9 kB CSS (0) | — | — · — · — |
| RadioList | 48.2 kB (+24 B) · 6.8 kB CSS (0) | — | — · — · — |
| TimeInput | 144.0 kB (+24 B) · 15.1 kB CSS (0) | — | — · — · — |
| Toolbar | 39.4 kB (+24 B) · 7.9 kB CSS (0) | — | — · — · — |
| CheckboxInput | 59.9 kB (+22 B) · 9.0 kB CSS (0) | — | — · — · — |
| InfoTip | 43.0 kB (+22 B) · 5.3 kB CSS (0) | — | — · — · — |
| ChatLayoutScrollButton | 52.1 kB (+21 B) · 9.5 kB CSS (0) | — | — · — · — |
| ComplexSelector | 62.4 kB (+21 B) · 11.0 kB CSS (0) | — | — · — · — |
| ContextMenu | 90.2 kB (+21 B) · 16.5 kB CSS (0) | — | — · — · — |
| Markdown | 161.5 kB (+21 B) · 19.5 kB CSS (0) | — | — · — · — |
| NumberInput | 62.8 kB (+21 B) · 10.7 kB CSS (0) | — | — · — · — |
| Stepper | 53.3 kB (+21 B) · 9.5 kB CSS (0) | — | — · — · — |
| Banner | 53.6 kB (+20 B) · 9.8 kB CSS (0) | — | — · — · — |
| Button | 51.5 kB (+19 B) · 9.3 kB CSS (0) | — | — · — · — |
| SegmentedControl | 89.0 kB (+19 B) · 6.8 kB CSS (0) | — | — · — · — |
| SideNavCollapseButton | 52.4 kB (+19 B) · 9.4 kB CSS (0) | — | — · — · — |
| lab/CommentPin | 52.6 kB (+19 B) · 1.2 kB CSS (0) | — | — · — · — |
| lab/DiffViewer | 77.9 kB (+19 B) · 2.1 kB CSS (0) | — | — · — · — |
| Calendar | 62.4 kB (+18 B) · 9.9 kB CSS (0) | — | — · — · — |
| TableSelectionToolbar | 61.1 kB (+18 B) · 12.4 kB CSS (0) | — | — · — · — |
| ToggleButton | 52.5 kB (+18 B) · 9.4 kB CSS (0) | — | — · — · — |
| AvatarGroup | 42.1 kB (+17 B) · 5.6 kB CSS (0) | — | — · — · — |
| ChatLayout | 54.9 kB (+17 B) · 9.8 kB CSS (0) | — | — · — · — |
| SideNavHeading | 66.6 kB (+17 B) · 10.6 kB CSS (0) | — | — · — · — |
| AvatarGroupOverflow | 44.4 kB (+16 B) · 5.5 kB CSS (0) | — | — · — · — |
| DropdownMenu | 85.8 kB (+16 B) · 16.6 kB CSS (0) | — | — · — · — |
| MobileNavToggle | 51.9 kB (+16 B) · 9.3 kB CSS (0) | — | — · — · — |
| TopNav | 63.2 kB (+16 B) · 10.2 kB CSS (0) | — | — · — · — |
| DialogHeader | 54.4 kB (+15 B) · 10.8 kB CSS (0) | — | — · — · — |
| TextArea | 53.8 kB (+15 B) · 8.9 kB CSS (0) | — | — · — · — |
| AlertDialog | 95.6 kB (+14 B) · 13.7 kB CSS (0) | — | — · — · — |
| ChatDictationButton | 52.1 kB (+14 B) · 9.4 kB CSS (0) | — | — · — · — |
| DrawerHeader | 54.6 kB (+14 B) · 12.2 kB CSS (0) | — | — · — · — |
| IconButton | 51.6 kB (+14 B) · 9.3 kB CSS (0) | — | — · — · — |
| TabList | 40.1 kB (+14 B) · 6.4 kB CSS (0) | — | — · — · — |
| MobileNav | 61.5 kB (+12 B) · 9.9 kB CSS (0) | — | — · — · — |
| TopNavHeading | 66.0 kB (+12 B) · 10.4 kB CSS (0) | — | — · — · — |
| Avatar | 39.4 kB (+11 B) · 5.5 kB CSS (0) | — | — · — · — |
| DateRangeInput | 81.4 kB (+10 B) · 11.8 kB CSS (0) | — | — · — · — |
| Lightbox | 59.7 kB (+9 B) · 9.7 kB CSS (0) | — | — · — · — |
| MoreMenu | 86.1 kB (+8 B) · 16.6 kB CSS (0) | — | — · — · — |
| TopNavMegaMenu | 60.9 kB (+5 B) · 11.2 kB CSS (0) | — | — · — · — |
| TopNavMenu | 65.8 kB (+3 B) · 10.5 kB CSS (0) | — | — · — · — |
| charts/ChartLegend | 35.6 kB (+1 B) · 224 B CSS (0) | — | — · — · — |
| ChatMessageList | 23.8 kB (0) · 6.9 kB CSS (0) | — | — · — · — |
| ChatToolCalls | 27.7 kB (0) · 8.3 kB CSS (0) | — | — · — · — |
| CommandPalette | 59.3 kB (0) · 12.4 kB CSS (0) | — | — · — · — |
| CommandPaletteInput | 27.9 kB (0) · 7.5 kB CSS (0) | — | — · — · — |
| Heading | 8.0 kB (0) · 5.3 kB CSS (0) | — | — · — · — |
| Timer | 9.6 kB (0) · 5.9 kB CSS (0) | — | — · — · — |
| ProgressBar | 11.5 kB (−1 B) · 6.2 kB CSS (0) | — | — · — · — |
| Spinner | 20.3 kB (−1 B) · 6.1 kB CSS (0) | — | — · — · — |
| Text | 7.5 kB (−1 B) · 5.3 kB CSS (0) | — | — · — · — |
| Timestamp | 23.0 kB (−1 B) · 9.6 kB CSS (0) | — | — · — · — |
| Selector | 88.8 kB (−2 B) · 16.6 kB CSS (0) | — | — · — · — |
| DateInput | 167.1 kB (−3 B) · 16.1 kB CSS (0) | — | — · — · — |
| Pagination | 98.8 kB (−14 B) · 17.0 kB CSS (0) | — | — · — · — |
| BaseTypeahead | 61.9 kB (−17 B) · 10.3 kB CSS (0) | — | — · — · — |
| layer | — | — | — · ✓ · — |
| Layer | — | — | ✓ · ✓ · — |
Package size: @astryxdesign/core 6.74 MB packed (+26.5 kB); no new dependencies.
API changes: none in this pull request
Committed API report behind this build: cli 19 rows, core 21 rows; run pnpm api:report.
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Approval is waiting on an engineering owner: the branch adds INV13 ("One exit copy per closing layer"), an Exit copy section and its verification row to the current architecture:layer-runtime record, which main does not state yet. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, or says which part must change, and the author may do so as an engineering owner. Whatever that decision is, these need changes before merge:
- Against
mainthe diff carries all of #8223 and its stack (about 38.6k authored lines), so please land or retarget the dependencies until this pull request is only its own 257-line change. - The FR35 input hold now starts in the next frame with the rest of the presentation (
popoverSurfaceMotion.ts:373-374), so a touch landing in the first frame after the open is not held; placing the hold inenter()would close that window. - A close before that frame calls
reset(), which leaveswill-change: scale, opacityand a 500 ms timer on the hidden popover (popoverSurfaceMotion.ts:388). - Popover's two springs still play as literals rather than motion roles (
spec:AST-094FR4).
[Automated review]
| presentHandle = handle; | ||
| // No touch reaches the page, or dismisses the popover, until it is in. | ||
| releaseHold(); | ||
| holdRelease = holdInput(element, {until: handle, scope: 'viewport'}); |
There was a problem hiding this comment.
This hold now arrives with present() in the next frame, so a touch that lands between the open and that frame is not held: a tap outside light-dismisses the popover and reaches the page, and a drag scrolls it (spec:AST-094 FR35). On #8223 the hold was placed in the opening task. Placing it in enter() for a fresh presentation reads no box, and a hold case that does not run frame() first would cover it.
| ((callback: () => void) => | ||
| typeof view?.requestAnimationFrame === 'function' | ||
| ? view.requestAnimationFrame(() => callback()) | ||
| : (callback(), 0)); |
There was a problem hiding this comment.
Without requestAnimationFrame this runs the callback first, which sets pendingFrame = null, and then line 329 stores the returned 0; exit() then sees pendingFrame != null and resets instead of playing the shrink. Returning null here, or storing the handle only while the callback has not run, avoids it.
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [chore] Internal: one input hold for every layer (`Layer/inputHold`). While a layer presents, a touch, a press or a click anywhere reaches nothing (keys and assistive technology still act, and a pinch still zooms the page); while it dismisses, the same, and the layer's content is inert. The gesture host holds the layer's touches through its touch gates, and `isInputShield` lets a hit test see past a hold's shield. Not exported from the package entry point; no component uses it yet. |
There was a problem hiding this comment.
Popover places this hold at this head (popoverSurfaceMotion.ts:374), so "no component uses it yet" no longer holds, and the release notes would contradict popover-touch-input-hold.md.
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [chore] Internal: UIControl press tracking with control and cell profiles and the gesture hooks, with every press painter writing `data-astryx-press` through one internal writer in `utils/pressFeedback.ts`. Not exported from the package entry point. |
There was a problem hiding this comment.
At this head hooks/actionGroupTracker.ts:252-272 still sets and clears data-astryx-press itself, and paintPress has no caller outside tests, so not every painter goes through the one writer; narrow the note or route the tracker through paintPress.
|
/approve-spec a07f722 |
There was a problem hiding this comment.
Approval is waiting on an engineering owner: this branch adds INV13 (“One exit copy per closing layer”), the Exit copy section and its verification row to the current architecture:layer-runtime record, and the earlier /approve-spec names the previous head, so an engineering owner needs to approve that text again by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner), or say which part must change. Whatever that decision is, these need changes before merge:
- Against
mainthe diff still carries #8223 and its stack (38,649 authored lines), so please land or retarget the dependencies until only this change's 286 lines remain. - The input hold now starts in the next frame (
popoverSurfaceMotion.ts:328-334), so a touch in the frame after the open reaches the page, whichspec:AST-094FR35 forbids; holding fromenter(), or any hold for that frame that forces no layout, would close the window. - Popover's two springs still play as literals rather than motion roles (
spec:AST-094FR4), and CI'sscripts/touch-support-bundle.test.mjsfails because Core's root entry now bundles the gesture host throughLayer/inputHold.ts. - Without
requestAnimationFramethe returned0is read as a pending frame and the dismissal is skipped (popoverSurfaceMotion.ts:246-251), and.changeset/layer-input-hold.mdand.changeset/gesture-press-tracking.mdcontradict the code.
[Automated review]
| // The input hold starts with the presentation too, in that frame: a touch | ||
| // that starts in the one frame between the open and it (about 16 ms after | ||
| // the opening tap lifts) reaches the page, though its tap does not | ||
| // dismiss, since its lift lands on the hold. Holding from the open would | ||
| // cost two forced layouts in every touch opening (a top-layer cover's | ||
| // `showPopover()` lays the page out), the work this frame keeps out of | ||
| // the opening task. | ||
| pendingFrame = scheduleFrame(() => { |
There was a problem hiding this comment.
This moves the input hold into the next frame with the rest of the presentation, so a touch that starts between the open and that frame is not held, as the comment says. spec:AST-094 FR35 requires that a tap or a drag landing while a Popover is still entering reach nothing beneath it, and #8223 held from the opening task. The claim that the tap still does not dismiss because its lift lands on the hold is untested: a touch pointer is captured by the element its press began on, and every hold case runs frame() before touching. Taking the hold in enter() for a fresh presentation, or covering that frame some other way that forces no layout, plus a case that touches before frame(), would close it.
| // The popover's two springs are this component's measured values, not | ||
| // motion roles (touch motion stays internal, spec:AST-094 DEC-11): they | ||
| // play as given, so no table is registered and no other row is bundled. |
There was a problem hiding this comment.
spec:AST-094 FR4 requires every spring a touch presentation plays to be a motion role, a component's own measured roles joining through the generated table (DEC-5), and says a component must not play a literal; FR31 has Popover grow and shrink on its motion roles. DEC-11 keeps the roles internal rather than exempting a component, and registerSpringsTable (motion/uikit/springs.ts:517-548) leaves popoverPresent and popoverDismiss out, so a theme's knobs never reach this motion. Registering the two springs as Popover roles and resolving them before building the curves would conform.
| const scheduleFrame = | ||
| requestFrame ?? | ||
| ((callback: () => void) => | ||
| typeof view?.requestAnimationFrame === 'function' | ||
| ? view.requestAnimationFrame(() => callback()) | ||
| : (callback(), 0)); |
There was a problem hiding this comment.
Without requestAnimationFrame this runs the callback, which clears pendingFrame and presents, then returns 0, which line 335 stores. exit() then sees a frame still pending (line 391) and takes the early-close branch, so the dismissal never plays. Returning no handle here, or storing the handle only while the callback has not run, avoids it.
| */ | ||
|
|
||
| import {useEffect, type RefObject} from 'react'; | ||
| import {getGestureHost} from '../gestures/GestureHost'; |
There was a problem hiding this comment.
Through popoverSurfaceMotion.ts:90 this import is what puts the gesture modules into Core's root entry: CI's scripts/touch-support-bundle.test.mjs (unchanged here, identical on main) now fails “is absent from the root entry” with GestureHost.ts at 31,377 minified bytes. Either the root entry stays free of it, as that test pins for architecture:react-component-runtime INV13, or the test changes together with the record.
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [chore] Internal: one input hold for every layer (`Layer/inputHold`). While a layer presents, a touch, a press or a click anywhere reaches nothing (keys and assistive technology still act, and a pinch still zooms the page); while it dismisses, the same, and the layer's content is inert. The gesture host holds the layer's touches through its touch gates, and `isInputShield` lets a hit test see past a hold's shield. Not exported from the package entry point; no component uses it yet. |
There was a problem hiding this comment.
Popover holds through this module at this head (popoverSurfaceMotion.ts:380), so “no component uses it yet” no longer holds, and the release notes would contradict popover-touch-input-hold.md.
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [chore] Internal: UIControl press tracking with control and cell profiles and the gesture hooks, with every press painter writing `data-astryx-press` through one internal writer in `utils/pressFeedback.ts`. Not exported from the package entry point. |
There was a problem hiding this comment.
hooks/actionGroupTracker.ts:252 and :266 still set data-astryx-press directly, so not every press painter writes through the one writer in utils/pressFeedback.ts; narrow the note or route the tracker through paintPress.
|
Fixed in 93be8a5: a close before the presentation's frame now leaves the hidden popover with no |
There was a problem hiding this comment.
Approval is waiting on an engineering owner: against main this branch adds new normative text to three current records (architecture:layer-runtime INV13 and its Exit copy section, spec:AST-094 FR41's rule for claimed mouse and pen drags, and spec:AST-057's motion-role line), and it starts the FR35 input hold one frame after the open, which the description asks the owners to accept (no browser case yet shows what a tap that starts in that frame does). An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, or says what must change; the author may do so as an engineering owner. Whatever that decision is, these need changes before merge:
- The diff still carries #8223 and its stack (44,673 authored lines against
main), so please land or retarget the dependencies until only this change's 286 lines remain. - Popover's two springs play as literals (
popoverSurfaceMotion.ts:373,:440), whichspec:AST-094FR4 forbids, so register them as motion roles or sequence this after #8258. .changeset/layer-input-hold.mdsays no component uses the input hold although Popover does, and the no-requestAnimationFramefallback returns0, whichexit()later reads as a pending frame.
[Automated review]
| // The popover's two springs are this component's measured values, not | ||
| // motion roles (touch motion stays internal, spec:AST-094 DEC-11): they | ||
| // play as given, so no table is registered and no other row is bundled. | ||
| const animator = createAnimator(element, animatorOptions); |
There was a problem hiding this comment.
spec:AST-094 FR4 says a component “MUST read touch motion through these roles and MUST NOT play a literal”, and that a theme's knob values reach the motion; FR31 has a Popover grow and shrink “on its motion roles”. DEC-11 keeps roles internal without exempting a component, yet POPOVER_PRESENT_SPRING and POPOVER_DISMISS_SPRING play as given here (:373, :440) and stay out of registerSpringsTable's roles (motion/uikit/springs.ts:521-534), so a theme's tempo and character never reach this motion. Registering them through a Popover motion table (DEC-5), or sequencing this after #8258, would conform.
| ((callback: () => void) => | ||
| typeof view?.requestAnimationFrame === 'function' | ||
| ? view.requestAnimationFrame(() => callback()) | ||
| : (callback(), 0)); |
There was a problem hiding this comment.
Without requestAnimationFrame this runs the callback at once (it clears pendingFrame and presents) and then returns 0, which line 335 stores; exit() then reads 0 as a pending frame (line 391) and takes the early-close branch, so the shrink never plays. Returning no handle here, or storing the handle only while the callback has not run, avoids it.
| // The input hold starts with the presentation too, in that frame: a touch | ||
| // that starts in the one frame between the open and it (about 16 ms after | ||
| // the opening tap lifts) reaches the page, though its tap does not | ||
| // dismiss, since its lift lands on the hold. Holding from the open would | ||
| // cost two forced layouts in every touch opening (a top-layer cover's | ||
| // `showPopover()` lays the page out), the work this frame keeps out of | ||
| // the opening task. | ||
| pendingFrame = scheduleFrame(() => { |
There was a problem hiding this comment.
As this comment says, a touch that starts in the frame before the presentation is not held, while spec:AST-094 FR35 says a tap or a drag during the entrance must not scroll the page or reach anything beneath, and component:Popover FR9 says a touch during the growth is ignored. The claim here that such a tap still does not dismiss has no case, and under a finger the lift's pointerup goes to the element the pointerdown hit (implicit pointer capture), not to a shield shown afterwards, and the popover's light dismiss reads that pointerup. The description asks the owners to accept the window; if they do not, the hold moves back to the open, where #8223 placed it, and if they do, FR35 needs to say so.
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [chore] Internal: one input hold for every layer (`Layer/inputHold`). While a layer presents, a touch, a press or a click anywhere reaches nothing (keys and assistive technology still act, and a pinch still zooms the page); while it dismisses, the same, and the layer's content is inert. The gesture host holds the layer's touches through its touch gates, and `isInputShield` lets a hit test see past a hold's shield. Not exported from the package entry point; no component uses it yet. |
There was a problem hiding this comment.
Popover holds through this module at this head (popoverSurfaceMotion.ts:380), and .changeset/popover-touch-input-hold.md announces that hold, so “no component uses it yet” contradicts the release's own notes.
3f3923a to
4a2fe6d
Compare
… landed; uikit index header lists popover and zoomMedia)
… landed; uikit index header lists popover and zoomMedia)
… landed; uikit index header lists popover and zoomMedia)
|
/approve-spec 9d5eb78 |
There was a problem hiding this comment.
All four pull requests in this stack are approved; CI is green on this head.
#8186 (layer runtime exit copy): approve. The exit copy follows the architecture:layer-runtime INV13 text an engineering owner approved at its head, and its unit, Chromium and WebKit proofs pass. No blocking findings.
- Miss (optional): the JSDoc on
isFormAssociatedinmotion/transientCopy.tsrestates the function's name and can be dropped.
#8187 (Popover grows from and shrinks into its trigger): approve. The grow, shrink and touch hold follow spec:AST-094 FR31, FR35, FR45 and FR7, the reworded component:Popover FR9 and new PR4 are approved at its head, and the merge keeps both popover and zoomMedia in the UIKit index. No blocking findings.
#9823 (browser proofs): approve. Every proof passes at the top head. No blocking findings.
#8662 (next-frame presentation): approve. The first-frame window before the touch hold starts is recorded in spec:AST-094 and Popover's record, both approved at this head, and the opening tap's task lays out no more than a mouse opening. No blocking findings.
- Miss (optional): the comment in
popoverSurfaceMotion.tsthat says a touch landing before the hold cannot dismiss the popover is not shown by any case; see the earlier inline note.
Whole stack: passes. It exports nothing new and changes nothing for a mouse or trackpad. A pull request in the stack lands only when it and every pull request below it are approved.
[Automated review]
…side keepInherited)
|
/approve-spec 10c7b84 |
There was a problem hiding this comment.
All four pull requests in this stack are approved; CI is green on this head.
#8186 (layer runtime exit copy): approve. The exit copy follows the architecture:layer-runtime INV13 text an engineering owner approved at its head, and the merge of main keeps the swap copy's new placement beside the shared inherited-style step. No blocking findings.
- Miss (optional): the JSDoc on
isFormAssociatedinmotion/transientCopy.tsrestates the function's name and can be dropped.
#8187 (Popover grows from and shrinks into its trigger): approve. The grow, shrink and touch hold follow spec:AST-094 FR31, FR35, FR45 and FR7, and the reworded component:Popover FR9 and new PR4 are approved at its head. Its earlier request for changes asked only for the stack to hold, which it now does. No blocking findings.
#9823 (browser proofs): approve. Every proof passes at the top head, and its earlier request for changes, also about the stack, is resolved the same way. No blocking findings.
#8662 (next-frame presentation): approve. The first-frame window before the touch hold starts is recorded in spec:AST-094 and Popover's record, approved at this head, and the opening tap's task lays out no more than a mouse opening. No blocking findings.
- Miss (optional): the comment in
popoverSurfaceMotion.tsthat says a touch landing before the hold cannot dismiss the popover is not shown by any case; see the earlier inline note.
Whole stack: passes. It exports nothing new and changes nothing for a mouse or trackpad. A pull request in the stack lands only when it and every pull request below it are approved.
[Automated review]
The growth and its input hold now start on the first frame after the open, not in the task that opens the popover, so the opening tap's task lays out no more than a mouse opening does. Folded from meta#8662, so the group's squashes apply in order: these lines are this pull request's own.
The touch-motion spec's cases for the growth that starts on the first frame after the open, folded from meta#8662 with the change they prove.
The next-frame presentation's edits to the motion module, its tests, the changeset and the browser proofs now ride the pull requests that add those files, so each squashes cleanly in order. What stays here is the two records lines. The tree is unchanged.
|
/approve-spec 4813761 |
There was a problem hiding this comment.
Requesting changes on #8187 and #8662 and approving #8186 and #9823; a pull request in this stack lands only when it and every pull request below it are approved.
#8186: approve
No blocking findings.
#8187: request changes
- The next-frame start now lives here (
popoverSurfaceMotion.ts:150-154and:303, pinned bypopoverSurfaceMotion.test.ts:718), so a touch in the frame after a Popover opens reaches the page, but the two lines that record that window againstspec:AST-094FR35 (AST-094 spec.md:923-925and Popover's Current-state impact atPopover.spec.md:76-79) are still in #8662; move them into this pull request with the code.
#9823: approve
Tests only; no blocking findings.
#8662: request changes
- Its title and description still claim the next-frame code change and its unit cases, which now sit in #8187 and #9823, while its own change is only those two record lines; once they move to #8187 nothing is left here, so it can close (or, if it stays, its title and description describe a record change).
Whole stack
The combined code and records match the stack as last reviewed, so moving the two record lines into #8187 clears both findings.
[Automated review]
| under a finger they follow FR26–FR35 as each applies. Popover's input hold | ||
| (FR35) starts on the first frame after the open, so a touch that lands | ||
| within that frame reaches the page. |
There was a problem hiding this comment.
This sentence, and Popover's Current-state impact (Popover.spec.md:76-79), record the window that popoverSurfaceMotion.ts creates, and that code now sits in #8187. Judged on its own, #8187 ships a touch that reaches the page in the first frame while FR35 still forbids it, and rejecting this pull request would no longer remove the window. Moving both lines into #8187 fixes it; this pull request then has nothing of its own left.
…s back into it (#8187) * chore(core): the layer runtime's exit copy, for a touch presentation's close placeLayerExitCopy puts a static, inert copy of a closing layer where the layer was drawn, in the top layer, for a touch presentation's close to play on: the browser hides a popover the moment it closes. The copy keeps the layer's box, transform, presented look, overflow and scroll positions; has no ids, anchor names, form names or form owner; is inert and hidden from assistive technology; and its descendants' keyframe animations and transitions do not start again. A refused show during the closing toggle waits, hidden, until the toggle is over. A layer inside other layers gets its copy after the outermost one, with what it inherited there (its color scheme included), so a close that takes the layers around it too still draws the copy. That copy is shown again above the copy the same close then places for a layer around it. A layer has one copy. The layer-runtime record states it, and that the presentation plays its exit on the copy (AST-094 FR7). Core's shared inertCopy now takes every copied native control and form-associated custom element out of any form with form="", as its documentation says, so the swap's copies join no form either. It also sets anchor-name: none on each copied element that has an anchor name, so no live anchor gets a second element. * Merge branch 'main' into uikit/c26-layer-exit-copy * feat(Popover): under a finger, it grows out of its trigger and shrinks back into it Under a coarse primary pointer, Popover grows out of its trigger on the theme duration step nearest iOS's growth (`--duration-medium-min`) and the theme's entrance easing, and shrinks back into it on the theme's exit duration and easing, on the layer runtime's exit copy. A fine primary pointer keeps the layer's own entrance. * Merge branch 'main' into uikit/c26-layer-exit-copy * Merge the updated lower stack branch into uikit/c26-popover-present (own diff unchanged) * feat(Popover): a touch during the growth is ignored While the popover grows, the layer runtime's input hold takes every touch, as UIKit ignores touches while it presents a popover. A tap outside does not dismiss it and reaches nothing under it, and a pinch still zooms the page. This folds in the hold that #8223 carried, so the growth and its hold land together. * fix(core): the exit copy keeps no closed layer The exit copy found the inner layers to raise through a module-level set of every copied layer. A layer React removed on close stayed reachable there until a later close showed a copy. The inner layers are inside the closing layer, so they are now found there, and nothing keeps a layer once it is gone. Chromium 150 and later refuse a show during another popover's toggle, so the copy can open in the next frame. The browser spec's light-dismiss case now reads the copy after a frame, as its nested-close cases do. The cap check's comment now names only the copy cap. * docs(core): the exit copy's JSDoc states the empty-canvas rule once The empty-canvas rule stays in the first paragraph, and the inert-copy paragraph no longer repeats it or `inertCopy`'s own contract. * Merge the updated lower stack branch into uikit/c26-popover-present (own diff unchanged) * Merge main into the layer exit copy branch (layer-runtime.md verification table keeps both rows) * Merge the updated lower stack branch into uikit/c26-popover-present (own diff unchanged) * Merge main into the layer exit copy branch (#8147 landed) * Merge the updated lower stack branch into the Popover branch (#8147 landed; uikit index header lists popover and zoomMedia) * Merge the updated lower stack branch into the Popover branch * Merge main into the layer exit copy branch (placeOver's beforeNode beside keepInherited) * Merge the updated lower stack branch into the Popover branch (#10224 landed) * Merge main into the layer exit copy branch (#10224 landed) * feat(Popover): the touch presentation starts in the next frame The growth and its input hold now start on the first frame after the open, not in the task that opens the popover, so the opening tap's task lays out no more than a mouse opening does. Folded from #8662, so the group's squashes apply in order: these lines are this pull request's own. * docs(Popover): record the next-frame window with the code The input hold starts on the first frame after the open, so a touch that lands within that frame reaches the page. spec:AST-094 and Popover's record state that window here, beside the code that opens it. Moved from #8662. * fix(core): the exit copy reads its host's style before the insertion keepInherited read the outer layer's parent's computed style right after the copy was inserted there: a style read after a write. It reads only that host and writes only on the still-detached copy, so it now runs before the insertion. What the copy inherits is unchanged. * Merge the updated lower stack branch into the Popover branch * perf(Popover): the growth reads its boxes and timing before it writes The frame that starts a touch presentation wrote the CSS entrance off and the start scale, read both boxes, wrote the origin and the start frame, then read the theme's entrance tokens. Each read after a write restyled or laid the page out again. It now reads both boxes and the entrance timing in one pass, then writes, the start frame first: the motion engine may read the element's will-change as it sets it. The box needs no reset first: the opening task already took the CSS entrance off, and a dismissal leaves the element at full size. Shown again during the dismissal, the popover reads its entrance timing before its first write too. Co-authored-by: Cindy Zhang <[email protected]>
…rink (#9823) * chore(core): the layer runtime's exit copy, for a touch presentation's close placeLayerExitCopy puts a static, inert copy of a closing layer where the layer was drawn, in the top layer, for a touch presentation's close to play on: the browser hides a popover the moment it closes. The copy keeps the layer's box, transform, presented look, overflow and scroll positions; has no ids, anchor names, form names or form owner; is inert and hidden from assistive technology; and its descendants' keyframe animations and transitions do not start again. A refused show during the closing toggle waits, hidden, until the toggle is over. A layer inside other layers gets its copy after the outermost one, with what it inherited there (its color scheme included), so a close that takes the layers around it too still draws the copy. That copy is shown again above the copy the same close then places for a layer around it. A layer has one copy. The layer-runtime record states it, and that the presentation plays its exit on the copy (AST-094 FR7). Core's shared inertCopy now takes every copied native control and form-associated custom element out of any form with form="", as its documentation says, so the swap's copies join no form either. It also sets anchor-name: none on each copied element that has an anchor name, so no live anchor gets a second element. * Merge branch 'main' into uikit/c26-layer-exit-copy * feat(Popover): under a finger, it grows out of its trigger and shrinks back into it Under a coarse primary pointer, Popover grows out of its trigger on the theme duration step nearest iOS's growth (`--duration-medium-min`) and the theme's entrance easing, and shrinks back into it on the theme's exit duration and easing, on the layer runtime's exit copy. A fine primary pointer keeps the layer's own entrance. * test(Popover): browser proofs of the touch presentation's grow and shrink Real-browser proofs, in Chromium and WebKit, that under a finger Popover grows out of its trigger on the theme's entrance tokens and shrinks back on its exit tokens, keeps advancing through a blocked main thread, does no Layout or Paint per frame, and cross-fades under Reduce Motion, with storyboards of both. * Merge branch 'main' into uikit/c26-layer-exit-copy * Merge the updated lower stack branch into uikit/c26-popover-present (own diff unchanged) * Merge the updated lower stack branch into uikit/c27-popover-present-proofs (own diff unchanged) * Merge #8187's input hold into the Popover touch proofs * feat(Popover): a touch during the growth is ignored While the popover grows, the layer runtime's input hold takes every touch, as UIKit ignores touches while it presents a popover. A tap outside does not dismiss it and reaches nothing under it, and a pinch still zooms the page. This folds in the hold that #8223 carried, so the growth and its hold land together. * test(Popover): browser proofs of the hold while the popover grows A tap outside, a tap on the trigger and a pan while the popover grows do nothing, a pinch still zooms, and a storyboard shows the growth going on under a tap outside. Folded from #8223. * fix(core): the exit copy keeps no closed layer The exit copy found the inner layers to raise through a module-level set of every copied layer. A layer React removed on close stayed reachable there until a later close showed a copy. The inner layers are inside the closing layer, so they are now found there, and nothing keeps a layer once it is gone. Chromium 150 and later refuse a show during another popover's toggle, so the copy can open in the next frame. The browser spec's light-dismiss case now reads the copy after a frame, as its nested-close cases do. The cap check's comment now names only the copy cap. * docs(core): the exit copy's JSDoc states the empty-canvas rule once The empty-canvas rule stays in the first paragraph, and the inert-copy paragraph no longer repeats it or `inertCopy`'s own contract. * Merge the updated lower stack branch into uikit/c26-popover-present (own diff unchanged) * Merge the updated lower stack branch into uikit/c27-popover-present-proofs (own diff unchanged) * test(Popover): the blocked-main-thread proof blocks from the page and asserts the verdict The page now starts the block once the growth has run a frame, and the proof asserts the harness verdict, which fails a judged part under 4 frames. Here the growth runs 600 ms at a constant speed, so each frame moves several pixels and a block that starts late on a loaded machine still lands inside it. * Merge main into the layer exit copy branch (layer-runtime.md verification table keeps both rows) * Merge the updated lower stack branch into uikit/c26-popover-present (own diff unchanged) * Merge the updated lower stack branch into uikit/c27-popover-present-proofs (own diff unchanged) * Merge main into the layer exit copy branch (#8147 landed) * Merge the updated lower stack branch into the Popover branch (#8147 landed; uikit index header lists popover and zoomMedia) * Merge the updated lower stack branch into the Popover branch (#8147 landed; uikit index header lists popover and zoomMedia) * Merge the updated lower stack branch into the Popover branch * Merge main into the layer exit copy branch (placeOver's beforeNode beside keepInherited) * Merge the updated lower stack branch into the Popover branch * Merge the updated lower stack branch into the Popover branch (#10224 landed) * Merge main into the layer exit copy branch (#10224 landed) * Merge #8187 (next-frame start folded in) into the Popover touch proofs * feat(Popover): the touch presentation starts in the next frame The growth and its input hold now start on the first frame after the open, not in the task that opens the popover, so the opening tap's task lays out no more than a mouse opening does. Folded from #8662, so the group's squashes apply in order: these lines are this pull request's own. * test(Popover): browser proofs of the next-frame start The touch-motion spec's cases for the growth that starts on the first frame after the open, folded from #8662 with the change they prove. * docs(Popover): record the next-frame window with the code The input hold starts on the first frame after the open, so a touch that lands within that frame reaches the page. spec:AST-094 and Popover's record state that window here, beside the code that opens it. Moved from #8662. * Merge #8187 (next-frame records moved in) into the Popover touch proofs * fix(core): the exit copy reads its host's style before the insertion keepInherited read the outer layer's parent's computed style right after the copy was inserted there: a style read after a write. It reads only that host and writes only on the still-detached copy, so it now runs before the insertion. What the copy inherits is unchanged. * Merge the updated lower stack branch into the Popover branch * perf(Popover): the growth reads its boxes and timing before it writes The frame that starts a touch presentation wrote the CSS entrance off and the start scale, read both boxes, wrote the origin and the start frame, then read the theme's entrance tokens. Each read after a write restyled or laid the page out again. It now reads both boxes and the entrance timing in one pass, then writes, the start frame first: the motion engine may read the element's will-change as it sets it. The box needs no reset first: the opening task already took the CSS entrance off, and a dismissal leaves the element at full size. Shown again during the dismissal, the popover reads its entrance timing before its first write too. * Merge the updated lower stack branch into the Popover touch proofs Co-authored-by: Cindy Zhang <[email protected]>
Stack: #8186 → #8187 → #9823 → #8662
Merge group: #8186, #8187, #9823, #8662
Review only this PR's change: vjeux/astryx@773765a...4813761
For squash merges, this pull request now carries only its two records lines. Its code and tests ride the pull requests that add those files: the Popover motion module, its unit tests, the changeset and the Popover unit test in #8187, and the browser proofs in #9823. The stack's final tree is unchanged. The sections below describe the next-frame presentation as one change.
Why
Opening a Popover with a finger did more layout work than opening it with a mouse, all inside the tap's own task: on #8223 the opening task laid the page out 12 times against 4 for a mouse opening, in about 23 ms against 14 (3 of 3 runs). On a busy phone that task crosses the 50 ms long-task line, which is when a tap visibly hitches.
What led to it
We are bringing Astryx's touch components to the behavior of native iOS controls, and each presentation has a proof that nothing in it blocks the main thread from the key press to the end of the dismissal (
spec:AST-094M1). The touch presentation wrote styles, read the popover's boxes, and wrote again, all in the opening task. On an anchored element, each read after a write lays the page out again.Options and tradeoffs
Why this choice
It moves the work out of the tap with no visual difference: the popover still grows from the first painted frame. A presentation during a dismissal reads nothing and still starts at once.
The layer's CSS entrance goes off in a microtask, once the script that opened the popover returns, after that script's reads. A write there costs the task no layout. A style read before the frame then finds no entrance running for the frame to cancel.
The input hold starts with the growth, in that frame, about 16 ms after the opening tap lifts. Starting it at the open would add back two forced layouts in every touch opening. Popover's record states the window under Current-state impact: "The input hold starts on the first frame after the open; a touch landing within that frame reaches the page."
spec:AST-094's Current-state line for Popover now states the same window beside FR35.How to check it
Evidence
Local gates at 1f9c307 on #8223 134e7c9. The stack's final tree at 4813761 equals the one they were run on, with main's later changes merged in:
popoverSurfaceMotion.ts, the four cases above fail.PopoverTouchMotion.interaction.browser.spec.ts: 14 of 14, two runs. The opening proof fails on fix(Popover): under a finger, a tap during the presentation is ignored, as on iOS #8223's build, 4 of 4, and passes 5 of 5 here, in alternating order.tscpasses, andCI=true pnpm lintreports no errors.pnpm review:pre --base 134e7c9c8c: no findings.Since then this pull request adds one
spec:AST-094line, rewords two comments, and times the rendering proof from each motion's own start. At the current head, the fullPopoverTouchMotionspec passes 14 of 14, twice, in Chromium. Popover and Layer unit tests pass 627 of 627,tscpasses, andpnpm check:knowledgeis clean.The rendering proof used to time its windows from the growth's
animate()call. The growth now starts in a frame callback, and where the compositor starts it in that frame, its animation starts at the frame's time, before that call. Each window now starts from the motion's own start time, and the wait still finds its motion by the call. With the growth started at its frame's time and its call 25 ms later, the old timing fails 6 of 6 and the new passes 6 of 6. With a start before the key press, the old timing fails 6 of 6, a wait that matches by start fails 6 of 6, and the new passes 6 of 6.Measured on the earlier base (46d134e on #8223 e0a9bb5), with the same own change:
iOS 26.2 simulator (Safari, a grey dot per finger), recorded on the earlier stack, before #8187's rebuild. The behavior this change adds is the same:
Writing rubric results
Run over
component:Popover's record, which this change adds one Current-state impact line to, andspec:AST-094's Current-state impact, where one sentence joins the bullet for DropdownMenu, ContextMenu and Popover: