Help Center screenshots
Every image in the Help Center (frontend/public/help) is produced by one job,
scripts/help-screenshots. Run it whenever a change alters a screen an article
shows, and commit the new PNGs with the change.
./scripts/help-screenshots/run.sh # every shot
./scripts/help-screenshots/run.sh views- tags- # only shots whose name contains one of these
./scripts/help-screenshots/run.sh --list # list shots and personas
The first run creates a Playwright virtualenv in scripts/help-screenshots/.venv
and downloads Chromium. It needs the backend virtualenv (backend/venv) and the
frontend dependencies (frontend/node_modules) already installed.
What it does
- Seeds a scratch database.
seed.pybuilds a fresh SQLite database and media folders underscripts/help-screenshots/.scratch/(git-ignored). It never touches a real database. The demo team is fictional: Northwind Adjusting, with Dana Reyes (team admin), three adjusters, a new user, and claim NW-20481, whose Living Room holds a real walkthrough video that was processed once. Its frames, item crops, transcript and 31 items are checked in underfixtures/living-room, so no AI runs. - Boots the app locally. The backend runs with
APP_ENV=localand the local auth bypass, signed in as the shot's persona. The frontend runs withnext dev. Ports default to 8093 and 3093 (SHOTS_API_PORT,SHOTS_WEB_PORT). No API keys are passed through, so nothing reaches OpenRouter, Deepgram, Adjust Square or ContentsEstimation. - Captures each shot with Playwright at 1440x900 and 2x scale, cropping to
elements on the page, and writes the PNG straight into
frontend/public/help.
Adding or changing a shot
- One function per image in
shots/<topic>.py, registered with@shot("file-name.png"). The name must match the article'ssrcexactly. - Crop with
c.box(...)/c.capture(selector)around elements (preferdata-guideattributes) rather than fixed pixel boxes, so layout changes move the crop with them. - Pick a persona with
@shot(..., persona="ned"):danais the default.ava,benandcaraare adjusters.nedis a new user.opsis the only internal admin, used only for Logs and Admin pages, so customer-facing shots never show admin menu items.switch_all,switch_some,switch_onlyandswitch_offare four people with a pushed product access record, one per state of the product menu (seeds/product_access.py). They are not on the demo team and have no seeded user: a seed module may exportPERSONAS = {key: email}for people like that, and the local sign-in creates them when a shot first runs as them. Their keys sort afteropson purpose, so the admin shots are taken before they exist.
- Extra demo data for a topic goes in
seeds/<topic>.pyasasync def seed(db, s). Give a topic a claim of its own where you can, so its data cannot shift another topic's shots.seeds/room_photos.py(claim NW-20547) is the model for ContentsCapture data: scoping photos asstaged_photos, theuploadsrows that say who captured them and when, and an import batch naming the specialist. It seeds no storage connection, which would change the Integrations shots. - A shot that changes data sets
reseed=True. - Never seed a job in a processing status (
pending,extracting,analyzingand so on): the backend's startup recovery requeues those and runs a real pipeline. Seed it paused (for exampleawaiting_confirmation), flip it in the scratch database inside the shot, then flip it back.job_state()inshots/uploads.pydoes this. - Photos used as illustrations (the filming tips) are listed in
STATICinshots/__init__.pyand left alone.
backend/tests/test_help_screenshots.py keeps the job and the articles in step:
it fails when an article references an image no shot produces, when a shot is
unused, when a referenced image is missing, or when public/help holds an image
no article uses.