Skip to content

Phase 3 b.2: relocate Apple supports()/unsupportedHint() closures onto the plugin #973

Description

@thymikee

Relocate the Apple supports() / unsupportedHint() device closures onto PlatformPlugin.capability.supportsByDefault verbatim — never flatten the predicate bodies to data (perfect-shape §7: relocate, never flatten).

Current state

  • Closures are hand-authored in src/core/command-descriptor/registry.ts:41-59: isNotMacOs, isMacOsOrAppleSimulator, isIosMobileSimulator, supportsSynthesisGesture, supportsAndroidOrIosNonTv, and synthesisGestureUnsupportedHint — the last encodes macOS-coordinate-pinch (:53) and tvOS-no-touch (:54-55).
  • Consumed via the matrix at src/core/capabilities.ts:98 (capability.supports(device)).
  • The plugin facet capability.supportsByDefault? is declared but unpopulated (src/core/platform-plugin/plugin.ts:48).
  • (b.1) capability-bucket routing already shipped in refactor: route capability bucket through PlatformPlugin + pin supports() closures (Phase 3 step b) #965 (capabilities.ts:94-96 reads getPlugin(...).capability.bucket).

Work

Move the closure bodies onto the relevant plugin's capability.supportsByDefault (or keep them on the command facet and flow the platform default through the plugin). Do not rewrite the predicate bodies.

Gate (required before deleting any hand site)

A closure-equivalence parity test: same device → same boolean / same hint string, across the full sample-device matrix (src/__tests__/test-utils/device-fixtures.ts). Keep the command-descriptor/registry.ts closures until the parity test passes.

Refs

perfect-shape.md §6/§7; ADR-0009. (Phase 3 step b.2.)


Part of #972 (Phase 3 — Apple PlatformPlugin).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions