From 427e5babb0e42d3511dd0e36c34b370727359411 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Wed, 2 Dec 2026 16:31:09 +1300 Subject: [PATCH 1/2] Screenshots: the docs home only, and the gallery shows the app only. CI took every docs page (38 screenshots of one shared layout); it now takes the docs home with its sidebar at both widths and both themes, to catch a CSS regression across the docs. The landing page and the docs home are still compared but no longer published: the gallery (and visualci.com/screenshots/) is the web app, on desktop and phone --- scripts/ci/visual.sh | 8 ++++---- scripts/screenshots/capture.mjs | 2 +- scripts/screenshots/pages.mjs | 14 +++----------- visualci.yml | 6 ++---- 4 files changed, 10 insertions(+), 20 deletions(-) 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..b8cbbc2e 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`. // 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/visualci.yml b/visualci.yml index 8c42c4a0..6de4e4dd 100644 --- a/visualci.yml +++ b/visualci.yml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=https://visualci.com/visualci.schema.json # VisualCI's own screenshots, published as its public gallery (https://visualci.com/docs/gallery/): each URL serves the -# approved version on main. The manifest is https://app.visualci.com/g/docspring/visualci.json. +# approved version on main. The manifest is https://app.visualci.com/g/docspring/visualci.json. Only the app is +# published: the landing page and the docs home are taken to catch regressions, not to show. gallery: groups: - name: App @@ -9,6 +10,3 @@ gallery: - name: Phone title: The web app on a phone include: ["screenshots/app/**/390-light", "screenshots/app/**/390-dark"] - - name: Site - title: visualci.com and its docs - include: ["screenshots/landing/*", "screenshots/docs/**"] From 37c33e2166f8ccd22d9b0c0c0b2dd24b3915d076 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Wed, 2 Dec 2026 16:44:48 +1300 Subject: [PATCH 2/2] Fix two regressions on main that this PR's review found: on the snapshot page the review controls no longer spill over the view modes at wide widths (the bar wraps onto more rows, and what sticks below it follows its measured height, --review-bar-h); and the landing page's screenshot no longer depends on production's gallery (capture refuses app.visualci.com/g/, so the figure shows its description, the same every run) --- scripts/screenshots/capture.mjs | 4 +++ server/frontend/src/pages/SnapshotPage.tsx | 18 +++++++++- server/frontend/src/styles.css | 41 ++++++++++------------ 3 files changed, 39 insertions(+), 24 deletions(-) diff --git a/scripts/screenshots/capture.mjs b/scripts/screenshots/capture.mjs index b8cbbc2e..57457959 100644 --- a/scripts/screenshots/capture.mjs +++ b/scripts/screenshots/capture.mjs @@ -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/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() { >
-
+