Regenerating screenshots
Every screenshot in these docs is captured from the deployed apps with the Playwright CLI at 2× pixel density: 1440 CSS pixels wide, so 2880-pixel PNGs, cropped to each page’s content height with --full-page and a short viewport. The files live in client/docs/src/assets/screenshots/, and Astro serves optimized versions of them.
How it works
Section titled “How it works”The apps keep their Cognito session in localStorage. So:
screenshots/login.mjssigns in to the admin console and the SaaS app once and saves each browser’s storage state toscreenshots/.auth/(git-ignored).screenshots/capture.shcaptures each page with the CLI, loading that state:
npx playwright screenshot --load-storage .auth/app.json --device "Desktop Chrome HiDPI" \ --viewport-size "1440, 200" --full-page --color-scheme light --wait-for-selector 'table tbody tr' \ --wait-for-timeout 1500 https://saas.haibui.click/products ../src/assets/screenshots/app-products.png--wait-for-selector waits until the page has loaded its data from the API, so no screenshot shows a loading state.
Regenerate
Section titled “Regenerate”-
Use a system admin, and a tenant user with a few products and orders. Use dedicated accounts, not real ones. For example:
Terminal window ./scripts/dev-create-tenant-user.sh <acme tenant id> BASIC TenantAdmin docs-demo '<password>' -
Install the browser once:
Terminal window cd client/docsnpm cinpx playwright install chromium -
Capture:
Terminal window ADMIN_USER=docs-bot ADMIN_PASSWORD='…' TENANT=acme TENANT_USER=docs-demo TENANT_PASSWORD='…' npm run screenshotsSet
ADMIN_URLandAPP_URLto capture a different deployment. -
Rebuild and deploy the docs with
./scripts/deploy-client.sh.