refactor(ios): keep the modal-scope capture out of the packaged runner
Ā
TH
7h ago+11+11+01234567890123456789-4-4-0123456789
Summary
#4124 shipped the modal-scope capture in the packaged runner source, but its only caller is the dev capture test testCaptureAlertSurfaceTree (pnpm capture:alert-surface). This PR moves it under UnitTests/, which the packager drops:
RunnerAXModalScopeCapture.{h,m},RunnerModalScopeAcquisition.swift, andRunnerAXSnapshotBridge+Internal.hmove toUnitTests/. The.mand Swift compile only underAGENT_DEVICE_RUNNER_UNIT_TESTS, which matchesAgentDeviceRunnerAppFixtures.mand the otherUnitTests/sources.- The bridging header imports the capture header behind
__has_include.OTHER_CFLAGSdefines do not reach Swift's clang importer, so a#if defined(...)gate hid the types from the unit build. RunnerAXSnapshotBridge.mimports its public header again. Production code still uses the split helpers.ModalScopePair.swiftandModalSurface.swiftstay in the host package.
6 files, renames plus guards. No behavior change.
Size: ā19.9 kB unpacked (CI Size Report)
Validation
At e5fb487ca5:
pnpm check:affected --run --head HEAD: passed.pnpm check:package: passed, with no test code in the 751 packed files.- Runner
build-for-testingpassed on iOS sim and macOS, for both normal and unit (AGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS=1) builds. The packageddist/apple/runnerproject also built on iOS and macOS. The packaged source has noModalScopeCapturefile. pnpm capture:alert-surfaceagainstcom.apple.Preferenceson an iPhone Duo sim: 1 test passed, 141/141 nodes. I deleted the throwaway fixture, and the corpus is unchanged.- Both
testAModalScopeTree*methods passed on the iOS sim and on macOS (2 executed, 0 failures each).
CI: Apple Smoke Tests own the swift-runner lanes.
š¤ Generated with Claude Code