-
Notifications
You must be signed in to change notification settings - Fork 2
feat(Flyover): export a static QA atlas #270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kyleve
wants to merge
18
commits into
main
Choose a base branch
from
codex/static-flyover-qa-atlas
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+11,090
−161
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
65410b1
Add generic Flyover web exporter
kyleve 191a051
Expose hosted snapshot PNG captures
kyleve 14254e0
Export the Where Flyover atlas
kyleve 720ce86
Polish the Flyover web atlas review flow
kyleve 41fa765
Require completed work to be pushed
kyleve 4ad721b
Merge main into static Flyover QA atlas
kyleve 770ed51
Polish the Flyover web experience
kyleve 834a1d5
Merge main into static Flyover atlas
kyleve ac259f5
Fix test runner contract fixtures
kyleve ce10698
Harden Flyover web parity and performance
kyleve 180a5a8
Add Flyover preview server
kyleve b21f3ac
Load every visible Flyover screenshot
kyleve 26315d1
Prevent accidental Flyover page selection
kyleve 0975d22
Export light and dark Flyover profiles by default
kyleve 2df66ee
Make Flyover preview shutdown reliable
kyleve 6a13640
Merge remote-tracking branch 'origin/main' into codex/static-flyover-…
kyleve ef7c3e2
Fix final Flyover atlas review issues
kyleve b8ad552
Keep Flyover tooling from dirtying source
kyleve File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #if DEBUG | ||
| /// The amount of a registered screen that a web export captures. | ||
| public enum FlyoverCaptureExtent: String, Codable, CaseIterable, Sendable { | ||
| case viewport | ||
| case intrinsic | ||
| case fullContent | ||
| case fullContent2D | ||
| } | ||
| #endif |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,191 @@ | ||
| #if DEBUG | ||
| import CoreGraphics | ||
| import SnapshotKit | ||
| import SwiftUI | ||
|
|
||
| /// One additive device and accessibility profile for a static export. | ||
| public enum FlyoverCaptureProfile: String, CaseIterable, Codable, Identifiable, Sendable { | ||
| case phoneLight = "phone-light" | ||
| case phoneDark = "phone-dark" | ||
| case tabletLight = "tablet-light" | ||
| case phoneLandscape = "phone-landscape" | ||
| case phoneSmall = "phone-small" | ||
| case phoneXXXL = "phone-xxxl" | ||
| case phoneAX3 = "phone-ax3" | ||
| case phoneContrast = "phone-contrast" | ||
| case phoneRTL = "phone-rtl" | ||
| case phoneBold = "phone-bold" | ||
| case phoneVoiceOver = "phone-voiceover" | ||
|
|
||
| public var id: String { | ||
| rawValue | ||
| } | ||
|
|
||
| public var title: String { | ||
| switch self { | ||
| case .phoneLight: "Phone Light" | ||
| case .phoneDark: "Phone Dark" | ||
| case .tabletLight: "Tablet Light" | ||
| case .phoneLandscape: "Phone Landscape" | ||
| case .phoneSmall: "Phone Small Text" | ||
| case .phoneXXXL: "Phone XXXL Text" | ||
| case .phoneAX3: "Phone Accessibility 3" | ||
| case .phoneContrast: "Phone Increased Contrast" | ||
| case .phoneRTL: "Phone Right to Left" | ||
| case .phoneBold: "Phone Bold Text" | ||
| case .phoneVoiceOver: "Phone VoiceOver" | ||
| } | ||
| } | ||
|
|
||
| public static func parse(_ identifiers: [String]) throws -> [Self] { | ||
| try orderedUnique(identifiers.map { identifier in | ||
| guard let profile = Self(rawValue: identifier) else { | ||
| throw FlyoverExportError.unknownProfile(identifier) | ||
| } | ||
| return profile | ||
| }) | ||
| } | ||
|
|
||
| static func orderedUnique(_ requestedProfiles: [Self]) -> [Self] { | ||
| let profiles = requestedProfiles.isEmpty ? [.phoneLight, .phoneDark] : requestedProfiles | ||
| var seen: Set<Self> = [] | ||
| return profiles.filter { seen.insert($0).inserted } | ||
| } | ||
|
|
||
| var deviceName: String { | ||
| self == .tabletLight ? "tablet" : "phone" | ||
| } | ||
|
|
||
| var orientationName: String { | ||
| self == .phoneLandscape ? "landscape" : "portrait" | ||
| } | ||
|
|
||
| var colorSchemeName: String { | ||
| colorScheme == .dark ? "dark" : "light" | ||
| } | ||
|
|
||
| var dynamicTypeName: String { | ||
| switch self { | ||
| case .phoneSmall: | ||
| "small" | ||
| case .phoneXXXL: | ||
| "xxxl" | ||
| case .phoneAX3: | ||
| "accessibility3" | ||
| case .phoneLight, .phoneDark, .tabletLight, .phoneLandscape, | ||
| .phoneContrast, .phoneRTL, .phoneBold, .phoneVoiceOver: | ||
| "large" | ||
| } | ||
| } | ||
|
|
||
| var contrastName: String { | ||
| contrast == .increased ? "increased" : "standard" | ||
| } | ||
|
|
||
| var layoutDirectionName: String { | ||
| layoutDirection == .rightToLeft ? "right-to-left" : "left-to-right" | ||
| } | ||
|
|
||
| var legibilityWeightName: String { | ||
| legibilityWeight == .bold ? "bold" : "regular" | ||
| } | ||
|
|
||
| var snapshotTypeName: String { | ||
| snapshotType == .accessibility ? "accessibility" : "standard" | ||
| } | ||
|
|
||
| func configuration( | ||
| viewport: FlyoverViewport, | ||
| captureExtent: FlyoverCaptureExtent, | ||
| ) -> SnapshotConfiguration { | ||
| let baseSize = switch viewport { | ||
| case .device: profileSize | ||
| case let .fixed(size): size | ||
| } | ||
| let frame = switch captureExtent { | ||
| case .viewport: | ||
| SnapshotConfiguration.Frame(name: rawValue, size: .fixed(baseSize)) | ||
| case .intrinsic: | ||
| SnapshotConfiguration.Frame( | ||
| name: rawValue, | ||
| size: .intrinsic(maxWidth: baseSize.width), | ||
| ) | ||
| case .fullContent: | ||
| SnapshotConfiguration.Frame.fullContent( | ||
| name: rawValue, | ||
| width: baseSize.width, | ||
| minimumHeight: baseSize.height, | ||
| ) | ||
| case .fullContent2D: | ||
| SnapshotConfiguration.Frame.fullContent2D( | ||
| name: rawValue, | ||
| minimumSize: baseSize, | ||
| ) | ||
| } | ||
| return SnapshotConfiguration( | ||
| colorScheme: colorScheme, | ||
| dynamicType: dynamicType, | ||
| contrast: contrast, | ||
| layoutDirection: layoutDirection, | ||
| legibilityWeight: legibilityWeight, | ||
| layoutTraits: layoutTraits, | ||
| device: frame, | ||
| snapshotType: snapshotType, | ||
| ) | ||
| } | ||
|
|
||
| private var profileSize: CGSize { | ||
| switch self { | ||
| case .tabletLight: | ||
| CGSize(width: 834, height: 1194) | ||
| case .phoneLandscape: | ||
| CGSize(width: 874, height: 402) | ||
| case .phoneLight, .phoneDark, .phoneSmall, .phoneXXXL, | ||
| .phoneAX3, .phoneContrast, .phoneRTL, .phoneBold, | ||
| .phoneVoiceOver: | ||
| CGSize(width: 402, height: 874) | ||
| } | ||
| } | ||
|
|
||
| private var colorScheme: ColorScheme { | ||
| self == .phoneDark ? .dark : .light | ||
| } | ||
|
|
||
| private var layoutTraits: SnapshotConfiguration.LayoutTraits { | ||
| switch self { | ||
| case .tabletLight: .tabletPortrait | ||
| case .phoneLandscape: .phoneLandscape | ||
| case .phoneLight, .phoneDark, .phoneSmall, .phoneXXXL, | ||
| .phoneAX3, .phoneContrast, .phoneRTL, .phoneBold, | ||
| .phoneVoiceOver: .phonePortrait | ||
| } | ||
| } | ||
|
|
||
| private var dynamicType: DynamicTypeSize { | ||
| switch self { | ||
| case .phoneSmall: .small | ||
| case .phoneXXXL: .xxxLarge | ||
| case .phoneAX3: .accessibility3 | ||
| case .phoneLight, .phoneDark, .tabletLight, .phoneLandscape, | ||
| .phoneContrast, .phoneRTL, .phoneBold, .phoneVoiceOver: | ||
| .large | ||
| } | ||
| } | ||
|
|
||
| private var contrast: ColorSchemeContrast { | ||
| self == .phoneContrast ? .increased : .standard | ||
| } | ||
|
|
||
| private var layoutDirection: LayoutDirection { | ||
| self == .phoneRTL ? .rightToLeft : .leftToRight | ||
| } | ||
|
|
||
| private var legibilityWeight: LegibilityWeight { | ||
| self == .phoneBold ? .bold : .regular | ||
| } | ||
|
|
||
| private var snapshotType: SnapshotConfiguration.SnapshotType { | ||
| self == .phoneVoiceOver ? .accessibility : .standard | ||
| } | ||
| } | ||
| #endif | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this duplicated from anywhere?