Skip to content

Keep AccessibilitySnapshot out of the Prefire package - #200

Merged
BarredEwe merged 3 commits into
mainfrom
claude/voiceover-no-root-dependency
Oct 30, 2026
Merged

BarredEwe merged 3 commits into
mainfrom
claude/voiceover-no-root-dependency

Conversation

@BarredEwe

@BarredEwe BarredEwe commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Short description 📝

Follow-up to #199. PrefireVoiceOver no longer depends on AccessibilitySnapshot, so the root Package.swift has no external dependencies again.

With the package-level dependency, every Prefire consumer resolved AccessibilitySnapshot, iOSSnapshotTestCase and swift-snapshot-testing, even if they only use Prefire, and anyone pinned to AccessibilitySnapshot below 0.13 couldn't update Prefire.

Solution 📦

  • PrefireVoiceOver depends only on Prefire. It keeps the formatter, hosting, polling and automation setup.

  • The public entry point takes the parsed elements: capture.voiceOverTranscript(elements:timeout:accessibilityImage:). VoiceOverTranscript.Element, CustomContent and CustomRotor are public so callers can build them.

  • The generated tests map AccessibilityHierarchyParser in a private voiceOverElements(in:) and import AccessibilitySnapshotParser next to PrefireVoiceOver. The parser is a dependency of the user's test target, at the version they pin. A missing parser is a compile error, like a missing PrefireVoiceOver.

  • CI still compiles and runs this glue against the real parser: VoiceOverConsumer.generated.swift is regenerated from the template (checked by VoiceOverTemplateTests) and runs in PrefireSnapshotTests, which already depends on AccessibilitySnapshot.

  • Example: the SPM manifest adds AccessibilitySnapshotParser to the test target, the Xcode project requires AccessibilitySnapshot 0.13+.

  • Docs: Configuration.md and Templates.md describe the new setup.

  • Bundled CLI rebuilt with make binary from this branch (universal, macOS 13 minimum, no absolute build paths), so the plugin generates the new call.

  • Example: the four Trip text references were recorded on iOS 27, but .prefire.yml requires iOS 26, where SF Symbols are read by name (suitcase.rolling.fill. Image.). Re-recorded on iOS 26.3 through the plugin with the rebuilt CLI.

  • New tests: an accessibility image taken next to the text is byte-identical to one taken alone (turning text on keeps existing -accessibility references); generic app views are named and hosting views are not.

  • Comments and docs: [] and an empty value turn VoiceOver snapshots off; text references depend on the simulator's language, like the images.

Testing

Check Result
swift test (root) 54 tests, 0 failures
make test 159 tests, 0 failures
make test-ios 55 tests, 0 failures
swift package show-dependencies (root) No external dependencies
Example via plugin, iPhone 17 Pro iOS 26.3 Builds; UIKitVoiceOverTests passes; all text references match. Image tests fail only because the Example commits no PNG references, as before.

PrefireVoiceOver depended on AccessibilitySnapshotParser, so every
Prefire consumer resolved AccessibilitySnapshot, iOSSnapshotTestCase and
swift-snapshot-testing, and anyone pinned below 0.13 could not update.

PrefireVoiceOver now has no dependencies besides Prefire. It takes the
parsed elements through `voiceOverTranscript(elements:timeout:accessibilityImage:)`,
and the generated tests map AccessibilityHierarchyParser in a private
`voiceOverElements(in:)`, so the parser stays a dependency of the test
target at the version it pins. PrefireSnapshotTests compiles and runs
that generated code against the real parser.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T21:29:21.572630Z 2c71852 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c71852378

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Built with `make binary` from this branch: universal arm64 and x86_64,
macOS 13 minimum, no absolute build paths.
…age parity

The Trip references were recorded on iOS 27, while .prefire.yml requires
iOS 26, where SF Symbols are read by their names. They are re-recorded on
iOS 26.3, through the plugin with the rebuilt CLI.

New tests check that an accessibility image taken next to the text is the
same as one taken alone, so turning text on keeps existing -accessibility
references, and that generic app views and hosting views are classified
by their image. Comments and docs now say that [] and an empty value turn
VoiceOver snapshots off, and that text references depend on the
simulator's language like the images do.
@BarredEwe
BarredEwe merged commit 9efd324 into main Oct 30, 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