Repository navigation
fix(Selector): the selected row stays on the trigger as the list grows - #10062
Conversation
…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.
…av (spec:AST-094 FR35)
Layer/inputHold holds a layer's pointer input while its presentation
enters or leaves. holdInput(layer, {until, scope}) raises a shield:
'viewport' over the whole viewport while a modal layer enters; 'surface'
over the layer's own box while a non-modal one enters, the page around it
live; 'layer' over the viewport, its content inert, while a layer leaves.
It decides by each event's pointer (a finger's or a pen's press is held to
its end; a mouse passes once it moves with no button down, or from the
start when the page last heard a mouse, DEC-16), never cancels a touch's
start, and cancels a one-finger move so a pinch still zooms (FR10). It
hears input through Core's shared input stream before every other
subscriber, and ends the dispatch for a held event, so press feedback and the
gesture host never hear it; the stream gains first subscribers and records
the type of the latest pointer event it delivers (getLastPointerType). The gesture
host asks the hold for each touch (holdsTouch), so the hold imports nothing
from gestures/ and a component in the root entry may use it statically
(architecture:react-component-runtime INV13).
Its first users hold only under a coarse primary pointer, a touch
presentation (FR13): Dialog, Drawer and MobileNav hold a finger's tap or
drag while they enter (holdEntranceInput, which reads the entrance's own
animations; MobileNav's slide-in is capped at 550 ms), a non-modal Drawer
only on its panel. Under a fine primary pointer nothing is held and
nothing listens (FR24). Where the primary pointer is fine and the screen
also takes touch, a finger is not held yet; AST-094's current-state impact
and Drawer's record name that gap. AST-094's current-state impact also
names the first press of a still mouse after a finger, which lands on an
entering presentation's shield. AlertDialog renders Dialog, so its
entrance is held too: its record says FR7 ships in part, the leaving
alert's inert content waiting for FR6's dismissal.
Every browser proof lands its input at an exact point (an entrance held
where it is, the page's clock, or an exact step of a drag) and plays once.
The WebKit interaction lane's scope includes Layer/inputHold.ts: the
gesture host imports it, so the gesture specs' fixture bundles it.
MobileNav's record states what the rest of the slide-out after the close
does: it is inert, taking no input and hidden from assistive technology
(FR5). A browser case proves both against the open drawer.
From meta#8342 and its per-event offer, meta#8630 (Dialog and Drawer) and meta#8374
(MobileNav).
Co-authored-by: Cindy Zhang <[email protected]>
…s back into it Under a coarse primary pointer, Popover grows out of its trigger on the theme's entrance duration and 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.
…rink 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.
…d, as on iOS While the popover grows out of its trigger under a coarse primary pointer, the layer runtime's input hold takes every touch. A tap outside neither dismisses it nor reaches what is under it, a pan scrolls nothing, and a pinch still zooms the page.
Opening a popover under a finger ran the touch presentation in the opening task. The animator's style writes and the box reads laid the anchored page out more often than a mouse opening does, and on a loaded machine that task could pass the 50 ms long-task line. The opening task now reads and writes nothing while it runs. As it ends, after its own reads, the layer's CSS entrance goes off, a write that costs it no layout. A style read after that task then starts no entrance. The presentation waits for the next animation frame, which runs before it paints. There it puts the element invisible at its full size, reads the boxes, starts the curves and takes the input hold. A close before that frame cancels it and leaves the element as the component styles it, with no compositing layer. A presentation again during a dismissal still starts at once, since it reads nothing. Without animation frames, the presentation runs at once and a close plays the shrink. Popover's record notes, under Current-state impact, that the input hold starts on the first frame after the open, so a touch landing within that frame reaches the page.
…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.
|
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 |
|---|---|---|---|
| Selector | 113.6 kB (+244 B) · 18.7 kB CSS (0) | — | ✗ · ✓ · ✓ |
| SelectorOption | 24.1 kB (0) · 6.7 kB CSS (0) | — | ✗ · ✓ · ✓ |
| richtext/RichTextEditorToolbar | 300.4 kB (+247 B) · 454 B CSS (0) | — | — · — · — |
3 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| PowerSearch | 307.5 kB (+242 B) · 25.6 kB CSS (0) | — | — · — · — |
| Pagination | 124.5 kB (+208 B) · 19.1 kB CSS (0) | — | — · — · — |
| CommandPalette | 78.1 kB (+5 B) · 12.8 kB CSS (0) | — | — · — · — |
Visual changes: 4 snapshots in 1 component
A change is a question for the reviewer, not a failure.
Inheritance checked against the 4 newest reports of other pull requests.
Package size: @astryxdesign/core 7.63 MB packed (+1.5 kB); no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
177f779 to
62e9bc7
Compare
|
/approve-spec 62e9bc7 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the pull request is a draft from a fork. Once it is marked ready for review, a maintainer adds the ci:run label so CI runs.
The translate-based clamp keeps the whole list inside the viewport (544–720px instead of 700–876px in a 720px window), and the mid-viewport overlay and the public API are unchanged. Non-blocking suggestions:
- In
SelectorOverlayViewport.a11y.chromium.spec.ts, assert the clamped position (list bottom at 720) as well as the bounds, so a shift that ignored the flip would fail the spec. - The clamp still uses the raw viewport edges, as it already did at the top. A follow-up could keep the layer runtime's gutter and any
LayerProviderinset at both edges. - Two new source comments run long. Inline suggestions trim them to the reason alone.
[Automated review]
62e9bc7 to
a8b0c2b
Compare
There was a problem hiding this comment.
Changes requested. The translate-based clamp keeps the whole list inside the viewport when a default Selector opens at the bottom of the window (544–720px instead of 700–876px in a 720px window), but the shift goes stale when the list later moves to the other side of the trigger.
- Miss: after the viewport shrinks with the list open (Pre Selected opened at 720px, window shrunk to 330px), the layer flips above the trigger while the measured
translate: 0 -69pxstays, so the list moves to −44–92px and the selected row sits 143px above the trigger, wheremainkeeps it over the trigger; re-measuring the shift on viewport resize (hooks.ts:159-161) and adding a Chromium case that shrinks the viewport with the list open would fix it.
Non-blocking: two new comments run long (inline suggestions), and the clamp still ignores the runtime's 16px viewport gutter, as it already did at the top edge. CI has not run on this draft head yet.
[Automated review]
a8b0c2b to
a710866
Compare
a710866 to
17fddbf
Compare
There was a problem hiding this comment.
Changes requested. The translate-based clamp keeps the whole list inside the viewport when a default Selector opens at the bottom of the window (544–720px instead of 700–876px in a 720px window), and the shift now follows a viewport resize, but one change of side is still missed.
- Miss: when the trigger moves on screen without resizing while the list is open (220px of content added above it), the layer flips above the trigger but keeps
translate: 0 -89px, so the selected row sits about 209px above the trigger wheremainkeeps it over the trigger; re-measuring on every change that re-settles the layer, by subscribing through the layer runtime's own observer inuseLayer.tsx(observeAnchorClearance, which already follows same-size anchor moves withobserveMove) instead of the partial observer set athooks.ts:129-141, plus a Chromium case that moves the trigger in layout with the list open, would fix it.
Non-blocking: three new comments could be tightened (inline suggestions). CI has not run on this draft head yet.
[Automated review]
17fddbf to
2493d0a
Compare
There was a problem hiding this comment.
Changes requested. The translate-based clamp keeps the whole list inside the viewport when a default Selector opens at the bottom of the window (544–720px instead of 700–876px in a 720px window), and the list follows a viewport resize and a same-size trigger move, but a page scroll still throws it off.
- Scrolling the page with the list open re-measures the shift from the
offsetTopchain (hooks.ts:205), which leaves out the scroll adjustment anchor positioning applies, so a 150px wheel scroll movestranslatefrom0 -69pxto0 -219pxand leaves the selected row about 150px above its trigger; reading the laid-out top from the popover's box with only its owntranslateandtransformundone (asuntransforminuseLayer.tsxdoes), plus a Chromium case that scrolls the page with the list open, would fix it.
Non-blocking: the fourth Chromium case's title says more than it tests. CI has not run on this draft head yet.
[Automated review]
…s 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.
|
/approve-spec 5f7cd6d |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because every CI job skips a draft; it runs once the pull request is marked ready for review, and it must pass before merge.
The latest push only merges main, and the fix holds after it. In Pre Selected, a first option grown to 96 px leaves the selected row 63 px off the trigger on main and 1 px off here; near the viewport's end the grown list stops at the 16 px gutter instead of running to 824 px in a 720 px viewport, and all 77 Selector browser tests pass in Chromium. The phone results in the description were taken before this merge, which changes the shared Layer/useLayer.tsx, so they do not carry to this head; no requirement this change touches asks for them.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (1): "Whatever the scope, these are computed over the whole pull request" (re-review rule counting). Checked: the recipe change and this review's mode; no finding.
- Changeset: an option that grows while an open list is shorter than its height cap keeps the selected row on the trigger. Verified: 63 px off on
main, 1 px here; the growth proof fails onmainand passes here. - Changeset: the overlay measured only when the list opened, so a grown row left the trigger and a list near the viewport's end grew past it. Verified on
main: 63 px off; the list runs to 824 px in a 720 px viewport. - Changeset: the overlay measures again when the open list resizes, before that frame paints. Verified in code (
hooks.ts:266-276) and by the painted-frame proof. - Changeset and description: no public or internal API change; the overlay hook keeps its options and return. Verified: the built Core, build and theme surfaces compare with 0 rows changed.
- Description: mid-viewport, a grown first option leaves the row 63 px off; near the end the grown list runs past the viewport and its last options cannot be reached. Verified on
main. - Description: near the end the browser flips the grown list, and the swapped margin moves it further down. Verified on
main: the flipped list sits at 624–824 px. - Description: the list's resize report runs the same measurement and commits before paint. Verified.
- Description: at the open the overlay keeps
main's margin, so the layer opens below its anchor, where the runtime caps it above a keyboard. Verified in code (hooks.ts:309-318) and by the keyboard cases. - Description: a layer flipped while open keeps that side, and its margin keeps the clamped top or lifts the list's end above a keyboard, as far as the top gutter allows. Verified: the near-end list ends at 704 px, and the flip-then-grow keyboard case passes.
- Description: a list at its height cap does not resize, so its row still moves, as on
main. Verified in code: only the list's own box is observed. - Description: the quoted Selector and layer-runtime requirements. Verified against the current records.
- Description: the flip is read from the computed position area, which is empty without anchor positioning. Verified in code (
hooks.ts:150-156) and by the no-anchor proof. - Description: no other subscriber of the shared resize observer watches the list. Verified: the layer runtime observes the anchor, and its own clearance observer serves only layers that keep their anchor clear.
- Description: both growth proofs fail on
mainand all three pass here, in Chromium and WebKit. Verified in Chromium at this head; WebKit was not run in this review. - Description: two browser specs, five keyboard-inset cases and a unit case. Present; all pass here in Chromium.
- Description: the gates and the full unit, accessibility-runner and interaction counts ran at earlier commits. Not reproduced in full; Selector's unit file (252 tests) and all 77 Selector browser tests pass at this head.
- Description: strict ESLint and core TypeScript give 0 errors, and the knowledge, changeset and pre-review checks pass. Core's TypeScript build passes at this head; the other checks were not re-run, and the changed files are identical to the last reviewed revision.
- Description: the earlier merge's import-graph notes, and the previous merge of
mainchanging none of this pull request's files. The merge claim holds, and the latest merge also changes none of its files; the import-graph notes were not reproduced. - Description: the near-end, flip-then-grow and landscape keyboard cases. Verified in Chromium at this head; on
mainthe flip-then-grow list runs to 1042–1242 px, as stated; earlier-commit numbers are taken from the description. - Description item 9: the phone story follows Overlay Beside Keyboard's layout with nine options, and its spec pins the field 300 px above the end and keeps the list at full height beside a 291 px keyboard. Verified in the story, the spec and its Chromium run.
- Description item 9: the Android emulator and iPhone results, left pending under the evidence-carry rule. Taken from the description; they were recorded before this merge, which changes a shared layer module, so they do not carry to this head; no requirement this change touches asks for them.
- Description: each open measures twice. Verified in code.
- Description: an engine without anchor positioning no longer crashes, and no open warns about a flush. Verified by the no-anchor proof and the unit case.
- Description: a flipped list taller than the room above a later keyboard can sit under it, and a landscape pan problem, each tracked in an open issue. Verified: both issues are open.
- Description: the growth spec waits for entrance animations to end. Verified.
- Description: the first version's two dropped proofs. Consistent with the code: neither remains.
- Description: +825/−19 lines in 7 files (source +80/−14, tests +694/−5, story +44, changeset +7). Verified.
- Description: Selector's eager import grows by 258 B gzip as default behavior, outside the optional-feature budget. Not re-measured; the shipped code is unchanged since it was measured, and the budget covers only optional features.
- Story doc: the trigger sits where Overlay Beside Keyboard's does, and nine options make the list rise above a keyboard. Verified in the story's code.
packages/core/src/Selector/hooks.ts: clear.packages/core/src/Selector/__tests__/SelectorOverlayGrowth.a11y.browser.spec.ts: clear.packages/core/src/Selector/__tests__/SelectorKeyboardInset.a11y.chromium.spec.ts: clear.packages/core/src/Selector/__tests__/SelectorFlippedOverlayKeyboard.a11y.browser.spec.ts: clear.packages/core/src/Selector/Selector.test.tsx: clear.apps/storybook/stories/Selector.stories.tsx: clear..changeset/selector-overlay-growth.md: clear.
|
/approve-spec ce0df87 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because every CI job skips a draft; it runs once the pull request is marked ready for review, and it must pass before merge.
The latest push only merges main, and the fix holds after it. In Pre Selected, a first option grown to 96 px leaves the selected row 63 px off the trigger on the base and 1 px off here; near the viewport's end the grown list stops at the 16 px gutter instead of running to 824 px in a 720 px viewport, and all 90 Selector browser tests pass in Chromium. The phone results in the description were taken before this merge, which changes the shared Layer/useLayer.tsx, so they do not carry to this head; no requirement this change touches asks for them.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none.
- Changeset: when an option grows while an open list is shorter than its height cap, the selected row stays on the trigger. Verified: 63 px off on the base, 1 px here; the growth proof fails on the base and passes here.
- Changeset: the overlay measured only when the list opened, so a grown row left the trigger and a list near the viewport's end grew past it. Verified on the base: 63 px off; the list runs to 824 px in a 720 px viewport.
- Changeset and description: the overlay measures again when the open list resizes, before that frame paints, with no API change, and the internal overlay hook keeps its options and return. Verified in code (
hooks.ts:250-342), by the painted-frame proof, and by the API surface comparison (0 rows). - Description: mid-viewport a grown first option leaves the row 63 px off; near the end the grown list runs past the viewport and its last options cannot be reached. Verified on the base.
- Description: near the end the browser flips the grown list, and the swapped margin moves it further down. Verified on the base: the flipped list sits at 624–824 px.
- Description: the list's resize report runs the same measurement and commits before paint. Verified.
- Description: at the open the overlay keeps the base's margin, so the layer opens below its anchor, where the keyboard cap applies; a layer flipped while open keeps that side, its top at the clamped top or its end above a keyboard, below the top gutter. Verified in code (
hooks.ts:301-318) and by the keyboard cases. - Description: a list at its height cap does not resize, so its row still moves as before. Verified in code: only the list's own box is observed.
- Description: the quoted Selector and layer-runtime requirements. Verified against the current records.
- Description: the flip is read from the computed position area, which is empty without anchor positioning. Verified in code (
hooks.ts:153-156) and by the no-anchor proof. - Description: no other subscriber of the shared resize observer watches the list. Verified: the layer runtime observes the anchor.
- Description: both growth proofs fail on the base and all three pass here, in Chromium and WebKit. Verified in Chromium at this head; WebKit was not run.
- Description: two browser specs, five keyboard-inset cases and a unit case. Present; all pass here in Chromium.
- Description: the existing unit case for an already flipped layer now also mocks the flipped position area and keeps its expectation. Verified in
Selector.test.tsx:648-681; it passes. - Description: the full unit, accessibility-runner and interaction counts, the lint, type, knowledge, changeset and pre-review gates, and the import-graph notes, all from an earlier commit. Not reproduced in full; Selector's unit file (261 tests), all 90 Selector browser specs and Core's TypeScript build pass at this head.
- Description: the near-end, flip-then-grow and landscape keyboard cases, and the phone story whose spec pins the field 300 px above the end and keeps the list at full height beside a 291 px keyboard. Verified in Chromium at this head; on the base the flip-then-grow list runs to 1042–1242 px, as stated.
- Description: the Android emulator and iPhone results. Taken from the description; they were recorded before this merge, which changes a shared layer module, so they do not carry to this head, and no requirement this change touches asks for them.
- Description: each open measures twice. Verified in code.
- Description: an engine without anchor positioning no longer crashes, and no open warns about a flush. Verified by the no-anchor proof and the unit case.
- Description: a flipped list taller than the room above a later keyboard can sit under it, tracked in an open issue. Verified: the issue is open.
- Description: the growth spec waits for entrance animations to end, and the first version's two proofs are gone. Verified.
- Description: +825/−19 lines in 7 files (source +80/−14, tests +694/−5, story +44, changeset +7). Verified.
- Description: Selector's eager import grows by 265 B gzip as default behavior, outside the optional-feature budget. Not re-measured; the shipped code is unchanged since it was measured, and the size rule places default behavior outside it.
- Story doc: nine options, the trigger where Overlay Beside Keyboard's sits, and the list ends above the keyboard. Verified in the story's code and its spec run.
packages/core/src/Selector/hooks.ts: clear.packages/core/src/Selector/__tests__/SelectorOverlayGrowth.a11y.browser.spec.ts: clear.packages/core/src/Selector/__tests__/SelectorKeyboardInset.a11y.chromium.spec.ts: clear.packages/core/src/Selector/__tests__/SelectorFlippedOverlayKeyboard.a11y.browser.spec.ts: clear.packages/core/src/Selector/Selector.test.tsx: clear.apps/storybook/stories/Selector.stories.tsx: clear..changeset/selector-overlay-growth.md: clear.
|
/approve-spec f893450 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because every CI job skips a draft; it runs once the pull request is marked ready for review, and it must pass before merge.
The latest push only merges main, which changes none of this pull request's files, so the earlier approval carries forward with the patch unchanged. In Pre Selected, a first option grown to 96 px leaves the selected row 63 px off the trigger on the base and 1 px off here; near the viewport's end the grown list stops at the 16 px gutter instead of running to 824 px in a 720 px viewport, and all 90 Selector browser tests pass in Chromium. The phone results in the description were taken before the merges of main that change the shared Layer/useLayer.tsx, so they do not carry to this head; no requirement this change touches asks for them.
Claims and files checked
Review mode: carry-forward; reason: none
- Changeset: when an option grows while an open list is shorter than its height cap, the selected row stays on the trigger. Verified: 63 px off on the base, 1 px here; the growth proof fails on the base and passes here.
- Changeset: the overlay measured only when the list opened, so a grown row left the trigger and a list near the viewport's end grew past it. Verified on the base: 63 px off; the list runs to 824 px in a 720 px viewport.
- Changeset and description: the overlay measures again when the open list resizes, before that frame paints, with no API change, and the internal overlay hook keeps its options and return. Verified in code (
hooks.ts:250-342), by the painted-frame proof, and by the API surface comparison (0 rows). - Description: mid-viewport a grown first option leaves the row 63 px off; near the end the grown list runs past the viewport and its last options cannot be reached. Verified on the base.
- Description: near the end the browser flips the grown list, and the swapped margin moves it further down. Verified on the base: the flipped list sits at 624–824 px.
- Description: the list's resize report runs the same measurement and commits before paint. Verified.
- Description: at the open the overlay keeps the base's margin, so the layer opens below its anchor, where the keyboard cap applies; a layer flipped while open keeps that side, its top at the clamped top or its end above a keyboard, below the top gutter. Verified in code (
hooks.ts:301-318) and by the keyboard cases. - Description: a list at its height cap does not resize, so its row still moves as before. Verified in code: only the list's own box is observed.
- Description: the quoted Selector and layer-runtime requirements. Verified against the current records.
- Description: the flip is read from the computed position area, which is empty without anchor positioning. Verified in code (
hooks.ts:153-156) and by the no-anchor proof. - Description: no other subscriber of the shared resize observer watches the list. Verified: the layer runtime observes the anchor.
- Description: both growth proofs fail on the base and all three pass here, in Chromium and WebKit. Verified in Chromium with this patch; WebKit was not run.
- Description: two browser specs, five keyboard-inset cases and a unit case. Present; all pass here in Chromium.
- Description: the existing unit case for an already flipped layer now also mocks the flipped position area and keeps its expectation. Verified in
Selector.test.tsx:648-681; it passes. - Description: the full unit, accessibility-runner and interaction counts, the lint, type, knowledge, changeset and pre-review gates, and the import-graph notes, all from an earlier commit. Not reproduced in full; Selector's unit file (261 tests), all 90 Selector browser specs and Core's TypeScript build pass with this patch.
- Description: the near-end, flip-then-grow and landscape keyboard cases, and the phone story whose spec pins the field 300 px above the end and keeps the list at full height beside a 291 px keyboard. Verified in Chromium with this patch; on the base the flip-then-grow list runs to 1042–1242 px, as stated.
- Description: the Android emulator and iPhone results. Taken from the description; they were recorded before merges of
mainthat change a shared layer module, so they do not carry to this head, and no requirement this change touches asks for them. - Description: each open measures twice. Verified in code.
- Description: an engine without anchor positioning no longer crashes, and no open warns about a flush. Verified by the no-anchor proof and the unit case.
- Description: a flipped list taller than the room above a later keyboard can sit under it, tracked in an open issue. Verified: the issue is open.
- Description: the growth spec waits for entrance animations to end, and the first version's two proofs are gone. Verified.
- Description: +825/−19 lines in 7 files (source +80/−14, tests +694/−5, story +44, changeset +7). Verified.
- Description: Selector's eager import grows by 265 B gzip as default behavior, outside the optional-feature budget. Not re-measured; the shipped code is unchanged since it was measured, and the size rule places default behavior outside it.
- Story doc: nine options, the trigger where Overlay Beside Keyboard's sits, and the list ends above the keyboard. Verified in the story's code and its spec run.
packages/core/src/Selector/hooks.ts: clear.packages/core/src/Selector/__tests__/SelectorOverlayGrowth.a11y.browser.spec.ts: clear.packages/core/src/Selector/__tests__/SelectorKeyboardInset.a11y.chromium.spec.ts: clear.packages/core/src/Selector/__tests__/SelectorFlippedOverlayKeyboard.a11y.browser.spec.ts: clear.packages/core/src/Selector/Selector.test.tsx: clear.apps/storybook/stories/Selector.stories.tsx: clear..changeset/selector-overlay-growth.md: clear.
FR2's verification row now names the case no emulator scene can set up: Android landscape with the keyboard up leaves 67 px visible and 40 px of scroll, at this head and on main alike.
|
/approve-spec 83c4415 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because every CI job skips a draft; it runs once the pull request is marked ready for review, and it must pass before merge.
In Pre Selected, a first option grown to 96 px leaves the selected row 63 px off the trigger on the base and 1 px off here, and near the viewport's end the grown list stops at the 16 px gutter instead of running to 824 px in a 720 px viewport. All 90 Selector browser tests pass in Chromium, and the new growth and keyboard proofs fail against the base. Two small text fixes are worth making before merge:
- The new FR2 verification row ends "; the same at main", which describes this branch rather than the system and reads wrongly once merged, and the description lacks the
## Writing rubric resultssection the contribution guide asks of a pull request that changes a record. - Testing item 9 still says the Android landscape check is pending a fix to its test, while the new record row says the emulator scene cannot set that case up, so the two should agree.
Claims and files checked
Review mode: full; reason: spec-record
- Changeset: when an option grows while the open list is under its height cap, the selected row stays on the trigger. Verified: 63 px off on the base, 1 px here; the growth proof fails on the base and passes here.
- Changeset: the overlay measured only at the open, so a grown row left the trigger and a list near the viewport's end grew past it. Verified on the base: 63 px off; the grown list runs to 824 px in a 720 px viewport.
- Changeset and description: the overlay measures again when the open list resizes, before that frame paints, with no public or internal API change. Verified in the hook's code, by the painted-frame proof (no frame over 2 px off), and by the API surface comparison (0 rows).
- Description: mid-viewport a grown first option leaves the row 63 px off; near the end the grown list runs past the viewport and its last options cannot be reached. Verified on the base.
- Description: near the end the browser flips the grown list, and the swapped margin moves it further down. Verified on the base: the flipped list sits at 624–824 px.
- Description: at the open the overlay keeps the base's margin, so the layer opens below its anchor; a layer flipped while open keeps that side, its top at the clamped top or its end above a keyboard, below the top gutter. Verified in code and by the keyboard cases.
- Description: a list at its height cap does not resize, so its row still moves as before. Verified in code: only the list's own box is observed.
- Description: the quoted Selector and layer-runtime requirements. Verified against the current records.
- Description: the flip is read from the computed position area, which is empty without anchor positioning. Verified in code and by the no-anchor proof.
- Description: no other subscriber of the shared resize observer watches the list. Verified: the layer runtime observes the anchor.
- Description: both growth proofs fail on the base and all three pass here, in Chromium and WebKit. Verified in Chromium; WebKit was not run.
- Description: two browser specs, five keyboard-inset cases and a unit case. Present; all pass here in Chromium.
- Description: the existing unit case for an already flipped layer now also mocks the flipped position area and keeps its expectation. Verified; it passes with the base's hook and this one.
- Description: the full unit, accessibility-runner and interaction counts and the lint, type, knowledge, changeset and pre-review gates, taken at an earlier commit. Not reproduced in full; Selector's unit file (261 tests), all 90 Selector browser specs, the knowledge check and Core's build pass at this head.
- Description: the merges of main change none of this pull request's files, and the import-graph notes. The first is verified; the import-graph detail was not reproduced.
- Description: the near-end, flip-then-grow and landscape keyboard cases, and the phone story whose spec keeps the list at full height beside a 291 px keyboard. Verified in Chromium; on the base the flip-then-grow list runs to 1,042–1,242 px, as stated.
- Description: the Android emulator and iPhone results. Taken from the description; they were recorded before a merge of main that changes a shared layer module, so they do not carry to this head, and no requirement this change touches asks for them. The landscape line disagrees with the new record row (non-blocking note above).
- Description: each open measures twice. Verified in code.
- Description: an engine without anchor positioning no longer crashes, and no open warns about a flush. Verified by the no-anchor proof and the unit case.
- Description: a flipped list taller than the room above a later keyboard can sit under it, tracked in an open issue. Verified: the issue is open.
- Description: the growth spec waits for entrance animations to end, and the first version's two proofs are gone. Verified.
- Description: the line counts, measured over an earlier range. Accurate for that range; at this head the change is 826 added and 20 deleted lines in 8 files, the record line included.
- Description: Selector's eager import grows by 265 B gzip as default behavior. Consistent: a page that renders only Selector grows by 268 B gzip here, and the four reference pages do not change.
- Story doc: nine options, the trigger where Overlay Beside Keyboard's sits, and the list ends above the keyboard. Verified in the story's code and its spec run.
- Record: Android landscape with the keyboard up is not evidenced, because the emulator scene cannot set it up. Taken from the pull request's text (emulator evidence).
packages/core/src/Selector/hooks.ts: clear.packages/core/src/Selector/__tests__/SelectorOverlayGrowth.a11y.browser.spec.ts: clear.packages/core/src/Selector/__tests__/SelectorKeyboardInset.a11y.chromium.spec.ts: clear.packages/core/src/Selector/__tests__/SelectorFlippedOverlayKeyboard.a11y.browser.spec.ts: clear.packages/core/src/Selector/Selector.test.tsx: clear.apps/storybook/stories/Selector.stories.tsx: clear.docs/specs/components/Selector/Selector.spec.md: non-blocking wording note..changeset/selector-overlay-growth.md: clear.
| | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | | ||
| | FR1, AR2, AR3 | `Selector.test.tsx` selection, focus, and keyboard suites, including "leaves focus on the field a press moved it to" and "returns focus to the trigger when the press lands on nothing focusable" | closed/open, search/non-search, disabled option | Removing selection wiring, focus movement, or keyboard behavior fails the named interaction tests | `audit:Selector/behavior` | | ||
| | FR2 | placement and selected-item geometry tests; `SelectorKeyboardInset.a11y.chromium.spec.ts` | default, explicit, RTL, transformed entry, keyboard up | Using the wrong positioning model fails the expected position-area or margin | `audit:Selector/behavior` | | ||
| | FR2 | placement and selected-item geometry tests; `SelectorKeyboardInset.a11y.chromium.spec.ts`; Android landscape with the keyboard up not evidenced: the emulator scene leaves 67 px visible and 40 px of scroll, so the case can't be set up; the same at main | default, explicit, RTL, transformed entry, keyboard up | Using the wrong positioning model fails the expected position-area or margin | `audit:Selector/behavior` | |
There was a problem hiding this comment.
Non-blocking: "; the same at main" describes this branch, not the system, and reads wrongly once the change is on main. Suggested ending for the cell: Android landscape with the keyboard up is not evidenced: the emulator scene leaves 67 px visible and 40 px of scroll, so the case cannot be set up. The description also needs its ## Writing rubric results section for this record edit.












