end to end app store screenshot creation using AI
TypeScript agentic-aiappleappstoreautomateclaudecursordesigngenerateiosios-appmarketingscreenshotskillsskills-shswiftswiftuiui
fix(mac): contain the Mac window and give it a true 16:10 screen
Parth Jadhava9d88b37b20c
diff --git a/skills/app-store-screenshots/template/src/components/editor/device-frames.tsx b/skills/app-store-screenshots/template/src/components/editor/device-frames.tsxindex 27eb71f..3e88a95 100644--- a/skills/app-store-screenshots/template/src/components/editor/device-frames.tsx+++ b/skills/app-store-screenshots/template/src/components/editor/device-frames.tsx@@ -1,6 +1,6 @@"use client";import * as React from "react";-import { PHONE_SCREEN } from "@/lib/constants";+import { MAC_RATIO, MAC_TITLE_BAR, PHONE_SCREEN } from "@/lib/constants";import { img } from "@/lib/image-cache";type FrameProps = {@@ -219,17 +219,33 @@ export function AndroidTabletL({ src, alt = "", style, hideEmpty }: FrameProps));}+// Mac window: title bar + a content area that is exactly 16:10, the Mac App+// Store's own aspect, so a full-screen or 16:10 capture fills it uncropped.export function MacWindow({ src, alt = "", style, hideEmpty }: FrameProps) {const resolved = img(src);+ const titleBar = `${(MAC_TITLE_BAR / (1 + MAC_TITLE_BAR)) * 100}%`;+ const light = (color: string) => (+ <span+ style={{+ width: "1.1%",+ aspectRatio: "1",+ borderRadius: "50%",+ background: color,+ boxShadow: "inset 0 0 0 0.5px rgba(0,0,0,0.25)",+ flexShrink: 0,+ }}+ />+ );return (- <div style={{ position: "relative", aspectRatio: "16 / 10", ...style }}>+ <div style={{ position: "relative", aspectRatio: `${MAC_RATIO}`, ...style }}><divstyle={{width: "100%",height: "100%",- borderRadius: "2.2% / 3.5%",- background: "linear-gradient(180deg, #3A3A3C 0%, #2C2C2E 8%, #1C1C1E 100%)",- boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.12), 0 18px 60px rgba(0,0,0,0.45)",+ // Circular corners: the vertical radius is scaled by the frame aspect.+ borderRadius: `1.1% / ${1.1 * MAC_RATIO}%`,+ background: "#1C1C1E",+ boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.12), 0 18px 60px rgba(0,0,0,0.40)",overflow: "hidden",display: "flex",flexDirection: "column",@@ -237,21 +253,22 @@ export function MacWindow({ src, alt = "", style, hideEmpty }: FrameProps) {><divstyle={{- height: "7%",+ height: titleBar,+ boxSizing: "border-box",display: "flex",alignItems: "center",- gap: "1.1%",- padding: "0 1.6%",- background: "linear-gradient(180deg, #4A4A4C 0%, #3A3A3C 100%)",- borderBottom: "1px solid rgba(0,0,0,0.35)",+ gap: "0.75%",+ padding: "0 1.3%",+ background: "linear-gradient(180deg, #3D3D40 0%, #323235 100%)",+ boxShadow: "inset 0 -1px 0 rgba(0,0,0,0.35)",flexShrink: 0,}}>- <span style={{ width: "1.35%", aspectRatio: "1", borderRadius: "50%", background: "#FF5F57", boxShadow: "inset 0 0 0 0.5px rgba(0,0,0,0.25)" }} />- <span style={{ width: "1.35%", aspectRatio: "1", borderRadius: "50%", background: "#FEBC2E", boxShadow: "inset 0 0 0 0.5px rgba(0,0,0,0.25)" }} />- <span style={{ width: "1.35%", aspectRatio: "1", borderRadius: "50%", background: "#28C840", boxShadow: "inset 0 0 0 0.5px rgba(0,0,0,0.25)" }} />+ {light("#FF5F57")}+ {light("#FEBC2E")}+ {light("#28C840")}</div>- <div style={{ flex: 1, overflow: "hidden", background: "#000", minHeight: 0 }}>+ <div style={{ flex: 1, overflow: "hidden", background: "#111", minHeight: 0 }}>{resolved ? (<imgsrc={resolved}diff --git a/skills/app-store-screenshots/template/src/components/editor/slide-canvas.tsx b/skills/app-store-screenshots/template/src/components/editor/slide-canvas.tsxindex 4b18f2c..a8550f7 100644--- a/skills/app-store-screenshots/template/src/components/editor/slide-canvas.tsx+++ b/skills/app-store-screenshots/template/src/components/editor/slide-canvas.tsx@@ -95,7 +95,7 @@ export function getFrameForDevice(device: Device, orientation: Orientation): {case "carplay":return { Comp: CarPlayScreen, widthFn: carPlayW, smallWidthFn: (cW, cH) => carPlayW(cW, cH, 0.7) };case "mac":- return { Comp: MacWindow, widthFn: macW, smallWidthFn: (cW, cH) => macW(cW, cH, 0.5) };+ return { Comp: MacWindow, widthFn: macW, smallWidthFn: (cW, cH) => macW(cW, cH, 0.46) };case "android":return { Comp: AndroidPhone, widthFn: phoneW, smallWidthFn: phoneWSmall };case "android-7":@@ -375,7 +375,7 @@ function getDefaultRects(fwFrac: number,fwSmallFrac: number,// Phones and tablets are deliberately hung past the canvas edge so they bleed off- // it. When true (TV, watch, CarPlay), every device rect stays fully inside the+ // it. When true (TV, watch, CarPlay, Mac), every device rect stays fully inside the// canvas instead.contain = false,): LayoutRects {@@ -488,8 +488,8 @@ function rectFor(}// Devices whose frame must never be cropped by the canvas edge. A clipped TV,-// head unit or watch face reads as a mistake, not as a deliberate bleed.-const CONTAINED_DEVICES: ReadonlySet<Device> = new Set<Device>(["tvos", "watchos", "carplay"]);+// head unit, watch face or Mac window reads as a mistake, not as a deliberate bleed.+const CONTAINED_DEVICES: ReadonlySet<Device> = new Set<Device>(["tvos", "watchos", "carplay", "mac"]);function getSlideGeometry(slide: Slide, device: Device, orientation: Orientation) {const { cW, cH } = getCanvas(device, orientation);diff --git a/skills/app-store-screenshots/template/src/lib/constants.ts b/skills/app-store-screenshots/template/src/lib/constants.tsindex a41371a..af9a615 100644--- a/skills/app-store-screenshots/template/src/lib/constants.ts+++ b/skills/app-store-screenshots/template/src/lib/constants.ts@@ -13,6 +13,8 @@ export const CANVAS: Record<Device, { w: number; h: number; wL?: number; hL?: nu// It is submitted in an iPhone slot, which accepts landscape, so the canvas is// the 6.9" iPhone size turned sideways to fit a wide head unit.carplay: { w: 2868, h: 1320 },+ // Mac App Store is landscape-only 16:10. Design at 2880x1800; every other Mac+ // slot is an exact 16:10 downscale.mac: { w: 2880, h: 1800 },android: { w: 1080, h: 1920 },"android-7": { w: 1200, h: 1920, wL: 1920, hL: 1200 },@@ -63,11 +65,13 @@ export const EXPORT_SIZES: Record<Device, ExportSize[]> = {{ label: '6.3" landscape', w: 2622, h: 1206 },{ label: '6.1" landscape', w: 2436, h: 1125 },],+ // App Store Connect display type APP_DESKTOP (Mac App Store). These four+ // 16:10 sizes are the only accepted dimensions.mac: [- { label: "2880×1800", w: 2880, h: 1800 },- { label: "2560×1600", w: 2560, h: 1600 },- { label: "1440×900", w: 1440, h: 900 },- { label: "1280×800", w: 1280, h: 800 },+ { label: "2880 x 1800", w: 2880, h: 1800 },+ { label: "2560 x 1600", w: 2560, h: 1600 },+ { label: "1440 x 900", w: 1440, h: 900 },+ { label: "1280 x 800", w: 1280, h: 800 },],android: [{ label: "Phone", w: 1080, h: 1920 }],"android-7": [{ label: '7" Portrait', w: 1200, h: 1920 }],@@ -104,7 +108,11 @@ export const WATCH_RATIO = 422 / 514; // Apple Watch Ultra, the largest accep// Widescreen 1920x720, Portrait 900x1200, Standard Video Playback 1920x1080.// "Standard" is the default here; change this constant to target another.export const CARPLAY_RATIO = 800 / 480;-export const MAC_RATIO = 16 / 10; // Mac App Store 16:10+// Mac window: a 16:10 content area under a title bar MAC_TITLE_BAR x the content+// height tall, so a 16:10 capture (the Mac App Store's own aspect) fills the+// window without being cropped.+export const MAC_TITLE_BAR = 0.045;+export const MAC_RATIO = 16 / (10 * (1 + MAC_TITLE_BAR));// iPhone mockup screen overlay (pre-measured)export const PHONE_SCREEN = {@@ -143,10 +151,10 @@ export function watchW(cW: number, cH: number, clamp = 0.52) {export function carPlayW(cW: number, cH: number, clamp = 0.86) {return Math.min(clamp, 0.58 * (cH / cW) * CARPLAY_RATIO);}-// A 16:10 window on a 16:10 canvas: keep it to ~62% of the canvas height so-// the caption above/below (and beside, in split-landscape) stays clear.+// Contained like the TV: height-bound so the window clears the caption block+// above or below it on the 16:10 canvas.export function macW(cW: number, cH: number, clamp = 0.86) {- return Math.min(clamp, 0.62 * (cH / cW) * MAC_RATIO);+ return Math.min(clamp, 0.58 * (cH / cW) * MAC_RATIO);}// ---------- Themes ----------