refactor(SnapshotKitTesting): use SwiftUI accessibility renderer - #227
Merged
Conversation
kyleve
enabled auto-merge (squash)
August 10, 2026 02:16
kyleve
added a commit
that referenced
this pull request
Aug 10, 2026
## Summary - add a hosted `onReadyToMeasure` seam for deterministic intrinsic/full-content readiness, with cancellation-aware timeout handling and distinct timing attribution - give snapshot-only GitHub runners an explicit 2× maximum settle/hook ceiling while preserving local defaults, minimum floors, quiet-window proof, cadence, and image tolerances - make Flyover publish the latest nonempty visible-preview expectation and await every active variant/generation load before intrinsic measurement - preserve already-loaded Flyover preview content across the measurement probe's transient rehost and isolate each appearance configuration with a fresh model ## Why The shard-2 failure on #227 showed `FlyoverCanvas_iPad` still changing after its four-second settle budget. Pixel settling is only a proxy for async readiness: on slower hosted runners, Flyover's serial preview builders could still be resolving when intrinsic measurement or capture began. Broadly increasing all waits would make failures slower without proving the intended content had loaded. This change gives height-changing async content a deterministic pre-measure seam, uses Flyover's production loading lifecycle as that signal, and reserves the CI multiplier for genuine runner slowness at maximum ceilings only. ## Review focus - `SnapshotMeasurementHook` races the hosted hook against the effective capture ceiling and relies on hook implementations cooperating with cancellation. - `FlyoverPreviewReadiness` tracks active load identity separately from the latest viewport expectation so early completions count, stale completions do not, and cancellation resumes every waiter exactly once. - The existing 1.5-second Flyover capture floor remains for time-based glass material adaptation; the new signal replaces only preview-loading guesswork. - No snapshot reference images changed. ## Testing - `./swiftformat --lint` - `bash -n test` - `./test SnapshotKitTests SnapshotKitTestingTests FlyoverTests` — 117 tests passed - `./test FlyoverTests` — 36 tests passed after the final active-load hardening - `./test --snapshots --only 'FlyoverSnapshotTests/FlyoverSnapshotTests/canvasAndList()'` — five consecutive runs passed against the pushed commit - `SNAPSHOT_SETTLE_TIMEOUT_MULTIPLIER=2 ./test --snapshots --snapshot-shard 2/2` — 22 snapshot tests passed
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
Why
AccessibilitySnapshot 0.11 provides a newer SwiftUI overlay and legend renderer with a modern palette and multi-column layout. SnapshotKitTesting previously continued to instantiate the legacy UIKit renderer even though the repository was already pinned to that release.
Review focus
Testing
./swiftformat --lint./test SnapshotKitTestingTests— 47 tests passed./test --no-generate --no-build --snapshots— 42 suites passed with recording disabled./attribution --check— 8 credits, up to date