Skip to content

Add README and automate framed screenshots#2

Open
filiptronicek wants to merge 2 commits intomainfrom
ft/automated-readme-screenshots
Open

Add README and automate framed screenshots#2
filiptronicek wants to merge 2 commits intomainfrom
ft/automated-readme-screenshots

Conversation

@filiptronicek
Copy link
Copy Markdown
Member

@filiptronicek filiptronicek commented Apr 18, 2026

Closes #1.

Summary

  • Adds a README.md with project overview, build/test instructions, and a Screenshots table sourced from docs/screenshots/.
  • Extends .github/workflows/screenshots.yml so that, after fastlane snapshot runs, the iPhone 16 Pro captures are framed with viticci/frames-cli and committed back to main whenever the UI actually changes.

How the screenshot pipeline works

  1. fastlane snapshot runs the existing UI test on iPhone 16 Pro Max, iPhone 16 Pro and iPad Pro 13.
  2. The iPhone 16 Pro PNGs are renamed (device prefix stripped) and framed with Apple device bezels into docs/screenshots/*_framed.png.
  3. A Python step computes a 256-bit pHash (hash_size=16) of each freshly framed PNG and the same path at HEAD (via imagehash). When the Hamming distance is ≤ 5, the new bytes are replaced with the committed bytes — so simulator/encoder noise can't trigger a "screenshot refresh" commit.
  4. git add -A docs/screenshots then either commits genuine UI changes (and deletions, if a snapshot() call is removed) back to the branch, or no-ops.

The threshold and hash size are exposed as workflow env vars (SCREENSHOT_PHASH_THRESHOLD, SCREENSHOT_PHASH_SIZE) for easy tuning.

Things to verify on first green run

  • Branch protection on main allows github-actions[bot] pushes (otherwise the auto-commit step will fail and we should switch to a PR-based flow).
  • 5 is the right pHash threshold — the per-file KEEP / CHANGE / NEW log lines will tell us whether to tighten or loosen it.
  • The README screenshots only land in docs/screenshots/ after the workflow runs once on main; until then the README image links 404 by design.

Devices in the README

iPhone 16 Pro only, per discussion. The iPhone 16 Pro Max and iPad Pro 13 captures are still produced by the test (they're needed for App Store Connect) and uploaded as workflow artifacts, just not surfaced in the README.

filiptronicek and others added 2 commits April 18, 2026 17:46
Adds a README with build/test/regenerate instructions and a screenshots
table sourced from docs/screenshots/.

Extends the Screenshots workflow to install viticci/frames-cli, frame the
iPhone 16 Pro captures into docs/screenshots/, gate spurious diffs with an
imagehash perceptual hash check (Hamming distance \u2264 5 on a 16x16 pHash),
and commit any genuine UI changes back to main.

Closes #1.

Co-authored-by: Ona <no-reply@ona.com>
frames-cli refuses to run without its asset pack and 'frames setup' is
interactive. Download AppleFrames40.zip directly, cache it, and point
FRAMES_ASSETS at the extracted directory so the framing step works
headlessly in CI.

Co-authored-by: Ona <no-reply@ona.com>
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.

Screenshots in the README

1 participant