Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/ci/visual.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 5 additions & 1 deletion scripts/screenshots/capture.mjs
Original file line number Diff line number Diff line change
@@ -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 `<page>/<width>-<theme>.png` under the output folder, for `visualci upload`.
//
Expand Down Expand Up @@ -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')
Expand Down
14 changes: 3 additions & 11 deletions scripts/screenshots/pages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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],
Expand Down
18 changes: 17 additions & 1 deletion server/frontend/src/pages/SnapshotPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<ResizeObserver | null>(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)
Expand Down Expand Up @@ -241,7 +257,7 @@ export function SnapshotPage() {
>
<OldSide.Provider value={comparedPrevious ? `Build #${previous.build}` : 'Base'}>
<div className="review">
<div className="review-bar">
<div className="review-bar" ref={reviewBar}>
<div className="review-bar-id">
<Link
to="/$org/$project/builds/$number"
Expand Down
41 changes: 18 additions & 23 deletions server/frontend/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -2203,21 +2203,24 @@ a.stat-cell:hover {
display: grid;
}

/* The snapshot's name, the view modes and the review controls, wrapping onto more rows when they don't fit (they
never overlap). Its height is published as --review-bar-h (SnapshotPage) for what sticks below it. */
.review-bar {
position: sticky;
top: var(--topbar-h);
z-index: 15;
display: grid;
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--space-4);
gap: var(--space-2) var(--space-4);
padding: var(--space-2) var(--space-4);
background: var(--color-paper);
border-bottom: 1px solid var(--color-rule);
}

.review-bar-id {
display: flex;
flex: 1 1 18rem;
align-items: center;
gap: var(--space-2);
min-width: 0;
Expand Down Expand Up @@ -2248,9 +2251,11 @@ a.stat-cell:hover {

.review-bar-end {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
gap: var(--space-2);
margin-left: auto;
}

.pager {
Expand Down Expand Up @@ -2278,7 +2283,7 @@ a.stat-cell:hover {
.shortcut-help {
position: fixed;
right: var(--space-4);
top: calc(var(--topbar-h) + 64px);
top: calc(var(--topbar-h) + var(--review-bar-h, 57px) + var(--space-2));
z-index: 30;
width: 300px;
padding: var(--space-3) var(--space-4) var(--space-4);
Expand Down Expand Up @@ -2335,8 +2340,8 @@ a.stat-cell:hover {

.page-rail {
position: sticky;
top: calc(var(--topbar-h) + 57px);
max-height: calc(100dvh - var(--topbar-h) - 57px);
top: calc(var(--topbar-h) + var(--review-bar-h, 57px));
max-height: calc(100dvh - var(--topbar-h) - var(--review-bar-h, 57px));
overflow-y: auto;
padding: var(--space-4) var(--space-2) var(--space-4) var(--space-4);
}
Expand Down Expand Up @@ -2475,7 +2480,7 @@ a.stat-cell:hover {
border: 1px solid var(--color-rule);
border-radius: var(--radius-lg);
background: var(--color-surface);
scroll-margin-top: calc(var(--topbar-h) + 72px);
scroll-margin-top: calc(var(--topbar-h) + var(--review-bar-h, 57px) + var(--space-4));
transition: border-color var(--dur) var(--ease-out);
}

Expand Down Expand Up @@ -2960,7 +2965,7 @@ svg.regions-dim {
.tdiff-hunk {
min-width: max-content;
border-left: 2px solid transparent;
scroll-margin-top: calc(var(--topbar-h) + 72px);
scroll-margin-top: calc(var(--topbar-h) + var(--review-bar-h, 57px) + var(--space-4));
}

.tdiff-hunk[data-active] {
Expand Down Expand Up @@ -3652,18 +3657,9 @@ svg.regions-dim {

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
.review-bar {
grid-template-columns: minmax(0, 1fr) auto;
}

/* The view modes get a row of their own. */
.review-bar .seg {
grid-row: 2;
grid-column: 1 / -1;
justify-self: start;
}

.page-rail {
top: calc(var(--topbar-h) + 97px);
order: 3;
}
}

Expand Down Expand Up @@ -3797,18 +3793,17 @@ svg.regions-dim {
}

.review-bar {
grid-template-columns: minmax(0, 1fr);
padding: var(--space-2) var(--space-3);
gap: var(--space-2);
}

.review-bar .seg {
justify-self: start;
.review-bar-id {
flex-basis: 100%;
}

.review-bar-end {
justify-content: space-between;
flex-wrap: wrap;
margin-left: 0;
}

.review-bar-end .check-inline span,
Expand Down
6 changes: 2 additions & 4 deletions visualci.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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/**"]
Loading