Repository navigation
feat(screenshots): capture every screen to PNG in CI - #9
Merged
Merged
Conversation
Add a `screenshots` feature (Linux) that runs a scene list through the real app and snapshots WebKitGTK's pixels, light and dark. The root element now carries a `data-theme` attribute that the stylesheet keys the dark tokens on. scripts/screenshots.sh runs the capture under Xvfb. A workflow uploads the images on pull requests with a diff summary against main, and publishes them to a `screenshots` branch on push to main for the README.
4 tasks
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
CI captures every screen of the real app as PNG, light and dark. The images live on an orphan
screenshotsbranch, so they always matchmainand never enter the code history.screenshotsfeature, Linux only): drives the app through 39 scenes using the app's own signals and the backend seam. Each scene captures WebKitGTK's own snapshot at 2x. On other targets the feature compiles to nothing.scripts/screenshots.sh [dir]: builds and runs the capture under Xvfb. Writeslight/*.pnganddark/*.png..github/workflows/screenshots.yml:scripts/screenshots-diff.sh).main: a separate job withcontents: writereplaces the single commit on thescreenshotsbranch. It skips the push when no screen changed.data-theme, and the dark tokens key on it.Notes
webkit2gtkandcairo-rs(pngfeature) are optional and Linux-only. wry and tao already build both.maincreates thescreenshotsbranch.cargo build --releaseoutput, renders unstyled. Dioxus loadsasset!files from the source tree only undercargo run. The script usescargo run, and README now says so.fonts-interandfonts-jetbrains-mono.Test plan
cargo clippy --workspace --all-targets --all-features -- -D warningscargo clippy --workspace --all-targets -- -D warningscargo nextest run --workspace --all-features: 283 passedscripts/screenshots.shlocally: 78 PNGs, byte-identical across two runsScreenshotsworkflow passes on this PR, and its artifact holds 78 PNGs