fix(android): carry the field's hint text on the snapshot node as placeholder

Merged
OK
1mo ago
+78-4

Summary

The helper wrote hint-showing but never the hint itself, and text holds the hint only while a field is empty, so a filled field's placeholder was readable nowhere: a placeholder query or attribute read had nothing to match on Android.

The helper now writes hint (getHintText(), API 26 or later) whenever the field has one, showing or not. The parser, the Android node, and the published snapshot node carry it as placeholder to get attrs, the unchanged-snapshot comparison, and the selector digest. label, value, and hintShowing are unchanged: an empty field still reports the hint as its text with hintShowing: true, and the new field is the one place that says what the hint is once the field is filled. A field without a hint omits it.

10 files. No HELPER_API_VERSION bump, as with selected (#2515) and checked (#2913): an older helper omits the attribute, which means unavailable.

Validation

Tested at the pushed head. pnpm check:affected --run --base dc9ab863a passed: 854 test files, 6,677 tests, fallow and oxfmt clean.

Rebuilt helper on an API 36 emulator, React Native form, snapshot --json and get attrs:

name-input        value "Ada Lovelace"  hintShowing false  placeholder "Type your name"
passphrase-input  value "Passphrase"    hintShowing true   placeholder "Passphrase"
key-input         value "Key echo"      hintShowing true   placeholder "Key echo"

The filled field's placeholder appears nowhere else in the tree. A WebView <input> named by <label for> carries no hint (Chrome writes none), so it stays without one.

Risk: an unchanged comparison now notices a placeholder change.