Repository navigation
fix(Popover): touch growth starts where the popover meets its trigger - #10949
Conversation
An anchored layer with no room on its requested side flips, but its entrance still slid from the requested side, onto its trigger. Every entrance also scaled about the center of its box. As it shows an anchored layer, the runtime reads the anchor and the layer's settled box in one pass, and reuses the boxes keepAnchorClear read. It writes the side as custom properties that the shared keyframes read: a step toward the trigger on each axis, and the origin where the layer meets the trigger. Without them, an entrance keeps its placement's side. A layer over its trigger's center, as a Selector list over its selected item, scales about that center and does not slide. That Selector writes the side itself after the commit that moves its list, and the runtime skips its own read.
Popover's touch growth found its side and meeting point with its own rule: the widest gap, with any overlap growing from below. The layer runtime's entrance found them by the larger center separation. The two disagreed only where the popover overlaps its trigger. Now popoverCollapsedState takes both from layerEntranceSide, so a finger and a mouse grow from one point. A popover over its trigger's center has no side to lengthen along, so it grows from that center by scale only. Both unit tests read one fixture table. INV20 now states the rule for the shared entrance, which also runs under a finger, and its verification row names its failure signals.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| LayerProvider | 4.4 kB (0) · 20 B CSS (0) | — | ✓ · ✓ · ✗ |
| Selector | 106.6 kB (0) · 17.9 kB CSS (0) | — | ✗ · ✓ · ✓ |
| SelectorOption | 21.6 kB (0) · 6.4 kB CSS (0) | — | ✗ · ✓ · ✓ |
116 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| charts/Chart | 211.5 kB (0) · 516 B CSS (0) | — | — · — · — |
| charts/ChartLegend | 54.8 kB (0) · 224 B CSS (0) | — | — · — · — |
| charts/ChartTooltip | 188.6 kB (0) · 451 B CSS (0) | — | — · — · — |
| AlertDialog | 110.6 kB (0) · 15.0 kB CSS (0) | — | — · — · — |
| AppShell | 96.2 kB (0) · 13.8 kB CSS (0) | — | — · — · — |
| Avatar | 45.8 kB (0) · 5.7 kB CSS (0) | — | — · — · — |
| AvatarGroup | 48.6 kB (0) · 5.8 kB CSS (0) | — | — · — · — |
| AvatarGroupOverflow | 51.8 kB (0) · 5.7 kB CSS (0) | — | — · — · — |
| Banner | 66.4 kB (0) · 10.9 kB CSS (0) | — | — · — · — |
| BaseTypeahead | 77.7 kB (0) · 11.3 kB CSS (0) | — | — · — · — |
| BreadcrumbItem | 91.0 kB (0) · 12.5 kB CSS (0) | — | — · — · — |
| Button | 64.4 kB (0) · 10.3 kB CSS (0) | — | — · — · — |
| Calendar | 75.5 kB (0) · 11.0 kB CSS (0) | — | — · — · — |
| Carousel | 74.1 kB (0) · 11.3 kB CSS (0) | — | — · — · — |
| ChatComposer | 83.9 kB (0) · 12.4 kB CSS (0) | — | — · — · — |
| ChatComposerInput | 81.6 kB (0) · 11.7 kB CSS (0) | — | — · — · — |
| ChatComposerTokenElement | 81.6 kB (0) · 11.7 kB CSS (0) | — | — · — · — |
| ChatDictationButton | 65.0 kB (0) · 10.4 kB CSS (0) | — | — · — · — |
| ChatLayout | 87.7 kB (0) · 10.9 kB CSS (0) | — | — · — · — |
| ChatLayoutScrollButton | 65.0 kB (0) · 10.5 kB CSS (0) | — | — · — · — |
| ChatMessageList | 30.6 kB (0) · 7.1 kB CSS (0) | — | — · — · — |
| ChatSendButton | 64.8 kB (0) · 10.3 kB CSS (0) | — | — · — · — |
| ChatToolCalls | 34.8 kB (0) · 8.4 kB CSS (0) | — | — · — · — |
| CheckboxInput | 68.7 kB (0) · 10.1 kB CSS (0) | — | — · — · — |
| CheckboxList | 72.9 kB (0) · 7.8 kB CSS (0) | — | — · — · — |
| CheckboxListItem | 75.6 kB (0) · 11.7 kB CSS (0) | — | — · — · — |
| CodeBlock | 79.7 kB (0) · 11.6 kB CSS (0) | — | — · — · — |
| CommandPalette | 75.9 kB (0) · 12.7 kB CSS (0) | — | — · — · — |
| CommandPaletteInput | 34.3 kB (0) · 7.6 kB CSS (0) | — | — · — · — |
| ComplexSelector | 76.9 kB (0) · 12.2 kB CSS (0) | — | — · — · — |
| ContextMenu | 114.3 kB (0) · 17.8 kB CSS (0) | — | — · — · — |
| DateInput | 196.2 kB (0) · 17.4 kB CSS (0) | — | — · — · — |
| DateRangeInput | 98.6 kB (0) · 12.9 kB CSS (0) | — | — · — · — |
| DateTimeInput | 218.6 kB (0) · 19.1 kB CSS (0) | — | — · — · — |
| DialogHeader | 67.3 kB (0) · 11.9 kB CSS (0) | — | — · — · — |
| DrawerHeader | 67.5 kB (0) · 13.3 kB CSS (0) | — | — · — · — |
| DropdownMenu | 103.6 kB (0) · 17.9 kB CSS (0) | — | — · — · — |
| DropdownMenuSubMenu | 74.3 kB (0) · 10.1 kB CSS (0) | — | — · — · — |
| Field | 59.3 kB (0) · 7.3 kB CSS (0) | — | — · — · — |
| FieldLabel | 55.2 kB (0) · 5.8 kB CSS (0) | — | — · — · — |
| FileInput | 73.5 kB (0) · 11.3 kB CSS (0) | — | — · — · — |
| Heading | 14.8 kB (0) · 5.5 kB CSS (0) | — | — · — · — |
| HoverCard | 30.1 kB (0) · 4.5 kB CSS (0) | — | — · — · — |
| IconButton | 64.5 kB (0) · 10.3 kB CSS (0) | — | — · — · — |
| InfoTip | 50.2 kB (0) · 5.4 kB CSS (0) | — | — · — · — |
| InputGroup | 60.9 kB (0) · 7.9 kB CSS (0) | — | — · — · — |
| Lightbox | 145.3 kB (0) · 11.5 kB CSS (0) | — | — · — · — |
| Link | 56.1 kB (0) · 7.1 kB CSS (0) | — | — · — · — |
| ListItem | 74.7 kB (0) · 11.7 kB CSS (0) | — | — · — · — |
| Markdown | 195.4 kB (0) · 21.1 kB CSS (0) | — | — · — · — |
| MobileNav | 74.9 kB (0) · 11.0 kB CSS (0) | — | — · — · — |
| MobileNavToggle | 64.8 kB (0) · 10.3 kB CSS (0) | — | — · — · — |
| MoreMenu | 103.8 kB (0) · 17.9 kB CSS (0) | — | — · — · — |
| MultiSelector | 100.7 kB (0) · 17.2 kB CSS (0) | — | — · — · — |
| NumberInput | 76.9 kB (0) · 11.8 kB CSS (0) | — | — · — · — |
| Pagination | 117.7 kB (0) · 18.2 kB CSS (0) | — | — · — · — |
| PowerSearch | 303.7 kB (0) · 24.7 kB CSS (0) | — | — · — · — |
| ProgressBar | 12.0 kB (0) · 6.4 kB CSS (0) | — | — · — · — |
| RadioList | 60.6 kB (0) · 7.3 kB CSS (0) | — | — · — · — |
| RadioListItem | 71.9 kB (0) · 10.4 kB CSS (0) | — | — · — · — |
| SegmentedControl | 101.9 kB (0) · 6.9 kB CSS (0) | — | — · — · — |
| SideNav | 119.7 kB (0) · 11.7 kB CSS (0) | — | — · — · — |
| SideNavCollapseButton | 65.3 kB (0) · 10.4 kB CSS (0) | — | — · — · — |
| SideNavHeading | 81.8 kB (0) · 11.7 kB CSS (0) | — | — · — · — |
| SideNavItem | 76.3 kB (0) · 11.5 kB CSS (0) | — | — · — · — |
| Slider | 114.2 kB (0) · 8.9 kB CSS (0) | — | — · — · — |
| Spinner | 27.1 kB (0) · 6.3 kB CSS (0) | — | — · — · — |
| StatusDot | 33.6 kB (0) · 5.4 kB CSS (0) | — | — · — · — |
| Stepper | 66.1 kB (0) · 10.5 kB CSS (0) | — | — · — · — |
| Switch | 108.7 kB (0) · 10.0 kB CSS (0) | — | — · — · — |
| Table | 132.4 kB (0) · 18.7 kB CSS (0) | — | — · — · — |
| TableCell | 115.6 kB (0) · 18.3 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 115.2 kB (0) · 18.0 kB CSS (0) | — | — · — · — |
| TableSelectionToolbar | 74.7 kB (0) · 13.6 kB CSS (0) | — | — · — · — |
| TabList | 47.1 kB (0) · 6.5 kB CSS (0) | — | — · — · — |
| TabMenu | 78.1 kB (0) · 11.5 kB CSS (0) | — | — · — · — |
| Text | 14.2 kB (0) · 5.5 kB CSS (0) | — | — · — · — |
| TextArea | 66.7 kB (0) · 9.4 kB CSS (0) | — | — · — · — |
| TextInput | 72.1 kB (0) · 11.5 kB CSS (0) | — | — · — · — |
| Thumbnail | 68.8 kB (0) · 11.9 kB CSS (0) | — | — · — · — |
| TimeInput | 169.4 kB (0) · 16.4 kB CSS (0) | — | — · — · — |
| Timer | 16.3 kB (0) · 6.1 kB CSS (0) | — | — · — · — |
| Timestamp | 35.8 kB (0) · 10.6 kB CSS (0) | — | — · — · — |
| Toast | 102.7 kB (0) · 10.6 kB CSS (0) | — | — · — · — |
| ToggleButton | 91.4 kB (0) · 10.4 kB CSS (0) | — | — · — · — |
| Tokenizer | 103.1 kB (0) · 19.5 kB CSS (0) | — | — · — · — |
| Toolbar | 47.0 kB (0) · 8.1 kB CSS (0) | — | — · — · — |
| Tooltip | 31.9 kB (0) · 4.5 kB CSS (0) | — | — · — · — |
| TopNav | 76.6 kB (0) · 11.3 kB CSS (0) | — | — · — · — |
| TopNavHeading | 81.5 kB (0) · 11.6 kB CSS (0) | — | — · — · — |
| TopNavMegaMenu | 75.4 kB (0) · 12.2 kB CSS (0) | — | — · — · — |
| TopNavMenu | 80.8 kB (0) · 11.6 kB CSS (0) | — | — · — · — |
| Typeahead | 86.9 kB (0) · 12.8 kB CSS (0) | — | — · — · — |
| lab/CommentPin | 60.2 kB (0) · 1.2 kB CSS (0) | — | — · — · — |
| lab/DialogHeroHeader | 87.9 kB (0) · 372 B CSS (0) | — | — · — · — |
| lab/DiffViewer | 92.3 kB (0) · 2.1 kB CSS (0) | — | — · — · — |
| lab/EmojiPicker | 91.8 kB (0) · 751 B CSS (0) | — | — · — · — |
| lab/LineClamp | 16.4 kB (0) · 168 B CSS (0) | — | — · — · — |
| lab/ListInput | 92.9 kB (0) · 922 B CSS (0) | — | — · — · — |
| lab/Schedule | 111.4 kB (0) · 3.9 kB CSS (0) | — | — · — · — |
| lab/SelectableCardGroup | 68.6 kB (0) · 162 B CSS (0) | — | — · — · — |
| lab/TabBarMoreList | 97.4 kB (0) · 1.8 kB CSS (0) | — | — · — · — |
| lab/TourStep | 92.4 kB (0) · 691 B CSS (0) | — | — · — · — |
| lab/TransferList | 107.1 kB (0) · 1.2 kB CSS (0) | — | — · — · — |
| lab/TransferListSelector | 115.9 kB (0) · 1.4 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditor | 303.7 kB (0) · 2.6 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 286.3 kB (0) · 454 B CSS (0) | — | — · — · — |
| richtext/RichTextView | 281.4 kB (0) · 2.3 kB CSS (0) | — | — · — · — |
| Popover · Storybook | 96.7 kB (−126 B) · 14.6 kB CSS (0) | 1,540 (−23) | ✓ · ✓ · ✓ |
| lab/ChatReactionBar | 113.1 kB (−127 B) · 1.1 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 112.0 kB (−130 B) · 773 B CSS (0) | — | — · — · — |
| lab/CommentComposer | 158.1 kB (−136 B) · 1.9 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 360.2 kB (−136 B) · 2.4 kB CSS (0) | — | — · — · — |
| lab/Comments | 367.2 kB (−143 B) · 2.5 kB CSS (0) | — | — · — · — |
| layer | — | — | — · ✓ · — |
| Layer | — | — | ✓ · ✓ · — |
Visual changes: 4 snapshots in 1 component
A change is a question for the reviewer, not a failure.
Package size: @astryxdesign/core 7.48 MB packed (−410 B); no new dependencies.
Touched components checked; add ci:run-visual or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
|
/approve-spec 8e32a44 |
There was a problem hiding this comment.
Waiting on one owner decision. INV20 is approved at this head, and the design decision on file covers flipped layers. Approval waits on the owner confirming it also covers these two mouse and trackpad changes, or on gating them to touch input:
- Every unflipped anchored-layer entrance that plays
layerAnimationsnow scales about the point where the layer meets its trigger instead of its box center. - Selector's list that opens over its selected option no longer slides and only scales about the trigger's center.
No blocking defect found: the touch-growth fix matches the shared fixture, and the new browser cases pass in Chromium. CI has not run on this head yet because the pull request is a draft, so its checks still need to pass.
[Automated review]
A show that places a layer afresh reads its side again after the placement, by design. INV20 now says the one measurement pass holds for a layer the show leaves in place, in its rule and its failure signal.
|
Both changes came from #10771, which has merged with the spec owner's approval. After this PR's merge of main, neither is in its diff. |
There was a problem hiding this comment.
Waiting on one owner decision. The touch fix itself looks right. A Popover placed over its trigger now grows from where it meets the trigger. The shared-fixture tests fail on main in exactly the three overlap rows and pass here, and the mouse path is untouched.
Approval waits on an engineering owner approving the rewritten architecture:layer-runtime INV20 at this head. The earlier /approve-spec named an older head. Since then the branch merged main and reworded one INV20 sentence. Against the current record, INV20 now:
- adds that Popover's touch growth starts from the point where the popover meets its trigger, and only scales over the trigger's center;
- covers the shared entrance (
layerAnimations) under every pointer, not only on the pointer path; - limits the one read per show to a layer that the show leaves in place.
An engineering owner records the decision by commenting /approve-spec 3df0122d6619693adf87be974e7e4a896dfc2f5e. The author may do this as an engineering owner. CI has not run on this draft head yet.
Both earlier inline notes are fixed at this head: the INV20 verification row and the Selector comment.
|
/approve-spec 3df0122 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The pull request is a draft from a fork, so CI runs once it is marked ready for review and a maintainer adds the ci:run label.
Under a finger, a Popover that overlaps its trigger now grows from where it meets the trigger, by the same side rule as the mouse entrance; the shared-fixture tests fail on main in exactly the three overlap rows and pass here. The architecture:layer-runtime INV20 change is approved by an engineering owner at this head, and both earlier inline notes are fixed.
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The pull request is a draft, so CI runs once it is marked ready for review.
Under a finger, a Popover that overlaps its trigger now grows from where it meets the trigger, by the same rule the pointer entrance uses. The layer-runtime record change has an engineering owner's approval for this head, and the shared fixture table fails on the base code in exactly the three overlap rows and passes here.
- Non-blocking: the INV20 row in the layer-runtime verification table has no failure signal, unlike every other row; the merge of
maindropped the one the earlier version carried.
Claims and files checked
- Claim: under a finger, a Popover that overlaps its trigger grows from where it meets the trigger. Verified by the shared fixture table, which fails on the base code in the three overlap rows and passes here, and by touch frames.
- Claim: a popover a few pixels over its trigger's side grows from that side, not from below. Verified: the origin moves from the top-left corner to the facing edge (fixture row and frames).
- Claim: a popover over its trigger's center grows from that center by scale only. Verified: the length starts full and the frames show an even scale about the center.
- Claim: every other landing grows as before, flipped ones included. Verified: the five clear rows pass on both builds, and the flipped-above frame is pixel-identical.
- Claim: a mouse is unchanged. Verified: the touch growth runs only under a coarse primary pointer, and the browser spec's mouse case passes.
- Claim: right to left needs nothing, because the side comes from physical boxes. Verified in the shared side helper.
- Claim: Reduced Motion is unchanged. Verified: the Reduce Motion unit and browser cases pass.
- Claim: both unit suites read one fixture table. Verified.
- Claim: the record now covers the shared entrance, one read per show for a layer left in place, and where the touch growth starts. Verified against the layer runtime code.
- Claim: no public API change, the side helper changes only its header comment, the private helpers in the frame module are removed, and only a test fixture is added. Verified.
- Claim: the merge adds the step room to the shared table, and the touch growth reads only the side and point. Verified.
- Claim: Selector loses one comment that restated its code. Verified.
- Claim: the size is +336/−112, split as source +20/−43, tests +296/−61, records and docs +20/−8. Verified.
- Claims about the author's full-suite, WebKit, accessibility, CLI and bundle-size runs: not re-run here. The relevant unit suites and the Chromium touch spec re-run here pass, and the CLI package is untouched.
- Files: the changeset, the three Layer files, the two Popover test files,
popoverSurfaceFrame.tsandSelector.tsxare clear.docs/architecture/layer-runtime.mdhas one non-blocking note.
kentonquatman
left a comment
There was a problem hiding this comment.
Design looks good 👍
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The pull request is a draft, so CI runs once it is marked ready for review.
Under a finger, a Popover that overlaps its trigger now grows from where it meets the trigger, by the same rule the pointer entrance uses. The layer-runtime record change carries an engineering owner's approval for this head, and the shared fixture table fails on the base code in exactly the three overlap rows and passes here.
- Non-blocking: the INV20 row in the layer-runtime verification table still has no failure signal, unlike the other rows in that table.
Claims and files checked
- Claim: under a finger, Popover used its own side rule (widest gap, overlaps growing from below), and the two rules disagreed only where a popover overlaps its trigger. Verified: the removed code in the Popover frame module, and the shared fixture's five clear rows pass on the base code.
- Claim: both entrances now read one rule. Verified: the touch growth calls the shared side helper.
- Claim: a popover a few pixels over its trigger's side grows from that side, not from below. Verified: fixture row and frames (origin moves from the top-left corner to the facing edge, growth turns sideways).
- Claim: a popover over its trigger's center grows from that center by scale only. Verified: its length starts full, and the frames show an even scale about the center.
- Claim: every other landing grows as before, flipped ones included. Verified: the clear fixture rows pass on both builds and the flipped frame is pixel-identical.
- Claim: no current record decides where the touch growth starts over an overlap, and the record now says so. Verified against the current layer-runtime, touch-presentation and Popover records and the head's INV20.
- Claim: the record also names the shared entrance and scopes its one read per show to a layer left in place. Verified against the layer runtime code.
- Claim: the record change needs the spec owners' approval at this head. Satisfied: the spec-owner status succeeds for this head.
- Claim: both unit suites read one fixture table. Verified.
- Claim: a mouse is unchanged. Verified: the touch growth runs only under a coarse primary pointer, and the browser spec's mouse case passes.
- Claim: right to left needs nothing, because the side comes from physical boxes. Verified in the shared side helper.
- Claim: Reduced Motion is unchanged. Verified: the Reduce Motion browser case passes.
- Claim: Selector only loses one comment that restated its code. Verified.
- Claim: no public API change; the side helper changes only its header comment; the frame module's private helpers go away; only a test fixture is added. Verified, including a build-and-compare of the published surface (no rows).
- Claim: the size is +336/−112 (source +20/−43, tests +296/−61, records and docs +20/−8). Verified.
- Claim: since the previous merge, main changed none of this pull request's files or direct imports. Verified.
- Claim: on the base code the shared table fails in exactly the three overlap rows. Verified.
- Claims about the author's WebKit, accessibility, full-suite, lint, CLI, bundle-size and device runs: not re-run here. The relevant unit suites and the Chromium touch spec re-run here pass.
- Files: the changeset, the three Layer files, the two Popover test files, the Popover frame module and
Selector.tsxare clear;docs/architecture/layer-runtime.mdhas one non-blocking note.
|
/approve-spec fb34403 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The pull request is a draft, so CI runs once it is marked ready for review.
Under a finger, a Popover that overlaps its trigger now grows from where it meets the trigger, through the same side rule the pointer entrance uses. The shared-fixture unit tests and the new browser cases fail on main's code only in the overlap landings and pass here, the mouse path is untouched, and the INV20 change carries an engineering owner's approval for this head.
- Non-blocking: INV20's verification row in
docs/architecture/layer-runtime.mdhas no failure-signal cell, unlike every other row in the table; consider restoring one.
Claims and files checked
- Claims
- Changeset: an overlapping popover under a finger grows from where it meets its trigger. Verified: the overlap fixture rows and the two overlap browser cases fail on
main's code and pass here. - Changeset: a popover a few pixels over the trigger's side grows from that side, and one over the trigger's center only scales. Verified by the fixture rows and the held frames at 60 ms.
- Changeset and description: every other landing, flipped ones included, grows as before. Verified: the five clear fixture rows and the flipped browser case pass on both.
- Description: the old rule took the widest gap and grew any overlap from below. Verified against the code
popoverSurfaceFrame.tsremoves. - Description: one fixture table feeds both unit suites. Verified.
- Description: a mouse is unchanged, and right to left and reduced motion need nothing. Verified: the growth runs only under a coarse pointer, it reads physical boxes, and the reduced-motion case passes.
- Description: no public API changes, no module is added, and Popover's private helpers go away. Verified: the built API surfaces compare with zero rows.
- Description: the size is +336/−112 lines. Verified.
- Description: the record change needs owner approval at this head. Verified, and the approval is given.
- Description: the full-suite, WebKit, CLI and bundle-size results are the author's runs. The Layer and Popover unit suites and the Popover touch browser spec in Chromium were re-run here and pass.
- Changeset: an overlapping popover under a finger grows from where it meets its trigger. Verified: the overlap fixture rows and the two overlap browser cases fail on
- Files
.changeset/popover-touch-side-rule.md: cleardocs/architecture/layer-runtime.md: one non-blocking notepackages/core/src/Layer/__tests__/layerEntranceSide.fixture.ts: clearpackages/core/src/Layer/layerEntranceSide.test.ts: clearpackages/core/src/Layer/layerEntranceSide.ts: clearpackages/core/src/Popover/__tests__/PopoverTouchMotion.interaction.browser.spec.ts: clearpackages/core/src/Popover/popoverSurfaceFrame.ts: clearpackages/core/src/Popover/popoverSurfaceMotion.test.ts: clearpackages/core/src/Selector/Selector.tsx: clear
| | INV18 | `useLayer.test.tsx` (a closed trigger has no anchor-name, and the trigger of a shown or fading layer does) and `TooltipClosedTriggerAnchor.interaction.browser.spec.ts` in Chromium and WebKit | A closed trigger with an anchor-name, a shown or fading layer placed away from its anchor, or a surface around a closed trigger that stops while the main thread is busy | | ||
| | INV18 | `useLayer.test.tsx`: a closed state that declares a discrete `display` transition or a keyframe animation keeps the trigger's anchor name until those animations end, read from the closed state's style; a layer whose closed state declares neither is not read for animations at the close | A layer with such a closed-state exit placed away from its anchor while it fades, or an animation read on the close of a layer whose closed state declares no exit | | ||
| | INV20 | `layerEntranceSide.test.ts` for the side, the meeting point and a step that stops at the room to a sized trigger, with no step for a layer flush against or over it, and `LayerEntranceSide.interaction.browser.spec.ts` in Chromium and WebKit for the first frame of each anchored layer that flips | | ||
| | INV20 | `layerEntranceSide.test.ts` and `popoverSurfaceMotion.test.ts`, which read one fixture table, for the side and the meeting point; `layerEntranceSide.test.ts` also for a step that stops at the room to a sized trigger, with no step for a layer flush against or over it; `LayerEntranceSide.interaction.browser.spec.ts` in Chromium and WebKit for the first frame of each anchored layer that flips, and `PopoverTouchMotion.interaction.browser.spec.ts` in Chromium and WebKit; `useLayer.test.tsx` | |
There was a problem hiding this comment.
Non-blocking: this row has no failure-signal cell, while every other row in the table has one. Consider restoring it with main's step clause, for example: "A flipped layer whose first frame moves onto its trigger, a step past the room to a sized trigger, an origin off the point where the layer meets its trigger, a layer over its trigger that steps, a touch growth that starts anywhere else, or a show that reads a layer left in place twice."












