diff --git a/scripts/ci/visual.sh b/scripts/ci/visual.sh index fddfef61..e60af73f 100755 --- a/scripts/ci/visual.sh +++ b/scripts/ci/visual.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -# VisualCI tests itself: seed a database, start the server against it, take screenshots of the landing page, docs and -# app, and send them to VisualCI in one build with the Vitest component snapshots, the request tests' JSON snapshots -# and a few files the site serves to agents. CI runs it in the `visual` job (.github/workflows/ci.yml); it also runs on -# a dev machine with Postgres and S3 storage (MinIO or RustFS) up. +# VisualCI tests itself: seed a database, start the server against it, take screenshots of the landing page, the docs +# home and the app, and send them to VisualCI in one build with the Vitest component snapshots, the request tests' JSON +# snapshots and a few files the site serves to agents. CI runs it in the `visual` job (.github/workflows/ci.yml); it +# also runs on a dev machine with Postgres and S3 storage (MinIO or RustFS) up. # # scripts/ci/visual.sh capture seed, serve, take screenshots and component snapshots into tmp/visual # scripts/ci/visual.sh upload send tmp/visual (and $VISUAL_JSON_DIR) to VisualCI as one build, and finalize it diff --git a/scripts/screenshots/capture.mjs b/scripts/screenshots/capture.mjs index 2064de8c..57457959 100644 --- a/scripts/screenshots/capture.mjs +++ b/scripts/screenshots/capture.mjs @@ -1,4 +1,4 @@ -// VisualCI's own screenshots: the landing page, the docs and the app, against a server seeded with +// VisualCI's own screenshots: the landing page, the docs home and the app, against a server seeded with // `visualci-server task screenshots:seed` (server/src/tasks/screenshots_seed.rs). Each page is taken at 1440 and 390 px // wide, light and dark, as `/-.png` under the output folder, for `visualci upload`. // @@ -104,6 +104,10 @@ async function main() { locale: 'en-US', timezoneId: 'UTC', }) + // The site's figures come from VisualCI's own production gallery, which changes when its screenshots are approved: + // a screenshot of them would follow production. Each is refused here, so the page shows its description in their + // place, the same every run. + await ctx.route('https://app.visualci.com/g/**', (route) => route.fulfill({ status: 404, body: '' })) await ctx.addInitScript((css) => { document.addEventListener('DOMContentLoaded', () => { const style = document.createElement('style') diff --git a/scripts/screenshots/pages.mjs b/scripts/screenshots/pages.mjs index 22bcfbdb..998b5364 100644 --- a/scripts/screenshots/pages.mjs +++ b/scripts/screenshots/pages.mjs @@ -5,17 +5,9 @@ export const NOW = '2026-11-20T15:00:00Z' export const EMAIL = 'ada@example.com' -const DOCS = [ - 'index', 'quick-start', 'agents', 'pdfs', 'screenshots', 'support', - 'ci/github-actions', 'ci/circleci', 'ci/buildkite', 'ci/gitlab', 'ci/other', - 'snapshots/jest', 'snapshots/vitest', 'snapshots/insta', 'snapshots/syrupy', 'snapshots/rspec-snapshot', - 'reference/cli', 'reference/api', 'reference/credits', -] - -// Every page at both widths and both themes, except the docs: they share one layout, so each docs page is taken at -// 1440 light and 390 dark, which still covers both widths and both themes. +// Every page at both widths and both themes. The docs share one layout, so only the docs home (with the sidebar) is +// taken, to catch a CSS regression across the docs: every page of them was CI minutes for nothing (Nathan, 2 Dec 2026). const ALL = ['1440-light', '1440-dark', '390-light', '390-dark'] -const DOCS_VARIANTS = ['1440-light', '390-dark'] /** The pages: [name, path or async (api) => path, signed in?, variants]. */ export function pages() { @@ -27,7 +19,7 @@ export function pages() { } return [ ['landing', '/', false, ALL], - ...DOCS.map((slug) => [`docs/${slug}`, slug === 'index' ? '/docs/' : `/docs/${slug}/`, false, DOCS_VARIANTS]), + ['docs/index', '/docs/', false, ALL], ['app/orgs', '/', true, ALL], ['app/org', '/acme', true, ALL], ['app/project/builds', '/acme/web', true, ALL], diff --git a/server/frontend/src/pages/SnapshotPage.tsx b/server/frontend/src/pages/SnapshotPage.tsx index 61962415..5e034b9d 100644 --- a/server/frontend/src/pages/SnapshotPage.tsx +++ b/server/frontend/src/pages/SnapshotPage.tsx @@ -53,6 +53,22 @@ const isTyping = (t: EventTarget | null) => t instanceof HTMLElement && (t.isContentEditable || ['INPUT', 'TEXTAREA', 'SELECT'].includes(t.tagName)) export function SnapshotPage() { + // What sticks below the review bar (the page list, the shortcut help) sits under it however many rows it wraps to. + const observer = useRef(null) + const reviewBar = useCallback((bar: HTMLDivElement | null) => { + const root = document.documentElement + observer.current?.disconnect() + if (!bar) { + root.style.removeProperty('--review-bar-h') + return + } + const set = () => root.style.setProperty('--review-bar-h', `${bar.offsetHeight}px`) + set() + if (typeof ResizeObserver !== 'undefined') { + observer.current = new ResizeObserver(set) + observer.current.observe(bar) + } + }, []) const { org, project, number, id } = route.useParams() const navigate = useNavigate() const [fullText, setFullText] = useState(false) @@ -241,7 +257,7 @@ export function SnapshotPage() { >
-
+