ReviewOS

craft-native/craft

Keep native descendant identity consistent between initial render and targeted mutations

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

Real UIKit acceptance for native pointer updates exposed inconsistent initial and mutation rendering identities. render() imports a document into the mutation model, which assigns protocol IDs to legacy descendants, but draws the original unnormalized document. A subsequent targeted style/prop update draws the normalized document instead. The same child is then keyed differently and replaced despite a non-structural update.

The simulator regression fails three child-identity assertions and the final restored hit target. The fix should use one committed normalized document for the initial render and all later renders, preserving controls rather than special-casing pointer policy. Trait refresh should also read the committed root instead of assuming its protocol ID is root.

Related actual acceptance: https://github.com/craft-native/craft/issues/428 and https://github.com/stacksjs/hq.training/issues/339.

3 days ago

Implemented on main in cd191ea.

Initial rendering now uses the committed normalized mutation document, matching targeted updates. Trait refresh reads the committed document rather than assuming a root protocol ID. Regression coverage preserves descendant view identity, input selection and scroll state, interleaved text order, replacement/removal behavior, and restored hit targets.

Validation: 342 native iOS unit tests passed for this change; subsequent integrated runs passed 352 native iOS tests with no skips/failures, plus focused image mutation tests. SDK and release/workflow tests, typechecks, package builds/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.

3 days ago

Shipped the iOS descendant-identity fix in v0.0.396. Full CI and Mobile E2E passed on the exact release commit; GitHub assets, Pantry publication, and all eight npm packages are verified.

Upgrade to 0.0.396 and regenerate the iOS shell to consume the updated host.

Sign in to comment on this issue.