ReviewOS

craft-native/craft

Honor native pointerEvents across containers and controls

#428
Closed chris opened this 3 days ago ·
3 days ago

HQ's shared native screens reproduce a contract gap in https://github.com/stacksjs/hq.training/issues/339: STX forwards the pointerEvents prop, but the iOS and Android native hosts do not honor it. An overlay can therefore swallow taps even when its author explicitly requests pass-through.

The matching STX compiler change is being verified separately: preserve auto, none, box-none, box-only in inline/object styles and map the CSS pointer-events-none / pointer-events-auto utilities. That compiler change must not be treated as proof of native behavior.

Implement one explicit native hit-targeting contract and use it across semantic component roots, rather than special-casing HQ's toast or modifying app templates:

  • auto: preserve platform behavior, including disabled/hidden controls and native gesture handling.
  • none: exclude the node and all descendants so an underlying sibling can receive a tap.
  • box-none: descendants remain eligible; the node's own box cannot consume a tap.
  • box-only: the node remains eligible; descendants cannot become the target.
  • Clearing or reactively changing the value restores ordinary targeting without changing authored disabled state.

Both prop and style forms need the same precedence and clearing behavior. Cover flow containers, scrolling/list containers and leaf controls. Preserve overflowing children where overflow is visible, clipping, z-order, modal shielding and existing gestures. Do not toggle visibility or disable views temporarily to reroute touches.

Acceptance needs real UIKit hit-test/event assertions and Android native event assertions: sibling underlay plus overlay with a child action; all four modes; changes/clearing; disabled controls; clipped and overflowing content; a nested scroll/list case. Existing native fixtures live under packages/ios/fixtures/native-screen and packages/android/fixtures/native-navigation. HQ's diagnostic gate should include unknown styles after the released compiler and host implementations are consumed.

Related enterprise acceptance: https://github.com/stacksjs/hq.training/issues/318. This is separate from navigation chrome geometry in https://github.com/craft-native/craft/issues/426.

3 days ago

Implemented on main in 5acda37, 06107091, 3303f52, and 4a91668.

The iOS and Android hosts now honor auto, none, box-none, and box-only at semantic component boundaries, with matching prop/style precedence and clearing. Coverage includes containers, scrolling/lists, leaf controls, overflow/clipping, modal shielding, and both Android map adapters. Authored visibility and enabled state are preserved; active Android gestures are cancelled safely when targeting changes. Shared SDK types expose PointerEvents.

Validation includes real UIKit hit-test/event assertions and Android native event tests. The implementation passed 348 iOS native unit tests and 50 Android native tests, with no skips/failures. Subsequent integrated image work also passed 352 iOS and 53 Android native tests. The SDK, release/workflow tests, typechecks, builds/package verification, formatting, and lint passed locally.

Closing as implemented on main. Not yet released; full hosted CI/Mobile E2E on the latest main are pending. Downstream HQ acceptance still requires consuming the matching STX compiler and Craft host versions.

3 days ago

Shipped in v0.0.396: iOS/Android native pointer-event policies and shared SDK types. Full CI and Mobile E2E passed on the exact release commit; GitHub assets, Pantry publication, and all eight npm packages are verified.

Upgrade the Craft packages to 0.0.396 and regenerate the native shell; downstream templates must use a matching STX compiler.

Sign in to comment on this issue.