Skip to content

test(Lightbox): run the keyboard and viewport specs on Lightbox changes - #11524

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/lightbox-a11y-scope
Nov 13, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/lightbox-a11y-scope

Conversation

@vjeux

@vjeux vjeux commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

LightboxKeyboard.a11y.browser.spec.ts and LightboxViewport.a11y.browser.spec.ts carry @pr-a11y always, though they check only Lightbox: its keys, focus, sizing and caption. So the pr-a11y job starts both on every pull request labelled ci:run-a11y, whatever it changes. Meanwhile the pr-component-a11y-contracts job skips them on a Lightbox change, since it runs no unchanged always spec.

Intended invariant

AST-030 FR12's contract job runs the scoped specs that each touched component owns, and no unchanged always spec. A spec with no always, audit or release-only line is scoped. The release check still runs every spec in a11y-contracts.

Change

Each spec's routing line becomes // @pr-a11y scope ^packages/core/src/Lightbox/ ^apps/storybook/stories/Lightbox, so the spec is scoped. The second token adds the Lightbox stories, as the Avatar and AppShell specs do. No test body changes.

Evidence

  • Failure before the change, on main 6bf031a: a dry run for a branch that changes only Avatar.tsx selects both specs as always. A --changed-only dry run for a Lightbox.tsx change selects neither.
  • Success after the change: the same Avatar branch selects neither. A Lightbox.tsx change selects both, in the plain and the --changed-only dry run. A change to the Lightbox stories selects both in the plain dry run.
  • A change only to a module Lightbox uses from another folder, such as Link/Link.tsx or Layer/useLayer.tsx, changes how they run. The labelled run resolves changed components without their dependents, so it no longer selects them. The contract job now plans them as specs of a folder that renders a touched component. Each runs if it fits that job's six-minute plan and its one-minute share, and is otherwise listed as not run. The release check still runs every spec.
  • Product/runtime behavior verified unchanged: only the two routing comments change. Together the two specs pass 45 tests in Chromium and 45 in WebKit.
  • CI impact: a labelled pull request that leaves Lightbox alone no longer starts these two files in the pr-a11y job. Their times in .github/a11y-contract-durations.json are 3.8 s and 2.2 s. A Lightbox change now runs them in the pr-component-a11y-contracts job, and a change to a module Lightbox uses may run them there.

Scope

Components: Lightbox

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • These runs used f545d08, whose tree this head keeps; only the commit message changed. Strict ESLint has no warnings on the two files, and Prettier passes. The routing script tests pass 101/101 in 3 files. pnpm review:pre reports 0 findings.
  • pnpm test:a11y-contract:pr origin/main --dry-run, on this branch with an Avatar, Lightbox, Lightbox-story, useLayer.tsx or Link.tsx change added locally, and on main the same way.
  • The same --changed-only run with --owned-by Link --dependents-of core/Link, and with --owned-by Layer --dependents-of core/Layer. Before, neither lists these specs. After, both list them, as run or as not run.
  • node .github/scripts/a11y-pr-contracts.mjs --changed-only <specs> --changed-files <files> --owned-by Lightbox --dry-run, before and after.
  • refactor(core): touch hit areas are checked at press, not watched (AST-094 FR42) #11205 also edits LightboxViewport.a11y.browser.spec.ts, in another hunk. The two merge clean in either order.

@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 13, 2026 12:18pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 13, 2026
@astracat-bot

astracat-bot Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 13, 2026, 12:30 PM UTC

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec f545d08

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · fc5d04c

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Lightbox · Storybook 144.7 kB (0) · 11.5 kB CSS (0) 4,665 (0) ✓ · ✓ · ✓

Package size: measured; main has no measurement of the merge base to compare yet.

API changes: unknown (base surface unavailable): richtext, theme-butter, theme-chocolate, theme-gothic, theme-matcha, theme-neutral, theme-stone, theme-y2k

Touched components checked; add ci:run-visual or ci:run-rtl to run the full suites.


Generated by PR Enrichment workflow | View full report

@cixzhang cixzhang added ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) labels Nov 13, 2026

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. The routing change itself matches the CI routing spec: Lightbox's two specs now run on Lightbox pull requests in the contract job, and the release check still runs every spec. Two statements in the description need correcting:

  • The description says a change only to Link/Link.tsx or Layer/useLayer.tsx no longer selects these specs, but the contract job also runs the scoped specs of folders that render a touched component, so after this change a Link.tsx change runs LightboxKeyboard.a11y.browser.spec.ts there (and lists LightboxViewport as not run); please say so in the Evidence and CI impact bullets.
  • The description and the commit message say the pr-a11y job starts both specs on every pull request, but on a pull request pr-a11y runs only with the ci:run-a11y label, so please say "every pull request labelled ci:run-a11y".

No code change is needed; CI has not run on this head yet because the pull request is a draft.

