Add App Store screenshot generation#170
Merged
Merged
Conversation
Add AppStoreScreenshotPreview.swift (DEBUG-only) to render an App Store screenshot preview using SwiftUI/NSViewRepresentable and custom drawing for sample window, traffic lights and rulers. Update project.pbxproj to add the new file reference and include it in the target's Sources/build files so the preview is available in Debug builds.
Add programmatic App Store screenshot generation and tooling. AppDelegate (DEBUG) now recognizes --generate-app-store-screenshots <dir> to render and export screenshots then exit. Implement AppStoreScreenshotRenderer to render scenario views to PNG, plus UI tweaks (ruler borders, titlebar divider, drawing fixes) in AppStoreScreenshotPreview. Add scripts/generate-app-store-screenshots.sh and a package.json script (generate:screenshots) to build and run the app for export. Include three generated screenshots in appstore/screenshots/.
Introduce layout constants and computed rects for screen1 (gutters, widths, heights, border color/width/radius) and sampleWindowContentRect to position box regions inside the sample window. Add drawScreen1Boxes() to render three screen1 boxes and a stroke(_:,color:,width:,radius:) helper to support rounded border drawing (plus a convenience overload). Update the screenshot asset as well. These changes visually mark subregions in the App Store preview sample window.
Owner
Author
|
@copilot please review this PR. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a debug-only, in-app renderer for generating App Store marketing screenshots, plus a script/NPM command to build the app and export the images to appstore/screenshots. This fits the codebase’s existing approach of generating assets from code (similar to the app icon generation scripts).
Changes:
- Add
AppStoreScreenshotRenderer+ SwiftUI preview scenarios to render three screenshot layouts in Debug builds. - Add a
--generate-app-store-screenshots <dir>debug-only app launch mode to export PNGs and exit. - Add
scripts/generate-app-store-screenshots.shandnpm run generate:screenshotsto build + run the generator.
Reviewed changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/generate-app-store-screenshots.sh | Builds the Debug app to a dedicated DerivedData path and runs the screenshot export mode. |
| package.json | Adds generate:screenshots convenience script. |
| Free Ruler/AppStoreScreenshotPreview.swift | Implements the screenshot scene layouts, rendering, and PNG export (Debug-only). |
| Free Ruler/AppDelegate.swift | Adds a debug-only CLI flag handler to generate screenshots and terminate. |
| Free Ruler.xcodeproj/project.pbxproj | Adds the new screenshot preview/source file to the project build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reviewed the PR changes and I don’t see any blocking issues. The screenshot layout/drawing additions look correct and low risk. |
Switch colorSpaceName from .calibratedRGB to .deviceRGB in AppStoreScreenshotPreview to ensure screenshots are rendered with the device color space. Also replace three App Store screenshot assets (appstore/screenshots/01-measure-anything.png, 02-switch-units.png, 03-customize-rulers.png) with updated images.
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
appstore/screenshotsnpm run generate:screenshotsfor regenerating screenshots from the appCloses #169.
Test Plan
xcodebuild -project "Free Ruler.xcodeproj" -scheme "Free Ruler" buildnpm run generate:screenshots