Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Hi @sunven! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Changes requested — one evidence gap, no code defect.
The filter itself holds up at this revision: the new unit regression and the new Chromium browser regression both fail against main's implementation and pass here, the revealed control still stops 4 px short of its neighbour and takes its tap, and the existing hit-area suite stays green at 63 tests.
packages/core/src/utils/hitArea.tsis imported by five component folders, so a pull request that grows it reports the first-load gzip delta on the four reference pages (docs, form, menu, table), base against head, underarchitecture:component-import-boundariesINV10; the Evidence section gives an isolatedhitArea.tsbundle instead and notes itself that it is not an application measurement. Runpnpm size:pages --base origin/mainand put its table in the Evidence section — this review measured +0, +30, +26 and +24 bytes gzip, all inside INV10's 0.3 KB allowance, so this is a reporting fix rather than a code change.
One thing outside your hands: CI has not run on this head, so the WebKit interaction project your Evidence section cites has no result here — a maintainer adds the ci:run label so the required checks run.
Claims and files checked
Review mode: full; reason: no-earlier-review
Claims:
- Changeset, hit-area measurement skips content hidden by
content-visibilitywithout forcing its descendants to render — verified: the filter inhitArea.ts(lines 674-687), and a Chromium probe counting 1 forced layout for the first pass on the base page against 0 on the head's. readCandidates()measured every cached interactive element even when its ancestor's contents were skipped — verified against the base implementation.- Before the change, the new unit regression failed and Chromium recorded 2 bounds reads from skipped descendants — verified: the base tree carrying the head's test files fails at
hitArea.test.ts:340, and the browser regression fails there with "Expected: 0, Received: 2". - WebKit recorded 2 reads before and 0 after — not reproducible on the review machine, which cannot launch WebKit; not counted against this pull request.
- After the change, 0 skipped reads, the revealed control's right inset is 4 px beside its 8 px-away neighbour, and tapping it fires a click — verified: the browser regression passes on the head.
- The unchanged path is preserved where
checkVisibilityis unavailable, and the existing hit-area suite passes — verified: 63 unit tests pass, including the second new regression. - Isolated minified
hitArea.tsbundle, gzip 6,033 → 6,060 bytes (+27), no CSS change — verified: 6,033 → 6,060 bytes at the default gzip level, and the diff touches no stylesheet. pnpm lint:strictreports 0 errors — verified for the three changed source files under strict lint; the full-repository run is CI's.- The full test run was stopped after failures in unchanged CLI tests and
pnpm buildwas not run — taken as stated; this review built the build package, Core and the seven themes in both trees with no failure. - The pre-review receipt reports no actionable findings — not reproducible here (a fresh-session receipt), and nothing in it is relied on.
- Related work replaces the watched hit-area architecture more broadly and this patch is independent — verified: that pull request is an open draft and nothing here depends on it.
Files:
.changeset/skip-unrendered-hit-area-candidates.md— clear: a valid@astryxdesign/corepatch note, accepted by the repository's changeset check.packages/core/src/utils/hitArea.ts— clear: the candidate filter and its capability guard; no other path in the file changes.packages/core/src/utils/hitArea.test.ts— clear: two regressions, both mutation-sensitive (one fails without the filter, one pins the fallback).packages/core/src/utils/__tests__/hitAreaContentVisibility.interaction.browser.spec.ts— clear: matches the interaction lanes' test pattern and follows the repository's existing esbuild-fixture style for browser proofs without Storybook.
User impact
On touch pages with offscreen
content-visibility: autosections, measuring a visible control also reads the bounds of skipped interactive descendants. Those reads force rendering work in deferred content and undermine the page's layout optimization.Fixes #11883.
Problem and solution fit
readCandidates()measures every cached interactive element, even when its ancestor's contents are skipped. Filter unrendered candidates before reading geometry, so visible controls can keep their touch targets without forcing deferred descendants to render.Expected behavior and authority
AST-094 FR42 owns touch targets growing toward 44 × 44 px, stopping halfway to neighbours. FR24 and React component runtime INV5/INV7 govern shared interaction work and resource ownership. This change preserves the existing sizing and scheduling rules while avoiding geometry reads for skipped content.
Smallest restoration
interactiveElements(doc) + .filter(el => !el.checkVisibility || el.checkVisibility({contentVisibilityAuto: true})) .map(el => ({element: el, rect: plainRect(el)}))The registry remains intact: revealed elements rejoin subsequent measurements. Browsers without
checkVisibilityretain existing behavior. Supporting changes are two unit regressions, one browser regression and a Core patch changeset.Evidence
checkVisibilityis unavailable; the existing hit-area suite passes.hitArea.tsESM bundle, including transitive imports: gzip 6,033 → 6,060 bytes (+27 bytes); no CSS change. This is not a full application bundle measurement.Scope
Components: shared Core
hitAreautility.Related: #11205 replaces the watched hit-area architecture more broadly. This patch targets the current implementation and can be considered independently if useful before that refactor lands.
Testing
Completed before opening this draft:
pnpm exec vitest run packages/core/src/utils/hitArea.test.ts --project ui— 63 passed.pnpm exec playwright test --config playwright.interaction.config.ts hitAreaContentVisibility.interaction.browser.spec.ts— 2 passed, Chromium and WebKit with touch input.pnpm lint:strict— 0 errors, warnings reported.lint-stagedandpnpm check:repo— passed on the committed files.pnpm specs:for --diff origin/mainandpnpm review:pre --base upstream/main— completed; pre-review reported no automatic findings.Validation limits: the full
pnpm test --maxWorkers=4run was stopped after failures appeared in unchanged CLI tests, including theme-edit and kept-tree tests. These failures have not been compared against a clean upstream checkout. The browser fixture then received a small lint cleanup removing non-null assertions; its browser run was not repeated.pnpm buildhas not been run. This draft does not claim the full repository gates pass.Fresh-session pre-review receipt
Reviewed base
8c8dd0539e01795f04b4056b440c2f77db05e7e6against head70536e40fc728509160e1f07f05f67d7abfd2878: no actionable findings. The committedreview:prereport has 0 automatic findings and a clean merge. Public API, behavior authority, public boundary and source comments were checked.Global routing matched the following 63 claims. Each match reason is that the listed trigger matches that claim's
review-applicability:v1declaration; only those claims were routed. Direct behavior ownership remains AST-094 FR42.Merge Danger
Door: two-way; revert the candidate filter to restore previous behavior.
Blast Radius: touch-targets. Shared neighbour measurement changes for unrendered candidates; visible targets, revealed neighbours and the unsupported-browser fallback have focused coverage.