Repository navigation
Conversation
…essed A Selector list that opens on a press release measured the trigger while its press scale was still returning, and settled a third of a pixel low. Measure the trigger's block edges without its own transform. Add browser cases for architecture:layer-runtime INV22 across Popover, DropdownMenu, Selector, MultiSelector, ComplexSelector and ContextMenu. The cases for gaps that need a structural decision are test.fixme.
|
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.3 kB (0) · 20 B CSS (0) | — | ✓ · ✓ · ✗ |
| layer | — | — | — · ✓ · — |
| Layer | — | — | ✓ · ✓ · — |
Package size: no published package changed; no new dependencies.
API changes: none in this pull request
Committed API report behind this build: cli 36 rows, core 36 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.
Requesting changes: the Selector fix itself is right (a list opened by a press now lands where a keyboard open puts it, and the new unit case fails on main and passes here), but two things need to change.
- The title says layers keep their place and size while their trigger is pressed, but only the Selector press-open path changes and four layer cases stay
test.fixme, so please retitle it to the Selector fix the changeset describes. getUntransformedBlockEdgesinpackages/core/src/Selector/hooks.tsre-implements the untransform thatpackages/core/src/Layer/settledBox.tsalready owns, and it misses that helper'stranslate/scalehandling and 1/64 px grid snap, so please extend the shared helper for an anchor box and call it instead.
The browser spec names INV22, which is not on main yet, so it should land after #11024.
[Automated review]
There was a problem hiding this comment.
Requesting changes: a Selector list opened by a press now lands where a keyboard open puts it, and the new unit case fails on main and passes here, but the way the fix gets there and the title need to change.
- Newly live check: the Selector list still anchors to the control the press scales (
styles.triggerGhostandstyles.triggerSecondaryinSelector.tsxscale the anchor element itself), andgetUntransformedBlockEdgesinSelector/hooks.tsun-scales that anchor in script to compensate, whicharchitecture:layer-runtimeINV22 rules out; please keep the anchor unscaled, with the press scale on an inner visual or the list anchored to a stable wrapper as Popover does, and measure it with a plaingetBoundingClientRect. getUntransformedBlockEdgesalso re-implements the untransform thatLayer/settledBox.tsowns, without its 1/64 px grid snap or itstranslate/scalehandling, so the press-opened list still lands at 347.016 px instead of 347 px; the fix above lets you delete it, and otherwise please extend the shared helper and call it.- The title says layers keep their place and size while their trigger is pressed, but only Selector's press-open path changes and four layer cases stay
test.fixme, so please retitle it to the Selector fix the changeset describes.
[Automated review]
|
/approve-spec ae0c4ca |
Remove the Selector placement change, its unit test and its changeset: measuring around the press scale in script is not a valid INV22 fix. The ghost and secondary Selector browser cases are test.fixme like the other structural gaps, and the layer-runtime gap entry names them. The first-frame read now waits on its frame, and the finger case waits until the trigger, not the growing popover, is under the point.
|
/approve-spec 94c746c |
There was a problem hiding this comment.
Requesting changes: in Chromium the four committed INV22 cases pass and each test.fixme case fails by the offset the description reports. WebKit fails one committed case, and the record repeats the Chromium-only result.
- Miss: "the press that opens a DropdownMenu places the menu from the unpressed trigger" (
LayerPressTransform.interaction.browser.spec.ts:224) fails in WebKit, where a mouse press gives the trigger its 0.98:activescale and the menu opens about 1 px off and 2 px narrower, so thepr-interaction-webkitlane will fail once heavy CI runs; mark the WebKit run as an INV22 gap (for exampletest.fixme(browserName === 'webkit', …)). - Miss:
docs/architecture/layer-runtime.md:669-671says a mouse press on a DropdownMenu trigger does not scale it and keeps the menu in place, which holds in Chromium but not in WebKit; limit the sentence to Chromium and list WebKit's mouse press in the DropdownMenu gap.
The inline comments cover the smaller, non-blocking points: the verification row's fixme sentence, the spec's @output header, and the fixme ghost Selector finger case, which opens nothing in WebKit.
[Automated review]
In WebKit a mouse press keeps :active on the DropdownMenu trigger, so the menu that press opens sits off the unpressed box. The case is fixme there, and the layer-runtime gap entry limits the unscaled mouse press to Chromium. The ghost Selector finger case runs in Chromium only, and the spec header and verification row no longer state test status.
|
/approve-spec 368b5a1 |
There was a problem hiding this comment.
Approved pending CI: CI has not finished on this head yet.
The two blocking points raised earlier are fixed: the DropdownMenu mouse case is now test.fixme in WebKit only, and the INV22 gap entry in docs/architecture/layer-runtime.md states the Chromium and WebKit behavior separately. The committed spec passes in both engines (Chromium 4 cases, WebKit 3), and each INV22: fixme case fails today by the offset the description reports, so each can be turned on when its fix lands.
[Automated review]
Maintainer impact
architecture:layer-runtimeINV22 says a layer never inherits its trigger's press transform. Its verification row asked for browser cases that were not built. Without them, a reviewer cannot see which layers keep their place during a press, and a regression in the layers that do comply goes unnoticed.Intended invariant
architecture:layer-runtimeINV22 (spec:AST-059DEC-10, recorded in #11024): "A layer never inherits its trigger's press transform. Press feedback scales only the trigger's own visual; a layer renders outside that scaled subtree and anchors to the trigger's untransformed box."Change
Layer/__tests__/LayerPressTransform.interaction.browser.spec.ts: one browser case for each layer that opens from a pressable trigger, by mouse and by finger. During and after a press, it compares the open layer's rectangle, layout box and computed transform with an open that no press touched. For a layer that opens on the press, it also checks the first frame.mainaretest.fixmewith anINV22:title, so they can be turned on when their fix lands. The ghost Selector finger case runs in Chromium only, because Playwright's WebKit makes no click from a raw touch press and lift.docs/architecture/layer-runtime.md: the spec is inverified_byand in INV22's verification row. The INV22 gap entry lists the layers that fail today, Selector included.Evidence
main(Chromium):main, marked fixme, with the measured offset::activeon the trigger, so it scales to 0.98, and the menu opens about 1 px off and 2 px narrower. The case istest.fixmein WebKit only.anchorRefto a Button: the popover moves 1.2 px while the Button is held. A render-prop trigger takes the same path.In all of these gaps, the anchor is the press-scaled control itself, or a measurement of it. Measuring around the press scale in script is not a valid fix under INV22. A fix needs a structural choice, which is pending the owner's decision PS: (A) a trigger shows no press scale while its own layer is open, (B) an inner visual scales, or (C) the offset is accepted. The DropdownMenu finger case has its own fix in progress: an untransformed anchor wrapper like Popover's.
Scope
Components: Layer
Testing
pnpm test:interaction --project chromium LayerPressTransform.interaction.browser.spec.ts(one worker, fresh Storybook build): 4 passed and 7 fixme. Each fixme case was also run as a plain test onmainand fails. I ran it locally in Chromium only, because WebKit could not start on the test host. The WebKit results come from the automated review's run.pnpm check:knowledge;pnpm specs:for --diff origin/main.Writing rubric results
Record:
docs/architecture/layer-runtime.md(the INV22 gap entry, the INV22 verification row,verified_by).