Claims and files checked
  • Claim: both specs were always and check only Lightbox: verified.
  • Claim: pr-a11y starts both on every pull request: false, it runs only with ci:run-a11y.
  • Claim: the contract job skipped them on a Lightbox change: verified.
  • Claim: the contract job runs a touched component's scoped specs and no unchanged always spec: verified against the CI routing spec.
  • Claim: a spec with no always, audit or release-only line is scoped: verified in the routing parser.
  • Claim: the release check still runs every spec: verified, its contract legs run every listed test.
  • Claim: the new routing line adds the Lightbox stories, like the Avatar and AppShell specs: verified.
  • Claim: only the two routing comments change, with no test body change: verified.
  • Claim: before, an Avatar-only change selects both as always, and a Lightbox change selects neither in the contract job: verified by replaying the routing.
  • Claim: after, an Avatar change selects neither, a Lightbox change selects both in both modes, and a Lightbox story change selects both in the labelled run: verified by replaying the routing.
  • Claim: a Link or Layer change no longer selects these specs: false for the contract job.
  • Claim: the two specs hold 45 tests per browser: count verified, not run here.
  • Claim: recorded times of 3.8 s and 2.2 s: verified.
  • Claim: a Lightbox change now runs them in the contract job: verified.
  • Claim: no public API or product behavior change: verified, the API surface comparison shows no rows.
  • Claim: strict ESLint, Prettier, the routing tests and the pre-review script pass: verified.
  • Claim: the other open pull request that edits the viewport spec merges cleanly with this one: verified.
  • File packages/core/src/Lightbox/LightboxKeyboard.a11y.browser.spec.ts: finding, it now joins the contract job's specs for folders Lightbox renders, which the description denies.
  • File packages/core/src/Lightbox/LightboxViewport.a11y.browser.spec.ts: clear.

Automated review (maintainer link)

Both accessibility specs check only Lightbox, yet every pull request
labelled ci:run-a11y ran them. They are now scoped to the Lightbox
folder and its stories, like the Avatar specs, so the component
contract check runs them when Lightbox changes.
@vjeux
vjeux force-pushed the test/lightbox-a11y-scope branch from f545d08 to fc5d04c Compare November 13, 2026 12:08
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec fc5d04c

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI. Moving both Lightbox specs from always to a Lightbox scope matches the CI routing spec: Lightbox pull requests now run them in the component contract job, a change to a folder Lightbox renders plans them in that job's one-minute share, and the release check still runs them. The description and commit message now match what the routing does. CI has not run on this head because the pull request is a draft; it runs once the pull request is marked ready for review.

Claims and files checked

Claims:

  • Both specs were routed always and check only Lightbox: its keys, focus, sizing and caption: verified: line 2 at the merge base; the specs' headers and the Lightbox record's caption-band cases
  • The labelled accessibility job started both on every pull request labelled ci:run-a11y, whatever it changed: verified: always returns before any path check (a11y-pr-contracts.mjs:279); the jobs need the label (ci.yml:2247, :2384, :2471, :2575)
  • The component contract job skipped them on a Lightbox change: verified: owned specs exclude always (a11y-pr-contracts.mjs:384-396); replay before the change
  • The contract job runs a touched component's scoped specs and no unchanged always spec: verified against AST-030 FR12
  • A spec with no always, audit or release-only line is scoped: verified: parseRouting default (a11y-pr-contracts.mjs:85, :121)
  • The release check still runs every spec: verified: a11y-contracts runs every listed test (ci.yml:2654-2655)
  • The new line scopes both specs to the Lightbox folder and stories, as the Avatar and AppShell specs do, with no test body change: verified: the diff is line 2 only; the Avatar and AppShell specs carry the same token shape; apps/storybook/stories/Lightbox.stories.tsx exists
  • Before and after dry runs for Avatar, Lightbox and Lightbox-story changes: verified: routing replay on the head and on the head merged into main
  • A Link or Layer change no longer selects them in the labelled run; the contract job plans them within its six-minute plan and one-minute share, else lists them as not run: verified: the labelled scope has no dependents (a11y-pr-scope.mjs:128-186); replay: Link runs the keyboard spec and lists the viewport spec as not run, Layer lists both as not run
  • Only the two routing comments change; product behavior is unchanged: verified: the diff, and 0 API surface rows for Core and the seven themes
  • Together the specs pass 45 tests in Chromium and 45 in WebKit: verified: 45 tests listed in each project; all 45 pass in Chromium; WebKit was not re-run
  • Recorded times 3.8 s and 2.2 s: verified: .github/a11y-contract-durations.json:120-121
  • The head keeps the tested commit's tree; only the commit message changed: verified: identical trees and parent
  • Strict ESLint and Prettier pass; routing tests pass 101/101 in 3 files; pre-review reports 0 findings: verified: rerun at the head
  • #11205 edits the viewport spec in another hunk and the two merge cleanly: verified: its hunk starts at line 257; the merge has no conflict
  • The commit message: labelled pull requests ran both specs; they are now scoped so the contract check runs them on Lightbox changes: verified, as above

Files:

  • packages/core/src/Lightbox/LightboxKeyboard.a11y.browser.spec.ts: clear
  • packages/core/src/Lightbox/LightboxViewport.a11y.browser.spec.ts: clear

Automated review (maintainer link)

@vjeux
vjeux marked this pull request as ready for review November 13, 2026 13:33
@cixzhang
cixzhang merged commit 670492d into meta:main Nov 13, 2026
137 checks passed
@vjeux
vjeux deleted the test/lightbox-a11y-scope branch November 13, 2026 14:50

This branch was successfully deployed

1 active deployment
Preview — fc5d04ce Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants