fix(android): carry the checked state of a checkable control on the snapshot node

Merged
OK
1mo ago
+384-41

Summary

The helper never serialized checked or checkable, and the host reads only its XML, so a switch, checkbox, or radio button looked the same on or off: get attrs had no checked field and snapshot text showed the control as plain.

The helper now writes checked on every checkable node, with both answers: an unchecked switch reads false, a node that cannot be checked reads nothing, like an older helper. The parser, the Android node, and the published snapshot node carry it to get attrs, the unchanged-snapshot comparison, the selector digest, and snapshot text, which marks [checked] or [unchecked]. One function, stateMarkers, now yields the printed states, the diff key, and the interaction-outcome key, so a toggle tap reads as a changed pair and not as a no-op to retry. A scroll's within-container check matches content by identity, so a flip is not movement.

@e16 [switch] "Wi-Fi switch" [unchecked]
@e22 [radiobutton] "Small" [selected] [checked]

22 files. No HELPER_API_VERSION bump, as with selected (#2515). No is checked predicate or checked= selector key here.

Validation

Tested at dc8f36780 (rebased onto 86d719dc3). pnpm check:affected --run --base 86d719dc3 passed: format, lint, typecheck, layering, fallow, build, 854 test files, 6,687 tests.

Rebuilt helper on an API 36 emulator, React Native app: Switch, CheckBox, and RadioButton carry checked in snapshot --json and get attrs, text nodes do not, and press @switch --settle reports - [unchecked] then + [checked].

Risk: a --settle that read a toggle tap as unchanged now reports the flip; the outcome lane does too.