fix(ios): reject ambiguous modal-surface pairings
Merged
TH
1d ago+83+83+01234567890123456789-9-9-0123456789
Summary
Four follow-ups to the modal-surface rule (#4125), in 4 files, host only:
- Duplicate children. The walk paired a kept child with the first plain child that has the same element. If a node lists one element more than once and the honor-modal read keeps only some of those occurrences, the walk could pick the wrong one and report a false surface. That now reads as
unknown(duplicatedChild). Occurrences that are all kept still pair in order, as the scroll bars in the prompt recordings do. One element under two parents is unaffected. - Root mismatch. Reads that start at different roots now read as
unknown(rootMismatch)instead ofunorderedRead. - Coverage.
AlertSurfaceTestsagain checks every recording'sexpectagainst the honor-modal exclusion, independently ofexpectModalScope. - Capture script. It now reports separately whether it kept
expectandexpectModalScope.
A single unmatched child still makes the whole reading unknown.
Validation
Head 1154659e6e, base f7879cf2d2.
pnpm check:affected --run --head 1154659e6e: all runnable checks passed. An earlier run hit two unrelated timeouts under host load; both pass alone.swift test --package-path apple/snapshot-presentation: 51 tests passed. On the base, the new duplicate and root tests fail: the duplicate case readsmodal(host: 2, roots: [3]), and the root case readsunorderedRead.- Mutation check: editing one recording's
expecteither way fails the restored test. Reverted. - TS parity (
geometry-policy-presented-surface,snapshot-source/tree): 35 passed. - No device run: the runner does not pass a modal reading yet.
š¤ Generated with Claude Code