Repository navigation
test(browser): keep every Playwright browser context off remote hosts - #9811
Conversation
Browser specs import test from @astryxdesign/a11y-spec/playwright. Its contexts answer remote images with a local stand-in and block other remote requests, so a slow remote host cannot stall a spec.
…st error by prefix
|
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 |
|---|---|---|---|
| AlertDialog · Storybook | 83.4 kB (0) · 13.1 kB CSS (0) | 215 (0) | — · — · — |
| AppShell · Storybook | 70.4 kB (0) · 12.2 kB CSS (0) | 1,096 (0) | — · — · — |
| AspectRatio · Storybook | 3.8 kB (0) · 3.6 kB CSS (0) | 109 (0) | — · — · — |
142 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Avatar | 34.4 kB (0) · 6.5 kB CSS (0) | — | — · — · — |
| AvatarStatusDot | 7.2 kB (0) · 3.6 kB CSS (0) | — | — · — · — |
| Badge · Storybook | 4.0 kB (0) · 4.0 kB CSS (0) | 227 (0) | — · — · — |
| BaseTypeahead | 54.8 kB (0) · 10.3 kB CSS (0) | — | — · — · — |
| BottomSheet | 37.4 kB (0) · 7.5 kB CSS (0) | — | — · — · — |
| BottomSheetSwitcher | 17.1 kB (0) · 3.4 kB CSS (0) | — | — · — · — |
| BreadcrumbItem | 67.3 kB (0) · 11.5 kB CSS (0) | — | — · — · — |
| Breadcrumbs | 16.0 kB (0) · 3.4 kB CSS (0) | — | — · — · — |
| Button · Storybook | 44.8 kB (0) · 9.8 kB CSS (0) | 628 (0) | — · — · — |
| ButtonGroup · Storybook | 9.0 kB (0) · 3.4 kB CSS (0) | 128 (0) | — · — · — |
| Calendar · Storybook | 53.7 kB (0) · 10.4 kB CSS (0) | 1,658 (0) | — · — · — |
| Carousel · Storybook | 50.2 kB (0) · 10.6 kB CSS (0) | 493 (0) | — · — · — |
| ChatComposer | 60.9 kB (0) · 11.2 kB CSS (0) | — | — · — · — |
| ChatComposerDrawer | 17.5 kB (0) · 4.7 kB CSS (0) | — | — · — · — |
| ChatComposerInput | 58.9 kB (0) · 10.7 kB CSS (0) | — | — · — · — |
| ChatComposerTokenElement | 58.9 kB (0) · 10.7 kB CSS (0) | — | — · — · — |
| ChatDictationButton | 45.3 kB (0) · 9.9 kB CSS (0) | — | — · — · — |
| ChatLayout | 48.0 kB (0) · 10.3 kB CSS (0) | — | — · — · — |
| ChatLayoutScrollButton | 45.3 kB (0) · 10.0 kB CSS (0) | — | — · — · — |
| ChatMessage | 16.7 kB (0) · 3.7 kB CSS (0) | — | — · — · — |
| ChatMessageBubble | 7.1 kB (0) · 3.7 kB CSS (0) | — | — · — · — |
| ChatMessageList | 22.8 kB (0) · 8.0 kB CSS (0) | — | — · — · — |
| ChatMessageMetadata | 19.6 kB (0) · 4.1 kB CSS (0) | — | — · — · — |
| ChatSendButton | 45.2 kB (0) · 9.8 kB CSS (0) | — | — · — · — |
| ChatSystemMessage | 6.8 kB (0) · 3.8 kB CSS (0) | — | — · — · — |
| ChatTokenizedText | 7.1 kB (0) · 4.0 kB CSS (0) | — | — · — · — |
| ChatToolCalls | 25.9 kB (0) · 9.3 kB CSS (0) | — | — · — · — |
| CheckboxInput · Storybook | 48.1 kB (0) · 9.8 kB CSS (0) | 372 (0) | — · — · — |
| CheckboxList | 42.7 kB (0) · 8.6 kB CSS (0) | — | — · — · — |
| CheckboxListItem | 52.8 kB (0) · 11.1 kB CSS (0) | — | — · — · — |
| CodeBlock · Storybook | 58.6 kB (0) · 11.1 kB CSS (0) | 2,207 (0) | — · — · — |
| Collapsible | 23.1 kB (0) · 4.5 kB CSS (0) | — | — · — · — |
| CollapsibleGroup | 6.5 kB (0) · 3.3 kB CSS (0) | — | — · — · — |
| CommandPalette | 50.9 kB (0) · 12.3 kB CSS (0) | — | — · — · — |
| CommandPaletteEmpty | 6.2 kB (0) · 3.5 kB CSS (0) | — | — · — · — |
| CommandPaletteFooter | 17.0 kB (0) · 3.7 kB CSS (0) | — | — · — · — |
| CommandPaletteGroup | 3.5 kB (0) · 3.5 kB CSS (0) | — | — · — · — |
| CommandPaletteInput | 26.8 kB (0) · 8.5 kB CSS (0) | — | — · — · — |
| CommandPaletteItem | 10.1 kB (0) · 3.6 kB CSS (0) | — | — · — · — |
| CommandPaletteList | 16.0 kB (0) · 3.4 kB CSS (0) | — | — · — · — |
| ComplexSelector · Storybook | 55.3 kB (0) · 11.1 kB CSS (0) | 695 (0) | — · — · — |
| ContextMenu · Storybook | 74.9 kB (0) · 15.4 kB CSS (0) | 693 (0) | — · — · — |
| ContextMenuItem | 25.0 kB (0) · 5.0 kB CSS (0) | — | — · — · — |
| DateInput · Storybook | 146.9 kB (0) · 15.4 kB CSS (0) | 5,010 (0) | — · — · — |
| DateRangeInput · Storybook | 71.2 kB (0) · 11.9 kB CSS (0) | 666 (0) | — · — · — |
| Dialog | 19.1 kB (0) · 6.7 kB CSS (0) | — | — · — · — |
| DialogHeader | 47.7 kB (0) · 10.2 kB CSS (0) | — | — · — · — |
| Drawer | 38.4 kB (0) · 8.2 kB CSS (0) | — | — · — · — |
| DrawerHeader | 47.8 kB (0) · 11.6 kB CSS (0) | — | — · — · — |
| DropdownMenu | 73.1 kB (0) · 15.5 kB CSS (0) | — | — · — · — |
| DropdownMenuCheckboxItem | 18.3 kB (0) · 5.9 kB CSS (0) | — | — · — · — |
| DropdownMenuDivider | 5.2 kB (0) · 548 B CSS (0) | — | — · — · — |
| DropdownMenuGroup | 6.2 kB (0) · 3.4 kB CSS (0) | — | — · — · — |
| DropdownMenuItem | 17.5 kB (0) · 5.5 kB CSS (0) | — | — · — · — |
| DropdownMenuRadioGroup | 6.1 kB (0) · 3.3 kB CSS (0) | — | — · — · — |
| DropdownMenuRadioItem | 18.3 kB (0) · 5.9 kB CSS (0) | — | — · — · — |
| DropdownMenuSubMenu | 56.4 kB (0) · 10.0 kB CSS (0) | — | — · — · — |
| Field | 39.2 kB (0) · 7.4 kB CSS (0) | — | — · — · — |
| FieldLabel | 35.3 kB (0) · 5.9 kB CSS (0) | — | — · — · — |
| FieldStatus · Storybook | 9.4 kB (0) · 3.6 kB CSS (0) | 164 (0) | — · — · — |
| FileInput · Storybook | 53.3 kB (0) · 10.8 kB CSS (0) | 779 (0) | — · — · — |
| Grid | 4.4 kB (0) · 3.8 kB CSS (0) | — | — · — · — |
| GridSpan | 3.5 kB (0) · 3.4 kB CSS (0) | — | — · — · — |
| Heading | 7.9 kB (0) · 6.0 kB CSS (0) | — | — · — · — |
| HoverCard · Storybook | 19.2 kB (0) · 5.0 kB CSS (0) | 727 (0) | — · — · — |
| HStack | 5.9 kB (0) · 1.7 kB CSS (0) | — | — · — · — |
| Icon · Storybook | 7.6 kB (0) · 681 B CSS (0) | 701 (0) | — · — · — |
| IconButton · Storybook | 44.8 kB (0) · 9.8 kB CSS (0) | 17 (0) | — · — · — |
| InfoTip · Storybook | 36.7 kB (0) · 6.1 kB CSS (0) | 160 (0) | — · — · — |
| Item · Storybook | 13.3 kB (0) · 4.9 kB CSS (0) | 1,599 (0) | — · — · — |
| LayerProvider | 62.6 kB (0) · 10.5 kB CSS (0) | — | — · — · — |
| Layout | 6.8 kB (0) · 2.3 kB CSS (0) | — | — · — · — |
| LayoutContent | 6.0 kB (0) · 1.8 kB CSS (0) | — | — · — · — |
| LayoutFooter | 5.9 kB (0) · 1.7 kB CSS (0) | — | — · — · — |
| LayoutHeader | 6.0 kB (0) · 1.7 kB CSS (0) | — | — · — · — |
| LayoutPanel | 7.6 kB (0) · 5.0 kB CSS (0) | — | — · — · — |
| Lightbox · Storybook | 51.9 kB (0) · 10.2 kB CSS (0) | 833 (0) | — · — · — |
| Link | 42.3 kB (0) · 8.0 kB CSS (0) | — | — · — · — |
| LinkProvider | 3.5 kB (0) · 20 B CSS (0) | — | — · — · — |
| List | 5.4 kB (0) · 435 B CSS (0) | — | — · — · — |
| ListItem | 52.2 kB (0) · 11.1 kB CSS (0) | — | — · — · — |
| Markdown · Storybook | 145.4 kB (0) · 18.4 kB CSS (0) | 8,706 (0) | — · — · — |
| MobileNav | 51.5 kB (0) · 10.4 kB CSS (0) | — | — · — · — |
| MobileNavToggle | 45.1 kB (0) · 9.8 kB CSS (0) | — | — · — · — |
| MultiSelector · Storybook | 72.7 kB (0) · 15.3 kB CSS (0) | 2,707 (+5) | — · — · — |
| NavHeadingMenu | 14.8 kB (0) · 3.4 kB CSS (0) | — | — · — · — |
| NumberInput · Storybook | 54.7 kB (0) · 11.3 kB CSS (0) | 1,150 (0) | — · — · — |
| Outline · Storybook | 21.9 kB (0) · 4.2 kB CSS (0) | 1,211 (+5) | — · — · — |
| Popover · Storybook | 52.2 kB (0) · 12.7 kB CSS (0) | 1,038 (0) | — · — · — |
| ProgressBar · Storybook | 10.8 kB (0) · 7.3 kB CSS (0) | 568 (0) | — · — · — |
| RadioList | 40.6 kB (0) · 7.4 kB CSS (0) | — | — · — · — |
| RadioListItem | 50.7 kB (0) · 10.1 kB CSS (0) | — | — · — · — |
| ResizeHandle | 19.5 kB (0) · 4.3 kB CSS (0) | — | — · — · — |
| SegmentedControl | 81.5 kB (0) · 7.8 kB CSS (0) | — | — · — · — |
| SegmentedControlItem | 10.4 kB (0) · 4.0 kB CSS (0) | — | — · — · — |
| Selector | 77.4 kB (0) · 15.7 kB CSS (0) | — | — · — · — |
| SelectorOption | 16.6 kB (0) · 5.4 kB CSS (0) | — | — · — · — |
| SideNav | 69.9 kB (0) · 11.2 kB CSS (0) | — | — · — · — |
| SideNavCollapseButton | 45.6 kB (0) · 9.9 kB CSS (0) | — | — · — · — |
| SideNavHeading | 58.7 kB (0) · 10.6 kB CSS (0) | — | — · — · — |
| SideNavItem | 54.3 kB (0) · 10.5 kB CSS (0) | — | — · — · — |
| SideNavSection | 6.6 kB (0) · 3.7 kB CSS (0) | — | — · — · — |
| Slider · Storybook | 88.4 kB (0) · 9.4 kB CSS (0) | 2,326 (0) | — · — · — |
| Spinner · Storybook | 18.5 kB (0) · 6.8 kB CSS (0) | 321 (0) | — · — · — |
| Switch · Storybook | 86.6 kB (0) · 10.6 kB CSS (0) | 1,717 (0) | — · — · — |
| Tab | 11.4 kB (0) · 4.2 kB CSS (0) | — | — · — · — |
| Table | 84.4 kB (0) · 16.1 kB CSS (0) | — | — · — · — |
| TableBody | 3.4 kB (0) · 3.3 kB CSS (0) | — | — · — · — |
| TableCell | 76.1 kB (0) · 15.9 kB CSS (0) | — | — · — · — |
| TableFooter | 3.4 kB (0) · 3.3 kB CSS (0) | — | — · — · — |
| TableHeader | 3.4 kB (0) · 3.3 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 75.7 kB (0) · 15.6 kB CSS (0) | — | — · — · — |
| TableRow | 6.5 kB (0) · 4.0 kB CSS (0) | — | — · — · — |
| TableSelectionToolbar | 54.6 kB (0) · 11.8 kB CSS (0) | — | — · — · — |
| TabList | 35.4 kB (0) · 7.5 kB CSS (0) | — | — · — · — |
| TabMenu | 55.3 kB (0) · 10.5 kB CSS (0) | — | — · — · — |
| Text · Storybook | 7.4 kB (0) · 6.0 kB CSS (0) | 544 (0) | — · — · — |
| TextArea · Storybook | 46.5 kB (0) · 9.9 kB CSS (0) | 496 (0) | — · — · — |
| TextInput · Storybook | 52.5 kB (0) · 11.0 kB CSS (0) | 420 (0) | — · — · — |
| ToggleButton | 45.6 kB (0) · 9.9 kB CSS (0) | — | — · — · — |
| ToggleButtonGroup | 6.4 kB (0) · 3.4 kB CSS (0) | — | — · — · — |
| Token · Storybook | 25.3 kB (0) · 4.8 kB CSS (0) | 561 (0) | — · — · — |
| Tokenizer · Storybook | 70.3 kB (0) · 17.1 kB CSS (0) | 2,114 (0) | — · — · — |
| Toolbar · Storybook | 34.7 kB (0) · 7.9 kB CSS (0) | 269 (0) | — · — · — |
| Tooltip · Storybook | 20.2 kB (0) · 5.0 kB CSS (0) | 735 (0) | — · — · — |
| TopNav | 53.1 kB (0) · 10.7 kB CSS (0) | — | — · — · — |
| TopNavHeading | 58.1 kB (0) · 10.4 kB CSS (0) | — | — · — · — |
| TopNavItem | 10.7 kB (0) · 4.0 kB CSS (0) | — | — · — · — |
| TopNavMegaMenu | 53.7 kB (0) · 11.2 kB CSS (0) | — | — · — · — |
| TopNavMegaMenuFeaturedCard | 6.9 kB (0) · 3.6 kB CSS (0) | — | — · — · — |
| TopNavMegaMenuItem | 10.8 kB (0) · 4.2 kB CSS (0) | — | — · — · — |
| TopNavMenu | 57.9 kB (0) · 10.5 kB CSS (0) | — | — · — · — |
| TreeList · Storybook | 38.6 kB (0) · 5.0 kB CSS (0) | 1,152 (0) | — · — · — |
| Typeahead | 62.6 kB (0) · 11.8 kB CSS (0) | — | — · — · — |
| TypeaheadItem | 6.3 kB (0) · 3.6 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 66.0 kB (0) · 773 B CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 66.5 kB (0) · 1.1 kB CSS (0) | — | — · — · — |
| lab/ChatTypingIndicator | 24.8 kB (0) · 612 B CSS (0) | — | — · — · — |
| lab/ChatUnreadDivider | 3.6 kB (0) · 348 B CSS (0) | — | — · — · — |
| lab/CircularProgress · Storybook | 8.5 kB (0) · 1.1 kB CSS (0) | 597 (0) | — · — · — |
| lab/Schedule · Storybook | 61.0 kB (0) · 3.9 kB CSS (0) | 4,750 (0) | — · — · — |
| lab/SelectableCardGroup · Storybook | 49.9 kB (0) · 162 B CSS (0) | 242 (0) | — · — · — |
Package size: no published package changed; no new dependencies.
API changes: none in this pull request
Committed API report behind this build: core 2 rows; run pnpm api:report.
Wide change (shared styles: packages/core/src/theme/__tests__/SpacingRootFontSize.a11y.chromium.spec.ts): add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.
CI impact: 0 job-min per update · pool 0% · time to green −2.5 min · standard runners · 4 CI action or script files changed (not measured)
| Before | After | Change | |
|---|---|---|---|
| Job-minutes per PR update | 92.7 | 92.7 | 0 |
| Runner pool, runner-minutes a day | 32,717 | 32,717 | 0 (0%) |
| Average concurrent jobs | 22.7 | 22.7 | 0 |
| Time to green (median → this run) | 18.9 min | 16.4 min | −2.5 min |
| Runs a day | 353 | 353 | 0 |
Not measured (the jobs that use these keep their recent minutes above): .github/scripts/accessibility-audit.integration.test.mjs, .github/scripts/lib/offline-media.d.ts, .github/scripts/lib/offline-media.js, .github/scripts/lib/offline-media.test.mjs.
Assumptions: before is each job's average over the last 20 pull-request runs; after keeps that for unchanged jobs and uses this run's minutes for added or changed ones, weighted by how often each changed job ran in those runs; runs a day averages the seven whole days before today; time to green compares this run with the median of those runs that ran the same jobs.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested: the shared base test works as described, but the branch needs a rebase and the guard has two gaps.
- Two browser specs added to
mainafter this branch forked,SelectorListboxName.a11y.chromium.spec.tsandSelectableCardGroupRadio.a11y.chromium.spec.ts, still import@playwright/test, so after merge the new lint rule fails on both and they run without hermetic contexts; rebase and switch their imports. - The title's "every Playwright browser context" and the description's "a new spec cannot skip the base test" overstate the guard, because
import {test} from 'playwright/test'passes the new rule and the browser thatharness.interaction.browser.spec.tslaunches itself (line 1195) gets no route; addplaywright/testto the rule and route that context withkeepRequestsLocal, or narrow the wording.
The new hermetic spec passes on this head and fails against plain @playwright/test, and the internal contract and gesture suites pass under the base test.
[Automated review]
| { | ||
| paths: [ | ||
| { | ||
| name: '@playwright/test', |
There was a problem hiding this comment.
playwright/test exports the same test and resolves through the root playwright devDependency, so a spec that imports it passes this rule. A probe spec with import {test} from 'playwright/test' got no no-restricted-imports error. Restrict it as well:
{
name: 'playwright/test',
message:
"Import from '@astryxdesign/a11y-spec/playwright' instead: its `test` keeps every browser context off remote hosts.",
},…er.newPage is hermetic
There was a problem hiding this comment.
Changes requested: the shared base test works as described, but the branch needs a rebase, the guard has two gaps, and the CI impact line is still a placeholder.
- Four browser specs that landed on
mainafter this branch forked (SelectorListboxName.a11y.chromium.spec.ts,SelectableCardGroupRadio.a11y.chromium.spec.ts,Wheel.interaction.browser.spec.tsandWheelActivation.interaction.browser.spec.ts) still import@playwright/test, so the new lint rule fails on them after merge and they run without hermetic contexts; rebase and switch their imports. - The title's "every Playwright browser context" and the description's "a new spec cannot skip the base test" overstate the guard, because
import {test} from 'playwright/test'passes the new rule and the browser thatharness.interaction.browser.spec.tslaunches itself (line 1195) gets no route; addplaywright/testto the rule and route that browser's context withkeepRequestsLocal, or narrow the wording. - The CI impact section states the runner class only, and AST-030 FR19 asks a CI-script change for job-minutes per update before and after, runner-pool usage and time to green, so add them once this pull request's CI has run.
The new hermetic spec passes on this head and fails against plain @playwright/test, and the internal contract and gesture suites pass under the base test.
[Automated review]
| * Every context starts from `browser.newContext`: the `context` and `page` | ||
| * fixtures, `browser.newPage`, and a spec's own call. So the rule is set at | ||
| * that one point, once per worker. |
There was a problem hiding this comment.
A browser the spec launches itself is a different Browser, so its contexts skip this wrapper. harness.interaction.browser.spec.ts:1195 does that (browser.browserType().launch(), then own.newPage()), and a probe of the same shape on this head sent a remote stylesheet to the network (net::ERR_NAME_NOT_RESOLVED) instead of ERR_BLOCKED_BY_CLIENT. Either make that self-test's context with own.newContext() plus keepRequestsLocal, or say here that only contexts from the fixture's browser are covered.
…e loopback-skipping route in the audit fake
There was a problem hiding this comment.
Changes requested: the four specs from main now use the base test and the audit fake accepts the new route, but two items from the last review still stand.
- The title's "every Playwright browser context" and the description's "one spec" launching its own browser and "a new spec cannot skip the base test" overstate the guard, because
import {test} from 'playwright/test'still passes the lint rule (eslint.config.js:925) and the browser thatharness.interaction.browser.spec.tslaunches itself (line 1197) still gets no route; addplaywright/testto the rule and route that browser's context withkeepRequestsLocal, or narrow the wording. - The CI impact section still gives only the runner class, and AST-030 FR19 asks a pull request that changes a CI script for job-minutes per update before and after, runner-pool usage and time to green, so add them from this pull request's CI run.
On this head the hermetic spec passes, offline-media.test.mjs and the audit integration test pass, and the four converted specs lint clean.
[Automated review]
There was a problem hiding this comment.
Changes requested: two items still stand.
- The title's "every Playwright browser context" and the description's "one spec" launching its own browser and "a new spec cannot skip the base test" overstate the guard, because
import {test} from 'playwright/test'still passes the lint rule (eslint.config.js:925) and the browser thatharness.interaction.browser.spec.tslaunches itself (line 1197) gets no route; addplaywright/testto the rule and route that browser's context withkeepRequestsLocal, or narrow the wording. - The CI impact section now gives the runner class and the interaction proofs' wall time, but AST-030 FR19 also asks a pull request that changes a CI script for its runner-pool usage (runner-minutes a day and average concurrent jobs) and time to green, so add them.
The hermetic spec, offline-media.test.mjs and the audit integration test pass with this patch.
[Automated review]
…the harness self-test's own browser
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, and marking it ready for review starts the run.
The three items from the last review are fixed: the lint rule also rejects playwright/test, playwright and playwright-core, the interaction harness routes the browser it launches itself, and the CI impact section gives runner-pool usage and time to green. A wide change like this one runs the full accessibility-contract suite only behind ci:run-a11y, so adding that label before merge would run every spec under the new base test once.
- Miss: (non-blocking) in Playwright's context-reuse mode (
PW_TEST_REUSE_CONTEXT=1), thecontextfixture comes frombrowser._newContextForReuse()instead ofnewContext, so thepagefixture gets no route; name that exception in the comment atinternal/a11y-spec/src/playwright.ts:35-36and in the README, or also route the context in acontextfixture override.
[Automated review]
| * Every context starts from `browser.newContext`: the `context` and `page` | ||
| * fixtures, `browser.newPage`, and a spec's own call. So the rule is set at |
There was a problem hiding this comment.
Non-blocking: with Playwright's context-reuse mode on (PW_TEST_REUSE_CONTEXT=1), the context fixture comes from browser._newContextForReuse(), not newContext, so the page fixture gets no route; the page-fixture test in hermetic.chromium.spec.ts fails in that mode. Name the exception here and in the README, or also route the context in a context fixture override.
…ough a11y-spec main's no-restricted-imports rule (meta#9811) rejects @playwright/test in browser specs, so the spec imports expect, test and Page from @astryxdesign/a11y-spec/playwright, whose test keeps every browser context off remote hosts.
…ough a11y-spec main's no-restricted-imports rule (meta#9811) rejects @playwright/test in browser specs, so the spec imports expect, test and Page from @astryxdesign/a11y-spec/playwright, whose test keeps every browser context off remote hosts.
…ore showing (#5398) * fix(HoverCard,Tooltip): wait for the trigger to have a layout box before showing * fix(Layer): treat an empty anchor box as ready; restore main's SheetWithHoverTip story * fix(Layer): wait for the anchor through the shared resize and mutation observers The anchor wait in show() created its own ResizeObserver and MutationObserver. Route it through observeResize and observeMutations, which architecture:react-component-runtime INV16 requires callers to use. The IntersectionObserver and the dialog toggle listener stay. * test(Layer): the focus-return harness uses a stable trigger ref The harness attached the trigger with an inline ref, which detaches and reattaches it on every render. Each detach now defers its anchor-name removal by a microtask, so the replay test, which holds the ledger's microtasks by hand, held those too. A stable ref leaves it holding only the ledger's. * fix(Layer): clear the strict-lint findings in the anchor-readiness comments and test harness The new comments no longer cite an issue number or an invariant id, and the focus-return harness lists the two refs it reads in its callback's dependencies. * test(Layer): the anchor-readiness browser spec imports Playwright through a11y-spec main's no-restricted-imports rule (#9811) rejects @playwright/test in browser specs, so the spec imports expect, test and Page from @astryxdesign/a11y-spec/playwright, whose test keeps every browser context off remote hosts. * test(Layer): the anchor-name churn cases show the layer first main now gives a closed layer's trigger no anchor name (#9963), so a trigger is an anchor only while its layer is shown. The contextRef churn cases open the layer before checking the name. * fix(Layer): the anchor settle waits only on document-timeline animations, through one shared predicate A scroll- or view-driven animation finishes only when the person scrolls to the end of its range, so a controlled Tooltip inside such an ancestor stayed hidden. The settle wait now skips animations not on the document's timeline, and it shares the running-and-finite test with exitAnimations. * docs(Layer): the anchor-wait changeset and comments describe the document-timeline wait The changeset and the comments still described a wait on any running finite animation. They now say it waits on running animations on the document timeline that end on their own, and not on paused, infinite, or scroll- and view-driven ones. * Merge branch 'main' into fix/hovercard-controlled-open-anchoring * chore(lint): regenerate the comment-provenance baseline The useLayer.tsx comments no longer cite INV6/FR4 or quote a requirement, so the baseline drops those three sites. * Merge main into fix/hovercard-controlled-open-anchoring Resolves useLayer.tsx's imports: keeps both this branch's shared resize and mutation observers and main's flat-tree, shadow-root and input-stream helpers. * review: comment wording and a churn guard that fails on main - The churn test records every write to the trigger's style, so it fails when a null-then-same-element reattach removes and re-adds the anchor name (main) even though the name ends up present. - The isAnchorReady doc sits on isAnchorReady; isShownAsPopover gets its own line. The anchor-wait comments say "no layout box" rather than 0x0, the unmount note names the released anchor wait, and the contextRef comment keeps its reason in a few sentences. * Merge branch 'main' into fix/hovercard-controlled-open-anchoring Co-authored-by: Cindy Zhang <[email protected]>
Maintainer impact
Why. A browser spec can stall on a remote host. On 6690e33 the release check (run 41574627097) failed because
AspectRatioFitLayers.a11y.browser.spec.tshit its 60 s timeout inpage.setContent: the story's placeholder photos from picsum.photos were still loading, and the load event waited for them. #9703 fixed that one spec with its own route. Carousel, Lightbox, Thumbnail, GridMasonry, Overlay and LayerDismissal stories load remote photos too, and nothing stopped any other spec from depending on a remote font, script or API. Each of these is a release failure that depends on someone else's server.Intended invariant
A browser spec run by
playwright.config.ts(accessibility contracts) orplaywright.interaction.config.ts(interaction proofs and gesture proofs) never waits on a remote host. The DOM and behavior under test do not change: image elements stay and get local bytes, and local Storybook and fixture servers are untouched.Change
What.
.github/scripts/lib/offline-media.js:routeRemoteImages(target, storyOrigin, {abortOther}). The route now matches only non-loopback http(s) URLs, so Playwright lets local Storybook and fixture requests through in the browser process with no round trip to the test process (this also helps the audit). A newabortOther: trueoption makes every remote request that is not an image fail at once (blockedbyclient). Remote images still get the local 400 × 400 stand-in. Local means the story origin, the loopback host (localhost,127.0.0.1,[::1]), or a URL with no network (data:,blob:). NewisRemoteNonImageexport. Without the option, behavior is unchanged, so the accessibility audit is unchanged.offline-media.d.tsdeclares the exports for TypeScript callers.internal/a11y-spec/src/playwright.ts(new, exported as@astryxdesign/a11y-spec/playwright): the one base test that both configs' specs use. It re-exports@playwright/testand replacestestwith a version whose workerbrowserfixture makes every new context hermetic (abortOther: true, no story origin, so only loopback is local). Every context starts atbrowser.newContext: thecontextandpagefixtures,browser.newPage, and the 47 specs that make their own contexts. So the rule is set at that one point.keepRequestsLocal(context)is exported for a browser the spec launches itself. Two specs do that, and both now call it: AppShell's full-Chromium window-switch test and the interaction harness's shader-cache self-test. The base test's source and the a11y-spec README say that such a spec must call it.*.a11y.chromium.spec.ts,*.a11y.browser.spec.ts,*.interaction.browser.spec.ts, the gesture proofs, the contract's own fixture specs) import from the base test instead of@playwright/test. This is a one-line import change per file.eslint.config.js:no-restricted-importsforbids@playwright/test,playwright/test,playwrightandplaywright-corein*.browser.spec.tsand*.chromium.spec.ts, so a spec cannot import Playwright around the base test. Lint cannot see a browser that a spec launches frombrowser.browserType(); the rule above covers that case.AspectRatioFitLayers.a11y.browser.spec.ts: test(AspectRatio): the fit-layer spec answers the story's remote photos locally #9703's per-test picsum route is removed. The base test now answers those photos.accessibility-audit.integration.test.mjs: its fake browser context accepts the new route pattern when it reaches remote hosts and skips loopback (it checked for the old'**/*'string).Why a base test and not a config option. Playwright config cannot install routes, and
globalSetupruns in another process. A sharedtestis Playwright's own mechanism for shared fixtures, and the lint rule keeps it complete.Evidence
AspectRatioFitLayerstimed out inpage.setContentwhile picsum.photos was loading.Risk
page.routeor latercontext.routestill wins over the base route (Playwright tries the newest route first), so specs that fake a remote URL keep working (the interaction harness does this).CI impact
Scope
Testing
vitest run .github/scripts/lib/offline-media.test.mjs: 24 passed, including real Chromium: withabortOther, a page whose script host never answers loads in under 5 s with the image drawn locally and the script request failed; withoutabortOther, the same page times out.internal/a11y-spec/src/harness/hermetic.chromium.spec.ts(new): thepagefixture, a context made bybrowser.newContext, and a page made bybrowser.newPageall draw a remote image at 400 px from the stand-in, fail a remote stylesheet withERR_BLOCKED_BY_CLIENT, and load a local file. 3/3 pass.pnpm -F @astryxdesign/a11y-spec typecheck, ESLint on all changed specs, and a lint probe spec that imports from@playwright/test,playwright/testandplaywright(all three rejected).AspectRatioFitLayers.a11y.browser.spec.tswithout its own route: 6/6 pass in Chromium.--retries=2. A test that passes on a retry is a pass; it is not evidence of flakiness on CI.data:image). No test failed only with the route on.