User impact
A default
Selector(noplacement, no search) whose open list grows, as when a late web font makes an option taller.Problem and solution fit
The overlay measured its margin only when the list opened. Near the viewport's end, the grown list overflowed and the browser flipped the layer above its anchor. The flip swaps the block margins, so the old margin moved the list further down.
Now the open listbox's resize report runs the same measurement and commits before the frame paints. At the open, the overlay keeps main's margin, so the layer opens below its anchor, where the runtime caps it above a keyboard. A layer the browser flips while the list is open keeps that side. Its margin keeps the same clamped top, or lifts the list's end above a keyboard, as far as the top gutter allows.
A list at its height cap does not resize when an option grows, so there the row still moves, as on main.
Expected behavior and authority
component:SelectorFR2: "a non-search popover aligns the selected row over the trigger and clamps it to the viewport, above any software keyboard".architecture:layer-runtime: "Every anchored placement can flip across either axis", so the layer keeps its fallbacks.Smallest restoration
Selector/hooks.ts: one resize observation of the open listbox, and the margin for a flipped layer.getPropertyValue('position-area'), empty without anchor positioning.observeResizeAfterLayoutobserves the listbox. No other subscriber of that shared observer watches it.Evidence
SelectorKeyboardInsetcases, and aSelector.test.tsxcase.Scope
Components: Selector
Testing
Gates at
f8934508dd, on main694962babf, unless an item names another head. This head adds only the record line, wherepnpm check:knowledgepasses.Selector › Pre Selectedand open the list. Then rundocument.querySelector('[role="option"]').style.minHeight = '96px': the selected row stays on the trigger.5f7cd6d751,SelectorOverlayGrowth.a11y.browser.spec.ts, 5 runs: all three proofs pass in Chromium and in WebKit (CI's container, 1 worker). With main'shooks.ts, both growth proofs fail 3 of 3 in each engine. Here this pull request's three specs pass in both engines, 22 tests each.pnpm exec vitest run --project ui: 25,954 tests pass in 1,043 files. Main's unit case for an already flipped layer put the 16 px gutter in the block-start margin and expected the overlay 16 px higher. Its layer'sposition-areastill named the side below the anchor, a pair a flip never produces: it moves both together. The case now mocks the flippedposition-areatoo, and still expects the overlay 16 px higher, so no behavior is dropped.ce0df873f1, CI's accessibility runner, on the 38 specs its dry run routes for this change: 236 tests pass.tscgive 0 errors.pnpm check:knowledgeand changeset coverage pass, andpnpm review:prehas 0 findings.f8934508ddmerges main694962babf. This pull request's own diff is byte-identical to5f7cd6d751's. The device set in item 9 ran at this head.SelectorKeyboardInset's two new cases fix the field 8 px above the viewport's end, beside its 300 px stand-in keyboard. At448aed5eedthe list ended at 692–828 px, under the keyboard's line at 534 px, 3 of 3 in each engine. Here and on main both pass 3 of 3 in each engine. Two more open the nine-option story at 844×390, its field 8 px from the end, beside a 200 px keyboard. At051a2f366fthe list stayed at 54–350 px, under the keyboard's line at 180 px, 3 of 3 in each engine. Here it shrinks into the room from 0 to 180 px, fills it to within a row, and scrolls, 3 of 3 in each engine. Main'shooks.ts, run with this story, passes too. A fifth case fixes the field 8 px from the end at 390×844. A grown option flips the list, the keyboard rises, and another option grows. At4db8f6acb5the list stopped at 270–558 px, past the line at 534 px, 3 of 3 in each engine. Here it passes 3 of 3 in each engine. With main'shooks.tsthe list runs off screen, at 1042–1242 px, 3 of 3 in each engine. The spec's.chromium.spec.tsname keeps it to Chromium in CI. WebKit ran an untracked copy of it, renamed to.browser.spec.tsand otherwise identical.Selector › Flipped Overlay Beside Keyboardfollows main's Overlay Beside Keyboard layout, with nine options.SelectorFlippedOverlayKeyboard.a11y.browser.spec.tsfixes the field 300 px above the viewport's end itself. It then opens the story beside a 291 px stand-in keyboard. The list must end above the keyboard at its height without one. At448aed5eedit was 258 px tall instead of 296. A first version of this fix squeezed it to 30 px, one row, which the browser spec pins. Here and on main it passes 3 of 3 in each engine. With a 336 px keyboard the list also keeps its height, 3 of 3 in each engine. This pull request adds the story, so its runs at older heads and on main pair theirhooks.tswith it.694962babf, an Android 16 emulator (Chrome 133, Gboard) ran each check, asspec:AST-094DEC-27 asks (test data). Each ran at normal speed, with the CPU slowed 4×, and with animations removed and Reduce Motion on. Between runs the rig reset the keyboard, the same at both builds.cc7bc2e033, an engine without anchor positioning crashed on open (3 of 3), and each open warned aboutflushSync. The growth spec's no-anchor proof and aSelector.test.tsxcase now cover both.A list the browser flips above its trigger while open can sit partly under a keyboard that rises later. That happens when the list is taller than the room above it. Issue #11725 tracks a cap on the flipped list's block size.
One full Chromium run saw a growth proof's painted frame 2.12 px off (bound 2). The cases had changed the list while its entrance animations still ran. The spec now waits for them to end. After that: Chromium ×20, 60 of 60; WebKit ×10, 30 of 30; the full Selector accessibility run twice, 69 of 69.
This branch's first version, a layer with no fallbacks plus two record edits, is gone under the layer runtime's flip rule. Main's end gutter now covers its first case. Two of its proofs are dropped:
Writing rubric results
R1 narration: none; the added line states the gap in the present tense.
R2 research: none in the record.
R3 evidence: the line records an evidence gap under
spec:AST-094DEC-27.R4 rejected alternatives: none added.
R5 change references: none.
R6 open questions: none touched.
R7 project status: none.
Public and internal API delta
useSelectedItemOverlayMarginkeeps its options and return.694962babf..83c44150d1), in 8 files: source +80/−14, tests +694/−5, story +44, changeset +7, record +1/−1.analyze-pr.js) measured both atce0df873f1against main120629d82a. The growth is default behavior, soarchitecture:component-import-boundariesINV10's optional-feature budget does not apply (DEC-5).