Repository navigation
test(BottomSheet): the drag-restyle proof names each oversized restyle's invalidations - #13721
Conversation
…e's invalidations The proof's failures on CI runners showed only element counts. The harness's rendering trace can now track invalidations, and restyleSources gives each style recalculation its element count and the invalidations before it. The proof records them and puts the oversized restyles, with their invalidations, in its failure message.
|
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 |
|---|---|---|---|
| BottomSheet | 77.2 kB (0) · 7.8 kB CSS (0) | — | ✓ · ✓ · — |
| BottomSheetSwitcher | 19.6 kB (0) · 3.4 kB CSS (0) | — | ✓ · ✓ · — |
Package size: no published package changed; no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
…he dialog, the sheet and its content compute
…the scrim opacity on the sheet and its content
There was a problem hiding this comment.
Changes requested: one statement in the description no longer matches the code at this head.
- The description says the failure message carries every oversized restyle with its invalidations, but the last commit trims the message to the first three (
BottomSheetDragRestyle.interaction.browser.spec.ts:212-216), so reword that bullet (all of them stay inrestyle-sources.json) and mention the new scrim-rule dump, or restore the full list.
The harness additions read correctly, and the proof's limit and pass criterion are unchanged. CI has not run on this head because the pull request is a draft; it runs once the pull request is marked ready.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: the proof fails on some CI runners at about 51 restyled elements against a limit of 6. Not verifiable at this head, because no CI run exists. It is consistent with the proof's own comment.
- Claim: the base failure prints only element counts. Verified: the base message is the bare list of counts.
- Claim: a clean Chromium restyles at most 4 elements per move at 60 and 30 Hz. This is the author's measurement and was not reproduced.
- Claim: the limit and its meaning are unchanged. Verified (
BottomSheetDragRestyle.interaction.browser.spec.ts:46,:236-239). - Claim:
traceRenderingtakestrackInvalidations, which adds the trace category that names each invalidation. Verified (trace.ts:349-359,:377-379). - Claim:
restyleSourcesgives each recalculation in the window its element count and the invalidations since the previous one. Verified (trace.ts:287-318and the new unit test). - Claim: the proof traces with both options and reads its restyles through
restyleSources. Verified (BottomSheetDragRestyle.interaction.browser.spec.ts:164-185). - Claim: the failure message carries each oversized restyle with its invalidations and the sheet's element count. False:
:212-216keeps only the first three. - Claim: the proof reports the scrim opacity that the dialog, the sheet and its first content element compute. Verified (
:186-200). The element it reads is the Handle, the sheet's first child. - Claim: the sheet ends that property's inheritance. Verified (
BottomSheetPanel.tsx:395-401). - Claim: a failure also writes
restyle-sources.jsonbeside the rendering events. Verified (:221-234). - Claim: the element count decides pass or fail, not the node an invalidation names. Verified (
:40-46,:236-239). - Claim: the new unit test fails without
restyleSourcesand passes with it. Verified from the source; the test was not run at this head. - Claim: the 20-of-20 run and the forced failure. These are the author's runs at the first commit and were not reproduced at this head.
- Claim: only test and harness files change, with no public API or product change. Verified: four files change, and the harness package is private.
- Claim: the two harness test files pass 7 of 7. Not verified at this head.
- Claim: the overlapping pull request edits the harness trace module and README. Verified.
- File
internal/interaction-harness/README.md: clear. - File
internal/interaction-harness/src/trace.ts: clear. - File
internal/interaction-harness/src/trace.restyleSources.test.ts: clear. - File
packages/core/src/BottomSheet/__tests__/BottomSheetDragRestyle.interaction.browser.spec.ts: the stale description claim above.
…sheet and its content inherit
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; it runs once the pull request is marked ready for review.
The description now matches the failure message, and the new walk over inherited declarations reads the protocol's ancestor entries in order, so each entry's from is the right ancestor distance. The proof's limit and pass criterion are unchanged.
- Optional: the "first content element" the scrim probes read is the sheet's handle bar (
BottomSheetPanel.tsx:1301-1309), not its content area, so "first child" in the description and the comments would say what is read. - Miss: the forced-failure evidence says the sheet has two
'initial'resets, but the panel sets three (BottomSheetPanel.tsx:399-401), so "two of the panel's three resets" would match the Testing bullet (optional).
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Claim: the proof fails on some CI runners at about 51 restyled elements against a limit of 6. Not verifiable here, since no CI run of it exists for this pull request; it matches the proof's own comment.
- Claim: the base failure prints only element counts. Verified: the base message is the bare list of counts.
- Claim: a clean Chromium restyles at most 4 elements per move at 60 and 30 Hz. The author's measurement; not reproduced.
- Claim: the limit and its meaning are unchanged. Verified (
BottomSheetDragRestyle.interaction.browser.spec.ts:46,:274-278). - Claim:
traceRenderingtakestrackInvalidations, which adds the invalidation-tracking trace category. Verified (trace.ts:349-359,:377-379). - Claim:
restyleSourcesgives each recalculation in the window its element count and the invalidations since the previous one. Verified (trace.ts:287-318and the new unit test). - Claim: the proof traces with both options and reads its restyles through
restyleSources. Verified (:222,:224). - Claim: the failure message carries the first three oversized restyles with their invalidations and the sheet's element count, and
restyle-sources.jsonkeeps every one. Verified (:245-259,:265-269). - Claim: the proof reports the scrim opacity that the dialog, the sheet and its first content element compute. Verified (
:225-239); the first child is the handle bar. - Claim: the sheet ends that property's inheritance. Verified (
BottomSheetPanel.tsx:395-401). - Claim: on a failure the proof lists every rule and inline style that sets the property on the sheet, its first child or an ancestor they inherit from, with origin, layers and stylesheet. Verified (
:84-163,:244). - Claim: these go in the message and in
restyle-sources.json, beside the existing rendering events. Verified (:250,:264-269). - Claim: the element count decides pass or fail, not the node an invalidation names. Verified (
:40-46,:274-278). - Claim: the new unit test fails without
restyleSourcesand passes with it. Verified from the source, which imports and pinsrestyleSources; not run here. - Claim: Chromium 149 with Playwright 1.61.1 passes the proof in 20 of 20 runs at an earlier commit. The author's run; the lockfile pins Playwright 1.61.1; not reproduced.
- Claim: with the resets removed the proof fails, alternating 1 and 51 on a 45-element sheet, each oversized restyle after the dialog's inline write. The author's run; not reproduced; the panel sets three resets and the run removed two.
- Claim: at an earlier commit the forced failure showed scrim opacity 1 on all three elements, and the dump named the dialog's inline write as inherited by the sheet and its first child at distances 1 and 2. The author's run; consistent with the markup, where the panel is the dialog's child and the handle bar the panel's.
- Claim: this head lists each declaration once. Verified (
:146-155). - Claim: only test and harness files change, with no public API, product behavior or policy change. Verified: four files change, and the harness package is private.
- Claim: the two harness trace test files pass 7 of 7. The files hold 7 cases (3 and 4); not run here.
- Claim: the overlapping ContextMenu pull request also edits the harness trace module and README. Verified.
- File
internal/interaction-harness/README.md: clear. - File
internal/interaction-harness/src/trace.ts: clear. - File
internal/interaction-harness/src/trace.restyleSources.test.ts: clear. - File
packages/core/src/BottomSheet/__tests__/BottomSheetDragRestyle.interaction.browser.spec.ts: the two optional wording notes above.
Maintainer impact
BottomSheetDragRestyle.interaction.browser.spec.tsfails on some CI runners only: each move of the drag restyles about 51 elements against a limit of 6. The failure prints only element counts, so a maintainer cannot tell what restyled the sheet's content or why. The same drag on a clean Chromium restyles at most 4 elements per move, at 60 Hz and at 30 Hz.Intended invariant
A move of a touch drag restyles the dialog, its backdrop, the panel and the edge tint, never the sheet's content (the proof's existing limit of 6 elements per recalculation). This PR keeps that limit and its meaning unchanged.
Change
internal/interaction-harness/src/trace.ts:traceRenderingtakestrackInvalidations, which adds the trace category that names each invalidation's node and reason. The newrestyleSources(trace, from, to)gives each style recalculation in the window its element count and the style invalidations since the previous one.BottomSheetDragRestyle.interaction.browser.spec.ts: the proof traces with{keepEvents: true, trackInvalidations: true}, reads the drag's restyles throughrestyleSources, and puts the first three oversized restyles, with the invalidations before each and the sheet's element count, in its failure message;restyle-sources.jsonkeeps every one. It also reports the scrim opacity that the dialog, the sheet and the sheet's first content element compute: the sheet ends that property's inheritance, so a value on the content shows the dialog's per-move writes reaching it. On a failure it also lists every rule and inline style that sets that property on the sheet and on its first content element, or on an ancestor they inherit it from, with its origin, layers and stylesheet, as the DevTools protocol matches them, which names any rule that wins over the reset. These go in the message and inrestyle-sources.json, beside the existing rendering events.Evidence
[51,1,51,1,…].restyleSourcesand passes with it. In Chromium 149 (Playwright 1.61.1) onfd1bd437, the proof passes 20 of 20 runs.'initial'custom-property resets removed, the proof fails.restyledalternates 1 and 51 on a 45-element sheet, and each oversized restyle follows the dialog's inline style write. That is the same signature as the CI failures, so the new message shows the mechanism.Scope
Components: interaction-harness, BottomSheet (test only)
Testing
vitest run internal/interaction-harness/src/trace.restyleSources.test.ts internal/interaction-harness/src/trace.layoutSources.test.ts: 7/7 passed, and the new test was red beforerestyleSourcesexisted.playwright test --config playwright.interaction.config.ts packages/core/src/BottomSheet/__tests__/BottomSheetDragRestyle.interaction.browser.spec.ts --project=chromium --workers=1 --repeat-each=20onfd1bd437: 20 passed.a8322101, the same forced failure ran the failure-only diagnostics without error:scrimOpacitywas1on the dialog, the sheet and the content, andscrimRulesnamed the dialog's inline write as inherited by the sheet (from: 1) and the content (from: 2). This head lists each declaration once.BottomSheetPanel.tsx('--_sheet-scrim-opacity': 'initial'and'--_sheet-scrim-duration': 'initial') and Storybook rebuilt: 1 failed, with the message above.Overlap checked: #8693 (a ContextMenu feature PR that also edits the harness trace module and README; this PR only adds invalidation tracking and restyleSources for the BottomSheet drag proof, with no ContextMenu change)