Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

ci: the WebKit interaction lane runs the pager's proof for the pager files (#9377)

Cindy Zhangf40893ae4e66
diff --git a/.github/scripts/ci-interaction-webkit.test.mjs b/.github/scripts/ci-interaction-webkit.test.mjs
index f99f839b58..400ad71b3f 100644
--- a/.github/scripts/ci-interaction-webkit.test.mjs
+++ b/.github/scripts/ci-interaction-webkit.test.mjs
@@ -163,6 +163,7 @@ describe('WebKit interaction proof routing', () => {
'packages/core/src/gestures/',
'packages/core/src/motion/__tests__/animatedLayout.interaction',
'packages/core/src/motion/__tests__/animator.interaction',
+ 'packages/core/src/hooks/__tests__/usePager.interaction',
'internal/interaction-harness/',
];
for (const target of targets) {
@@ -174,6 +175,15 @@ describe('WebKit interaction proof routing', () => {
// SideNav) stay with the Chromium proofs.
expect(run).not.toContain('animatedLayoutAdopters');
expect(run).not.toMatch(/motion\/ /);
+ // Carousel paging renders its Storybook story, so it stays there too, and
+ // its files start no WebKit run.
+ expect(run).not.toContain('CarouselPaging');
+ for (const file of [
+ 'packages/core/src/Carousel/useCarouselPaging.ts',
+ 'packages/core/src/Carousel/__tests__/CarouselPaging.interaction.browser.spec.ts',
+ ]) {
+ expect(inScope(file), file).toBe(false);
+ }
for (const component of ['DateInput', 'TabList', 'TreeList', 'SideNav']) {
expect(run).not.toContain(component);
}
@@ -181,11 +191,7 @@ describe('WebKit interaction proof routing', () => {
// Every source file the WebKit specs bundle into their pages is in scope,
// so a change that reaches the run always runs it.
- it.each([
- 'packages/core/src/gestures/__tests__/browser/fixture.ts',
- 'packages/core/src/motion/__tests__/animatedLayoutBundle.ts',
- 'packages/core/src/motion/__tests__/motionBundle.ts',
- ])('keeps everything %s bundles in scope', async entry => {
+ async function expectBundleInScope(entry) {
const {metafile} = await build({
absWorkingDir: root,
entryPoints: [entry],
@@ -206,7 +212,21 @@ describe('WebKit interaction proof routing', () => {
for (const source of sources) {
expect(inScope(source), source).toBe(true);
}
- });
+ }
+
+ it.each([
+ 'packages/core/src/gestures/__tests__/browser/fixture.ts',
+ 'packages/core/src/motion/__tests__/animatedLayoutBundle.ts',
+ 'packages/core/src/motion/__tests__/motionBundle.ts',
+ ])('keeps everything %s bundles in scope', expectBundleInScope);
+
+ // The pager's page arrives with the pager; until then there is nothing to
+ // bundle, and from then on its next import is checked like the others.
+ const pagerBundle = 'packages/core/src/hooks/__tests__/pagerBundle.ts';
+ it.skipIf(!fs.existsSync(path.join(root, pagerBundle)))(
+ 'keeps everything the pager bundle bundles in scope',
+ () => expectBundleInScope(pagerBundle),
+ );
it('runs for gesture, motion, touch, press-feedback and menu-press code, and their harness', () => {
for (const touched of [
@@ -225,6 +245,11 @@ describe('WebKit interaction proof routing', () => {
'packages/core/src/hooks/menuPressGesture.ts',
'packages/core/src/hooks/useLongPress.ts',
'packages/core/src/hooks/usePressFeedback.ts',
+ 'packages/core/src/hooks/usePager.ts',
+ 'packages/core/src/hooks/useIsomorphicLayoutEffect.ts',
+ 'packages/core/src/utils/sharedResizeObserver.ts',
+ 'packages/core/src/hooks/__tests__/usePager.interaction.browser.spec.ts',
+ 'packages/core/src/hooks/__tests__/pagerBundle.ts',
'internal/interaction-harness/src/webInput.ts',
'playwright.interaction.config.ts',
// Shared setup, as pr-interaction keeps (spec:AST-030 FR13): a
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4e9be9fc35..693aaaf193 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2382,8 +2382,8 @@ jobs:
# The gesture, motion and harness interaction proofs in WebKit, the engine
# of every iOS browser, for the code where WebKit and Chromium differ on
# touch: the gesture host and recognizers, the motion runtime, the touch and
- # press helpers and the menu press model, plus the harness and the shared
- # setup that runs them (spec:AST-030 FR13). The run is limited to the specs
+ # press helpers, the menu press model and the pager, plus the harness and the
+ # shared setup that runs them (spec:AST-030 FR13). The run is limited to the specs
# whose bundles reach only that same code, so a WebKit break elsewhere never
# turns an unrelated pull request red; the motion adopters spec renders
# Storybook components and stays with the Chromium proofs. Out of scope every step after the scope step skips and
@@ -2416,7 +2416,7 @@ jobs:
id: scope
uses: ./.test-scope/.github/actions/test-scope
with:
- paths: '^(packages/core/src/gestures/|packages/core/src/motion/|packages/core/src/internal/touch|packages/core/src/utils/(press|touch|primaryClick|isApplePlatform|flatTree|inputStream|clickGuard|selectionLock|coarsePointer)|packages/core/src/privateAttributes/hapticSwitch\.stylex\.ts$|packages/core/src/hooks/(useMenuPress|menuPress|useLongPress|usePressFeedback|isRtlElement)|internal/interaction-harness/|internal/a11y-spec/|playwright\.interaction\.config\.ts$|packages/themes/[^/]+/src/|apps/storybook/|\.github/workflows/ci\.yml$|package\.json$|pnpm-lock\.yaml$|\.github/actions/test-scope/)'
+ paths: '^(packages/core/src/gestures/|packages/core/src/motion/|packages/core/src/internal/touch|packages/core/src/utils/(press|touch|primaryClick|isApplePlatform|flatTree|inputStream|clickGuard|selectionLock|coarsePointer|sharedResizeObserver)|packages/core/src/privateAttributes/hapticSwitch\.stylex\.ts$|packages/core/src/hooks/(useMenuPress|menuPress|useLongPress|usePressFeedback|isRtlElement|useIsomorphicLayoutEffect|usePager|__tests__/(usePager|pagerBundle))|internal/interaction-harness/|internal/a11y-spec/|playwright\.interaction\.config\.ts$|packages/themes/[^/]+/src/|apps/storybook/|\.github/workflows/ci\.yml$|package\.json$|pnpm-lock\.yaml$|\.github/actions/test-scope/)'
outside-pull-request: skip
requires-head-file: playwright.interaction.config.ts
@@ -2506,6 +2506,7 @@ jobs:
packages/core/src/gestures/ \
packages/core/src/motion/__tests__/animatedLayout.interaction \
packages/core/src/motion/__tests__/animator.interaction \
+ packages/core/src/hooks/__tests__/usePager.interaction \
internal/interaction-harness/ \
--config playwright.interaction.config.ts \
--project webkit \