Skip to content

Add a script that screenshots a PR before and after - #1437

Merged
dannyvfilms merged 2 commits into
dannyvfilms:latestfrom
crimsonsunset:tooling/pr-screenshots-upstream
Oct 3, 2026
Merged

dannyvfilms merged 2 commits into
dannyvfilms:latestfrom
crimsonsunset:tooling/pr-screenshots-upstream

Conversation

@crimsonsunset

Copy link
Copy Markdown

Summary

scripts/pr_screenshots.py captures before/after screenshots of a PR (merge-base vs head) at desktop and phone width in light and dark, and with --post writes them into the PR description. It exists so UI PRs can carry visual proof without taking shots by hand across branches.

Changes overview

  • scripts/pr_screenshots.py: serves each commit from a throwaway git worktree with its own SQLite database and a private Redis (port 6391), drives headless Chromium, uploads images to the fork and rewrites a marked block of the PR description.
  • scripts/pr_screenshots_seed.py: seeds a shots user, movies, and a band/album/tracks. Tolerates fields and routes a commit does not have yet.
  • docs/agents/pr_screenshots.md: usage, page selection, requirements, limits.
  • AGENTS.md: one line in the Agent Docs list.

Key technical decisions

  • Worktrees, not branch switching, so the working tree is never touched.
  • Images upload through the undocumented uploads.github.com/user-attachments/assets endpoint using the gh token. It only accepts repos you can push to, so images go to the fork and are referenced from the upstream PR.
  • Pages per PR live in a PR_PAGES dict, not a config file.

Test plan

Docs

  • docs/agents/pr_screenshots.md

crimsonsunset and others added 2 commits October 2, 2026 14:50
- Serves the merge-base and head from throwaway worktrees with a seeded database
- Captures desktop and phone in light and dark, and can post them to the PR description
- Document usage in docs/agents/pr_screenshots.md
@dannyvfilms
dannyvfilms enabled auto-merge October 3, 2026 00:59
@dannyvfilms
dannyvfilms merged commit 516fa05 into dannyvfilms:latest Oct 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants