fix(ios): verify a fill whose unidentified field moved while it kept focus

Merged
LA
2mo ago
+107-7

Summary

Since #3334, an iOS replacement fill fails with TEXT_ENTRY_MISMATCH when an unidentified field moves during entry, although it holds exactly the requested text, which the help says confirms the entry: identity compares exact frames, and an iOS 26 bottom search bar rises and widens as typing starts.

Each text-entry observation now records focus. When the two reads differ only in frame, both without an identifier, same type and both focused, an exact read-back verifies; anything else still fails. Identity and the settle check stay frame-strict.

Known limits: focus cannot tell a moved field from an unidentified successor at the same query index, hence exact read-backs only. A fill ending in a submit key ends editing, so a moved field still fails as before (not measured on a device).

Closes #3595. 5 files: the read-back rule, a host-app flag --agent-device-text-entry-moves-on-input, tests.

Validation

Head 30da21705: pnpm check:affected --run passed. iPhone 17 Pro, iOS 26.5: the two new tests and the existing unidentified-field fill tests pass, as do the pure tests on the macOS host lane. Reverting the rule fails both new tests; dropping the focus read fails the fixture test.

Live, a React Native app's bottom search bar, two fills per relaunch, 10 relaunches:

base 352ad624dhead 30da21705
iPhone Air, iOS 26.520/20 TEXT_ENTRY_MISMATCH on first attempt20/20 pass
iPhone Air, iOS 27.020/20 pass20/20 pass
iPhone 16, iOS 18.520/20 pass20/20 pass