You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci(docs): capture panel screenshots in light + dark at 1920x1080 full-page (#1429)
Until now the docs site's auto-captured screenshots were single-theme
(whatever default the inline FOUC bootloader resolved to — light) at
a 1280x800 viewport with viewport-only crops. That under-represented
the panel chrome on three axes:
- Dark mode is roughly half the panel UX (the user-toggled
`localStorage['sbpp-theme']` value is `'dark'` or `'system'` for
a meaningful share of operators) and went entirely uncaptured.
- 1280x800 cuts off tier-3 desktop-table columns (IP / Length /
Banned / Started; see AGENTS.md "Responsive desktop-table
chrome") that only appear at viewport >=1788px on the
1700px-capped bans / comms list pages.
- Viewport-only crops truncated long pages (banlist, dashboard,
admin sub-routes) at the fold.
This change makes the trusted-from-main capture script emit:
- 1920x1080 (Full HD) viewport with `fullPage: true` so the
entire scrollable surface lands in the PNG.
- Two captures per panel route — `panel-02-dashboard-light.png`
and `panel-02-dashboard-dark.png`, etc. The dark pass spins up
its own browser context with `colorScheme: 'dark'` and seeds
`localStorage['sbpp-theme'] = 'dark'` via Playwright's
`addInitScript` BEFORE any navigation, so the inline FOUC
bootloader in `core/header.tpl` lands `<html class="dark">` on
the very first paint (no white flash; matches the contract
documented in AGENTS.md "Anti-FOUC theme bootloader").
- Install routes stay light-only and keep the bare `install-NN-*`
filename. The wizard's `_chrome.tpl` doesn't load `theme.js`
or the FOUC bootloader (no theme toggle by design — see
AGENTS.md "Install wizard"), so a "dark install" capture would
just be the same light render under a different filename.
The output subdirectory is wiped at the start of each run
(per-route-group, so `CAPTURE_ROUTES=panel` doesn't clobber a
previous install pass) so the legacy single-theme PNGs from the
pre-dual-theme runs (e.g. `panel-02-dashboard.png`) don't linger
in the committed diff.
The workflow's two-pass `CAPTURE_ROUTES=panel` / `=install`
structure (with the `web/config.php` stash/restore around the
install pass for the #1335 C2 guard) is unchanged — the dual-theme
loop happens INSIDE the panel pass via `capture.mjs`, so no new
env vars and no new step needed. The split-checkout security
model (capture script from main, panel under test from PR head,
auto-commit pushes from PR head) is untouched.
Verification:
- `node --check scripts/capture.mjs` (matches the
`docs-screenshots-build.yml` per-PR gate).
- `python3 yaml.safe_load` on the workflow YAML.
0 commit comments