refactor(ios): trim the alert path's forwarding and duplicate constructors

Merged
TH
1mo ago
+21-69

Summary

A cleanup of the iOS alert path with no behavior change. 3 files, +21 / āˆ’69 (net āˆ’48).

  • snapshot-alert.ts: each admission branch now calls its narrowed runtime operation directly. The four forwarding functions are removed. The four separately typed admission branches stay, so capability narrowing is unchanged.
  • RunnerTests+Alert.swift: the two runnerAlert(...) constructors are now one. It takes the resolved actions and an optional window.
  • RunnerTests+Alert.swift: the enabled and hittable button reads use the existing safely helper instead of a bespoke ObjC exception wrapper. Small scope expansion: the audit named only the enabled read; the hittable probe used the same wrapper. A caught exception is now also logged under its tag.
  • RunnerTests+SystemModal.swift: removed the redundant action-type check. Its only caller queries descendants only by actionableTypes.

Validation

At 3cc11f8a30:

  • pnpm check:affected --run --head HEAD: all runnable checks passed (exactCommit=true).
  • snapshot-alert.test.ts: 7/7 passed.
  • Runner build-for-testing: iOS and macOS, normal and unit-test variants, all succeeded.
  • Alert unit tests on an iPad (A16) simulator, method-level -only-testing for every test in RunnerTests+Alert*, +SystemModalTests, +BlockingSystemModal*: 41 executed (the 42nd is tvOS/macOS-only), 1 skipped (capture-only), 39 passed. The 1 failure, testAlertActivationConfirmsBeforeDeadlineWithoutHandlingTheNotificationBanner ("needs notification authorization"), fails the same way on an origin/main build on the same simulator, so it comes from the simulator's state.

šŸ¤– Generated with Claude Code