Skip to content

Commit d5185f8

Browse files
committed
fix(contracts): derive clipboard family denials from the served cell
Review follow-up on the clipboard family. Apple restated its leaf branches to choose a clipboard denial, so the leaf split lived twice in one file. It now reads the leaf's own refusal, keeping a leaf-scoped placeholder only where the leaf serves clipboard and therefore has no clipboard refusal to state. Android named a build-level shell verdict as its family denial, which is the claim its own probe refuses to make when the probe did not complete; the denial now follows the probed cell, so an unnamed half reports the unknown rather than a verdict. Pin the shared unavailable record's clipboard fan-out the way the keyboard commit pinned its own: one input cell, two operations, each with its reason.
1 parent 5738d39 commit d5185f8

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

‎packages/contracts/src/platform-runtime-unavailable.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ test('generic unavailable binding preserves exact provider ownership and mode',
9595
reason: 'unsupported-provider-mode',
9696
});
9797
}
98+
for (const operation of ['readClipboard', 'writeClipboard'] as const) {
99+
assert.deepEqual(binding.facts.operations[operation], {
100+
available: false,
101+
reason: 'unsupported-provider-mode',
102+
});
103+
}
98104
// `apps` is left unclassified above (an optional cell): it inherits the network gap's reason.
99105
assert.deepEqual(binding.facts.operations.listApps, {
100106
available: false,

‎packages/platform-android/src/runtime.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ export function createAndroidPlatformRuntime(host: PlatformRuntimeHost): Platfor
378378
// Read and write share one cell: `cmd clipboard` either has a shell implementation on this
379379
// build or it has none, and no Android build ships one half of it.
380380
...clipboardRuntimeOperationFacts({
381-
unsupported: clipboardShellUnavailable,
381+
unsupported: clipboardCell.available ? clipboardShellUnavailable : clipboardCell,
382382
read: clipboardCell,
383383
write: clipboardCell,
384384
}),

‎packages/platform-apple/src/system/runtime.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,13 @@ function appleAppEventFact(device: DeviceInfo): RuntimeOperationFact {
116116
return resolveDeviceAppleOs(device) === 'watchos' ? appleWatchOsUnavailable : available;
117117
}
118118

119-
/** The clipboard denial this leaf reports for a surface this owner does not name. */
119+
/**
120+
* The clipboard denial this leaf reports for a half it does not name: the leaf's own refusal where
121+
* it has one, since a leaf that serves clipboard today has no clipboard refusal to state.
122+
*/
120123
function appleClipboardFamilyUnavailable(device: DeviceInfo): RuntimeOperationUnavailability {
121-
if (device.kind !== 'simulator' && device.kind !== 'device') return clipboardKindUnavailable;
122-
return resolveDeviceAppleOs(device) === 'watchos'
123-
? appleWatchOsUnavailable
124-
: clipboardLeafUnavailable;
124+
const cell = appleClipboardFact(device);
125+
return cell.available ? clipboardLeafUnavailable : cell;
125126
}
126127

127128
/** The system-surface cells: clipboard read/write, app-event delivery, settings, and alerts. */

0 commit comments

Comments
 (0)