diff --git a/scripts/screenshots/capture.mjs b/scripts/screenshots/capture.mjs index 7bde1ebf..b4088659 100644 --- a/scripts/screenshots/capture.mjs +++ b/scripts/screenshots/capture.mjs @@ -17,7 +17,8 @@ import { STEADY_RASTER } from './raster.mjs' const GALLERY = 'https://app.visualci.com/g/docspring/visualci' const GALLERY_PATH = new URL(GALLERY).pathname -const NO_MOTION = `*, *::before, *::after { +// `html:root` outranks a single-class rule such as the app's reduced-motion `.spinner { animation: … !important }` +const NO_MOTION = `html:root *, html:root *::before, html:root *::after { animation: none !important; transition: none !important; caret-color: transparent !important; scroll-behavior: auto !important; }` diff --git a/scripts/screenshots/journeys.mjs b/scripts/screenshots/journeys.mjs index 0a676ed7..edb74add 100644 --- a/scripts/screenshots/journeys.mjs +++ b/scripts/screenshots/journeys.mjs @@ -19,7 +19,9 @@ const GITHUB = 'http://github.test:5198' const SITE = 'https://visualci.test' const APP = 'https://app.visualci.test' const MCP = 'https://mcp.visualci.test' -const NO_MOTION = '*, *::before, *::after { animation: none !important; transition: none !important; caret-color: transparent !important; }' +// `html:root` outranks a single-class rule: the app's reduced-motion `.spinner { animation: … !important }` kept +// spinners turning under `*` alone (4 Dec 2026, a spinner caught mid-turn on 03-picker-refreshing) +const NO_MOTION = 'html:root *, html:root *::before, html:root *::after { animation: none !important; transition: none !important; caret-color: transparent !important; }' await mkdir(out, { recursive: true }) const browser = await chromium.launch({ args: STEADY_RASTER }) @@ -41,8 +43,11 @@ async function journey(name, steps) { await context.route(/^https:\/\/([a-z0-9-]+\.)*visualci\.com\//, (route) => route.fulfill({ status: 404, body: '' })) const page = await context.newPage() let n = 0 - const shot = async (step) => { + // `syncing`: the shot is of the GitHub listing still loading. Every other shot waits for it to finish first: it runs in + // a queued job after each sign-in, and a shot that catches it loading depends on timing (4 Dec 2026, build 517) + const shot = async (step, { syncing = false } = {}) => { await page.waitForLoadState('networkidle').catch(() => {}) + if (!syncing) await page.locator('.github-sync[aria-live]').first().waitFor({ state: 'detached', timeout: 30000 }) await page.addStyleTag({ content: NO_MOTION }).catch(() => {}) await page.evaluate(() => document.fonts.ready).catch(() => {}) // Two frames, so a re-render the last request caused (a refetch after a finished import) has painted @@ -527,7 +532,7 @@ await journey('sign-in-redirects-at-once-and-lists-after', async ({ page, shot } await page.goto(`${APP}/${org}/repositories`) await page.getByText('1–50 of 120').waitFor() await page.getByText('Loading your repositories from GitHub…').waitFor() - await shot('picker-refreshing') + await shot('picker-refreshing', { syncing: true }) await page.getByText('Loading your repositories from GitHub…').waitFor({ state: 'detached', timeout: 25000 }) // A listing GitHub fails: said so, the last one kept, and "Try again" lists them