Skip to content

Stabilize raised-floor accessibility snapshots - #290

Merged
kyleve merged 1 commit into
mainfrom
codex/stabilize-accessibility-snapshots
Aug 22, 2026
Merged

Stabilize raised-floor accessibility snapshots#290
kyleve merged 1 commit into
mainfrom
codex/stabilize-accessibility-snapshots

Conversation

@kyleve

@kyleve kyleve commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Posted by an AI agent on kve's behalf.

Summary

  • prepare raised-floor accessibility captures before the retained parse
  • discard the first transient render and apply the case's existing settle policy
  • keep ordinary and immediate accessibility captures on the original single-pass path
  • add a regression for state that changes after AccessibilitySnapshot inserts content into a window

Why

CircleCI captured the About screen before its navigation material finished adapting. The failed image had the same 29 accessibility annotations as the reference. One coherent navigation-bar band differed by 261,211 pixels with a maximum channel delta of 199.

AccessibilitySnapshot temporarily inserts the content only when it parses. The normal settle phase therefore cannot observe native work that starts during that insertion. Cases that already opt into a raised settle floor now use one discarded preparation parse, wait through that declared floor, and parse again.

The preparation is limited to .settledAtLeast. A first version applied it to every accessibility capture. The full snapshot run found that a second insertion changed one scrolling timeline. The final version leaves ordinary .settled and .immediate captures unchanged.

Review focus

  • the raised-floor check and two-pass lifecycle in SnapshotImageRendering.swift
  • the regression in AccessibilitySnapshotViewControllerTests.swift
  • the bounded-wait limitation documented in the source: the first annotated image is static, so this waits for persistent native state rather than proving live pixel stability

⚠️ Breaking changes

None. No reference images change.

Compatibility

  • standard snapshots are unchanged
  • ordinary accessibility snapshots remain single-pass
  • only accessibility cases with .settledAtLeast pay the extra parse and settle

Testing

  • ./test --no-generate SnapshotKitTestingTests — 59 tests passed
  • focused accessibility and tall-content suites — 12 tests passed
  • About suite — 16 images passed without reference updates
  • mutation check — the new regression fails on the original one-pass implementation
  • full snapshot run — 471 of 472 images passed and exposed the over-broad Presence timeline regression
  • final affected-suite rerun — About and Presence passed, 45 images total
  • ./swiftformat --lint
  • git diff --check

@kyleve
kyleve merged commit 92586b9 into main Aug 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant