PR Screenshots
Screenshots in a PR are QA evidence. Each one shows what the real product
renders at one location, framed so a reviewer who has never opened the page can
tell what changed.
Step 1: List the Locations
List every place in the product that the diff reaches: each page, drawer,
modal, or widget that renders a changed component, found by tracing its
callers and consumers. Then add the states the change affects at each of them,
such as loading, error, empty, hover, selected, menu open, expanded, scrolled,
narrow viewport, and light or dark theme.
Never group surfaces into one row: for example,
"GridEditable, as in Discover, dashboards and insights" is three rows.
Step 2: Capture From the Real Product
Step 3: Redact and Audit
- Blur only private values: emails, usernames, customer or organization names
and slugs, IDs, and internal hostnames. Keep keys, labels, and non-sensitive
values readable, such as
browser.name → chrome.
- Paint over each region before blurring it so the blur can't be reversed.
Never use solid black or dark boxes, and never blur whole tables or rows.
- Read every image before uploading it and check for credentials: tokens, auth
headers, cookies, signed URLs, secret keys, and webhook endpoints. Remove
real leaks. Do not treat a public client DSN as a leak.
Step 4: Choose the Table Shape
Pixel-diff every before/after pair. Move a pair with no
visible difference, including anti-aliasing noise, to Unchanged with one
image. Leave out a table that would be empty.
**Changed**
| Location | Before | After |
| --- | --- | --- |
| Explore › Logs |  |  |
| Explore › Logs, loading |  |  |
**Unchanged**
| Location | Before & After |
| --- | --- |
| Trace view › Logs |  |
Formatting rules:
- Name the first column
Location, or Treatment for alternatives. Never
leave its header empty.
- Write each location as a
› breadcrumb of what the reader clicks through,
then a comma and the state: Monitors › cron monitor details › Check-Ins, loading.
- Use only the columns shown above. Never add a "What changed" or notes column;
the screenshots show the change.
- Give each image alt text naming its row and side, such as
Explore › Logs before.
- Label the tables with bold
**Changed** and **Unchanged** lines. Do not add
an intro sentence describing where or how the screenshots were taken.
- Use Markdown tables by default, because
gh --attach rewrites only Markdown
image references. Switch to an HTML table only when cells must span rows, such
as a light and dark row under one location
(Location | Theme | Before | After with rowspan="2" on the location cell).
Do not add align attributes.
Step 5: Upload With gh
gh pr create, gh pr edit, gh pr comment, and the matching gh issue
commands accept --attach '<path>#<alt text>' (gh 2.99.0+). If gh rejects
the flag, ask the user to upgrade it. Do not push asset branches, commit
images, or upload through the browser's comment box.
Write the body file with relative Markdown image references, then pass the same
paths to --attach. gh uploads each file and rewrites the matching reference
to the uploaded URL in place:
gh pr edit 123 --body-file pr-body.md \
--attach './shots/logs-before.png' --attach './shots/logs-after.png'
Before writing a body the user may have edited, fetch it again and compare it
with the version you last read. Keep the user's wording and table edits, swap in
only your rows and URLs, and keep the body's line endings. Removing an image
from the body does not delete the uploaded file.
Step 6: Keep Screenshots Current
When a later commit changes what a screenshot shows, retake the affected pairs,
re-check which pairs belong in Changed and Unchanged, and update the
body without waiting to be asked.