Skip to content

Commit 4ca831f

Browse files
author
Cameron Chisholm
committed
fix(contracts): name iOS and iPadOS in provider multi-touch refusals
1 parent e844582 commit 4ca831f

2 files changed

Lines changed: 29 additions & 5 deletions

File tree

‎packages/contracts/src/gesture-admission.ts‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const ANDROID_TV_MULTI_TOUCH_UNSUPPORTED_HINT =
3434
/**
3535
* How a refused cell names itself, reproducing every subject the retired admission produced.
3636
*
37-
* Three owner-specific subjects, then the plain platform name. The special cases resolve the
37+
* Owner-specific subjects, then the plain platform name. The special cases resolve the
3838
* Apple OS the way `assertAppleMultiTouchSupported` does; the default reads `appleOs` raw, the way
3939
* the retired `gesturePlatformMessage` did — an Apple device with no declared OS therefore still
4040
* reports `apple`, exactly as before.
@@ -51,14 +51,20 @@ function gestureRefusalSubject(device: DeviceInfo, tier: GestureRuntimeTier): st
5151

5252
/**
5353
* The owner-specific subjects two-contact synthesis refusals use, or `undefined` for the plain
54-
* platform name. iOS and iPadOS have none: their owner admits multi-touch on simulators and
55-
* devices, so only a provider can refuse it there, and its hint says why.
54+
* platform name. iOS and iPadOS are named only for a provider refusal: the Apple owner admits
55+
* multi-touch on simulators and devices, and the provider's hint says why it does not.
5656
*/
5757
function multiTouchRefusalSubject(device: DeviceInfo): string | undefined {
5858
if (device.platform === 'android') return device.target === 'tv' ? 'Android TV' : undefined;
5959
if (!isApplePlatform(device.platform)) return undefined;
6060
const appleOs = resolveDeviceAppleOs(device);
61-
if (appleOs === 'macos' || appleOs === 'tvos' || appleOs === 'visionos') {
61+
if (
62+
appleOs === 'ios' ||
63+
appleOs === 'ipados' ||
64+
appleOs === 'macos' ||
65+
appleOs === 'tvos' ||
66+
appleOs === 'visionos'
67+
) {
6268
return APPLE_OS_DISPLAY_NAMES[appleOs];
6369
}
6470
return undefined;

‎packages/daemon/src/core/gesture-runtime-admission.test.ts‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,25 @@ const refusalCases = [
6060
hint: 'Two-finger gesture synthesis is not available on iOS devices reached through a WebDriver provider.',
6161
},
6262
hint: /WebDriver provider/,
63-
message: 'gesture pinch is not supported on ios',
63+
message: 'gesture pinch is not supported on iOS',
64+
},
65+
{
66+
name: 'provider-refused iPadOS',
67+
device: {
68+
platform: 'apple',
69+
appleOs: 'ipados',
70+
id: 'ipad-device',
71+
name: 'iPad',
72+
kind: 'device',
73+
target: 'mobile',
74+
},
75+
fact: {
76+
available: false,
77+
reason: 'unsupported-provider-mode',
78+
hint: 'Two-finger gesture synthesis is not available on iOS devices reached through a WebDriver provider.',
79+
},
80+
hint: /WebDriver provider/,
81+
message: 'gesture pinch is not supported on iPadOS',
6482
},
6583
] as const;
6684

0 commit comments

Comments
 (0)