User impact
Under a finger, a Popover grows out of its trigger. It found its side and starting point by a rule of its own: the widest gap, with any overlap growing from below. The pointer entrance found them by another rule. The two disagreed only where a popover overlaps its trigger.
Now both read one rule. A popover a few pixels over its trigger's side grows from that side, not from below. A popover over its trigger's center grows from that center by scale only. Every other landing grows as before, flipped ones included.
Visual authority
No current record decides where the touch growth starts when a popover overlaps its trigger. The spec owners ruled that it takes its side and meeting point from the layer side rule. A popover over its trigger's center only scales. INV20 in
architecture:layer-runtimenow says so:INV20 also names the shared entrance (
layerAnimations), which runs under a finger too. Its one read per show now covers only a layer left in place. This record change needs the spec owners' approval at this head.How it works
popoverCollapsedStatetakes its side and meeting point fromlayerEntranceSide, the helper the pointer entrance uses. When the popover covers its trigger's center, there is no side, so its length starts full and only its scale grows.layerEntranceSide.test.tsandpopoverSurfaceMotion.test.tsread one fixture table, so the two paths cannot drift apart again.Before and after
Chromium with touch emulation at a 402 × 714 viewport, at normal speed: before left, this change right. No popover lands over its trigger on its own. So the two overlap clips place it there with a style, the same on both sides.
State matrix
Scope
Components: Popover, Layer. Selector loses one comment that restated its code.
Testing
Every browser run uses 1 worker, which is CI's profile. The green runs are at this head (fb34403). It merges main at 36f68b0 into a76ed0f, which merged main at f04a3d6. Since f04a3d6, main changed
docs/architecture/layer-runtime.md, which this pull request edits, andLayer/useLayer.tsx, whichSelector.tsximports directly. The record's evidence table conflicted, and the merge keeps main's table with this pull request's INV20 row. At run time, its code also reaches six more of those changes:Layer/gestureCounter.ts,utils/clickGuard.ts,utils/touchEndMark.ts,Popover/usePopover.tsx,BottomSheet/BottomSheetPanel.tsxandBottomSheet/useSheetGestures.ts. From 9b5ad42 to f04a3d6, main changed none of its own files or direct imports. At run time its code reached two of those changes:Text/useTruncation.tsandutils/sharedResizeObserver.ts. Before that, from 2025dc7 to 9b5ad42, main changed 26 files that this pull request's code reaches at run time. It imports seven of them directly. They areLayer/layerEntranceSide.ts, which it also changes,Layer/layerAnimations.stylex.ts,Layer/useLayer.tsxandField/InputClearButton.tsx. The others areSelector/useSelectorPresentation.ts,hooks/useMenuPress.tsandutils/themeProps.ts.layerEntranceSide.tsnow also returns the room to a sized trigger, and the merge adds that room to the shared table. Popover's touch growth reads only the side and the meeting point, which are unchanged. No device run has been taken at this head. The red-first runs used main's code at 19eadab, which holds #10771.PopoverTouchMotioncases tap a popover under a finger. On main's build, the two overlap cases fail on the origin in Chromium and WebKit: the growth starts at the top edge. The flipped case passes there too, as it should.LayerSamePresspassing its 9 in each. Every skip is main's:fixmecases inLayerPressTransform, recorded gaps inLayerPanLightDismiss, which runs in Chromium only, and 18 cases main skips in WebKit.uiproject, which CI shards four ways, passes (25240 tests). It holds the shared table and the Layer, Popover and Selector suites.pnpm lint:strict(CI's mode), core's typecheck,pnpm check:knowledge, changesets, and the public-text check pass.stored-docs.test.mjs, one case ran past its 30 s deadline. This pull request changes no CLI code, andpackages/cliis the same at main 36f68b0. In four full runs back to back, alternating this head and main 36f68b0 in one checkout, each gave 13363 passes and that one failure.Writing rubric results
verified_bynames the tests.Public and internal API delta
layerEntranceSide()fromLayer/layerEntranceSide, in place of its own side rule. Usage:const side = layerEntranceSide(surface, source);. Why: one rule for both entrances (architecture:layer-runtimeINV20), so they cannot drift apart.layerEntranceSide.tschanges only its header comment, and Popover's privateclampandEDGEhelpers go away. No module is added.Layer/__tests__/layerEntranceSide.fixture.ts, that both suites read. Each row also gives the room at which the pointer entrance's step stops.