Skip to content

Add one-command website screenshot regeneration #261

Description

@jongio

As a contributor updating Dispatch UI states, themes, or website docs, I want a single documented command to regenerate and verify all website screenshots so visual changes are easy to review and do not depend on knowing the Go and Node internals.

flowchart TD
    A[Change TUI or theme] --> B[Run screenshot command]
    B --> C[Capture HTML via cmd/screenshots]
    C --> D[Render PNGs with Playwright]
    D --> E[Review web/public/screenshots diff]
Loading

Problem

The screenshot system is powerful but hard to discover: cmd/screenshots/main.go captures TUI states behind the screenshots build tag, cmd/screenshots/render.mjs requires Playwright, scripts/screenshots.ps1 wires the steps together only for PowerShell, and web/package.json has no screenshot script. Contributors on macOS/Linux or those working from the website package may not know how to regenerate web/public/screenshots consistently.

Proposed solution

Add a cross-platform screenshot entry point, such as go run -tags screenshots ./cmd/screenshots --out web/public/screenshots plus node cmd/screenshots/render.mjs, exposed through web/package.json (npm run screenshots) and a shell wrapper alongside scripts/screenshots.ps1. Document prerequisites and commands in README and the website development docs, add a lightweight CI/check mode that verifies the generator runs against internal/data/testdata/fake_sessions.db, and add tests or script checks around argument parsing/output paths in cmd/screenshots/main.go.

User impact

Contributors can update screenshots confidently in one command, reviewers get reproducible visual diffs, and the website remains aligned with the real TUI states and themes.

Acceptance criteria

  • A documented npm run screenshots or equivalent one-command workflow regenerates screenshots into web/public/screenshots from the repo root.
  • The workflow works on Windows PowerShell and macOS/Linux shells without requiring contributors to inspect cmd/screenshots internals.
  • Playwright and other Node prerequisites are declared in web/package.json or documented with an install command.
  • README or contributor docs explain when to run the screenshot workflow and how to review generated diffs.
  • A CI-friendly check or test exercises the screenshot capture path against internal/data/testdata/fake_sessions.db without committing transient HTML files.

Complexity

M

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestideaFeature idea from the idea pipeline

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions