1- import { appleOsCapabilities } from './capabilities.ts' ;
1+ import { appleOsCapabilities , resolveDeviceAppleOs } from './capabilities.ts' ;
22import type { PlatformPlugin } from '../../core/platform-plugin/plugin.ts' ;
33import { PUBLIC_COMMANDS } from '../../command-catalog.ts' ;
44import { isAudioProbeSupportedDevice } from '../../kernel/audio-probe-support.ts' ;
@@ -44,7 +44,7 @@ const supportsOrientation = (device: DeviceInfo): boolean => {
4444 return caps ? caps . orientation : device . platform === 'android' ;
4545} ;
4646
47- // The Apple arm shared by `clipboard`/`alert`/` settings` (was `macos || simulator`):
47+ // The Apple arm shared by `clipboard`/`settings` (was `macos || simulator`):
4848// reachable on the macOS host directly, on every other Apple OS only on the simulator.
4949// Off Apple this preserves the trailing `device.kind === 'simulator'` term verbatim.
5050const supportsHostOrSimulatorSurface = ( device : DeviceInfo ) : boolean => {
@@ -54,6 +54,13 @@ const supportsHostOrSimulatorSurface = (device: DeviceInfo): boolean => {
5454 : device . kind === 'simulator' ;
5555} ;
5656
57+ // Alerts use the host/simulator surface plus physical iOS, whose XCTest path is
58+ // device-verified. iPadOS/visionOS remain closed until independently verified.
59+ const supportsAlertSurface = ( device : DeviceInfo ) : boolean =>
60+ device . platform === 'android' ||
61+ ( device . platform === 'apple' && resolveDeviceAppleOs ( device ) === 'ios' ) ||
62+ supportsHostOrSimulatorSurface ( device ) ;
63+
5764// `pinch`/`rotate-gesture`/`transform-gesture` (was `android || (ios && simulator &&
5865// target !== 'tv')`). Apple: the OS multi-touch model AND a simulator (physical iOS
5966// cannot synthesize). Off Apple: only `android`.
@@ -103,8 +110,7 @@ const APPLE_SUPPORTS_BY_DEFAULT: Record<string, (device: DeviceInfo) => boolean>
103110 [ PUBLIC_COMMANDS . keyboard ] : supportsKeyboard ,
104111 [ PUBLIC_COMMANDS . rotate ] : supportsOrientation ,
105112 [ PUBLIC_COMMANDS . tvRemote ] : supportsTvRemote ,
106- [ PUBLIC_COMMANDS . alert ] : ( device ) =>
107- device . platform === 'android' || supportsHostOrSimulatorSurface ( device ) ,
113+ [ PUBLIC_COMMANDS . alert ] : supportsAlertSurface ,
108114 [ PUBLIC_COMMANDS . settings ] : ( device ) =>
109115 device . platform === 'android' || supportsHostOrSimulatorSurface ( device ) ,
110116 [ PUBLIC_COMMANDS . audio ] : isAudioProbeSupportedDevice ,
0 commit comments