Add a script that screenshots a PR before and after - #1437
Merged
dannyvfilms merged 2 commits intoOct 3, 2026
Merged
dannyvfilms merged 2 commits into
dannyvfilms merged 2 commits into
Conversation
- 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
enabled auto-merge
October 3, 2026 00:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/pr_screenshots.pycaptures before/after screenshots of a PR (merge-base vs head) at desktop and phone width in light and dark, and with--postwrites 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 ashotsuser, 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
uploads.github.com/user-attachments/assetsendpoint using theghtoken. It only accepts repos you can push to, so images go to the fork and are referenced from the upstream PR.PR_PAGESdict, not a config file.Test plan
--post; uploaded images loaduv run --no-sync python scripts/pr_screenshots.py <pr> --no-beforeon a PR of your ownuv run --no-sync ruff check scripts/pr_screenshots.py scripts/pr_screenshots_seed.pyDocs
docs/agents/pr_screenshots.md