Portal screenshots: capture script + docs site embeds#3
Merged
Conversation
Playwright + pg seeder under scripts/screenshots/ that truncates and re-seeds audit_events / audit_payloads / api_keys with deterministic mock data, then drives Chromium through every portal page in light and dark mode. Captures land in docs/images/portal/ at 1440x900 @ 2x. Wired into Make as `make screenshots`. Home page (docs/overrides/home.html) gains the carousel + lightbox section; operations/portal.md embeds the same captures inline via mkdocs-material's #only-light / #only-dark fragments. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cjimti
added a commit
that referenced
this pull request
May 10, 2026
Portal screenshots: capture script + docs site embeds
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings api-test up to parity with mcp-test on portal screenshots: a Playwright-driven capture script, the 18 PNGs it produces, the home-page carousel, and inline embeds across
docs/operations/portal.md.The home page previously had a placeholder note saying "the portal-screenshots carousel that mcp-test ships in this template is omitted here" — that's gone; the carousel is live.
What's in here
scripts/screenshots/— the capture pipelineA standalone Node project (Playwright +
pg) that:audit_events/audit_payloads/api_keys, then inserts 100 fixed-PRNG audit events spread over the last 75 minutes (skewed toward recent), 20 of them with full payload rows, plus 3 demo API keys. Same input → same PNGs, so git diffs only show real visual changes.localStorage["api-test-theme"]) and API key (sessionStorage["api-test-api-key"]) before navigation, captures at 1440×900 @ 2× DPR, and writes todocs/images/portal/<slug>-{light,dark}.png.audit-detailcapture clicks the first row matching a seeded payload event before snapping.Adapted from mcp-test's
screenshots.mjsto api-test's reality:method/path/status/route_name/endpoint_group) instead of MCP'stool_name/tool_group.audit_payloadsuses BYTEA bodies + JSONB headers / query (not the MCP shape withresponse_result/notifications).api-test-api-key,api-test-theme,APITEST_DEV_KEY,APITEST_BASE_URL,APITEST_DATABASE_URL.audit-compare,audit-livetail,audit-jsonb,tools-tryit,wellknown) — those features don't exist in api-test's M3 portal.endpoints(catalog),endpoints-detail(deep-linked to/portal/endpoints/flakyso the right-pane card renders), andabout.make screenshotsMirrors the mcp-test target: sources
.env.devforAPITEST_DEV_KEY, runsnpm installon first invocation, executesscreenshots.mjsagainstSHOTS_BASE_URL(defaulthttp://localhost:8080).Captures — 18 PNGs
9 screens × 2 themes:
logindashboardendpointsendpoints-detailflaky(method/path/group/auth/description/curl hint).auditaudit-detail[redacted]Authorization and Cookie.keysci-runner,alice-personal,demo-only).configaboutdocs/overrides/home.htmlAdds the carousel + lightbox markup between the hero and the capabilities grid. Reuses the existing
shots.jsandextra.css(already wired intomkdocs.yml), so no new assets needed. Captions are api-test-specific (HTTP requests, not MCP tool calls).docs/operations/portal.mdDrops the stale "Lands in M3" admonition (M3 shipped in #2). Adds inline
#only-light/#only-darkmkdocs-material image embeds at every page section so readers see the actual UI alongside the prose.Verification
make screenshotsruns end-to-end in ~10 s againstmake dev's stack and produces all 18 PNGs.make docs(mkdocs build --strict) passes — no broken image references, no Jinja errors in the carousel template.dashboard-light.png,audit-detail-dark.png,endpoints-detail-light.png: seeded data renders cleanly in both themes; redacted headers show as expected.Test plan
make devin one terminal,make screenshotsin another → all 18 PNGs land indocs/images/portal/.make docs-serve→ home page carousel cycles through all 8 slides; click any frame to open the lightbox; arrow keys / side rails navigate; Esc closes.operations/portal.mdswaps the matching PNG.make screenshotson an unchanged binary and confirmgit statusreports no diff (deterministic seed).