feat(locator): support hasNotText filters across engines
- Add
filter({ hasNotText })to exclude subtree text, alone or with existinghasTextandhasfilters. Strings use the existing case-insensitive substring rules; RegExp patterns retain their flags. - Support the public SDK, reference resolver, native browser projection and mobile snapshot resolver together, with diagnostics and typing. Update the locator guide and test-writing skill.
Addresses the negative text filter gap in#1020.
Verified
Ran it locally: yes.
Ran public SDK filter tests, reference expression tests, native Chromium closed-shadow integration, device snapshot tests, compile-time SDK assertions, all package builds/typechecks and full pnpm check. Browser tests operate only on a local fixture; no live models or physical devices.
| main | this branch |
|---|---|
| Regression fails | Regression and adjacent tests pass |
RUN v5.0.1 packages/e2e
Test Files 3 passed (3)
Tests 37 passed (37)
Start at 09:54:43
Duration 334ms (transform 69%, import 24%, tests 5%, worker 2%)
The full repository pnpm check, changed package build, typecheck, and changed TypeScript lint pass. The full repository pnpm check passes on the pinned unchanged base with the complete frozen-lockfile install. Browser and mobile benchmark suites were not run; no live model calls were made.
Also rebuilt the exact frozen commit and passed a real runner/worker/browser product fixture with no model calls. The candidate capability executed through the built SDK and real worker.
The mobile subtree control now uses unnamed containers with matching/nonmatching descendants and an empty container. Its exact-string and case-insensitive RegExp results are checked, and temporarily disabling actual production descendant reads makes the new native control fail. Production behavior is unchanged by this test strengthening.
Independent review follow-up: nameless mobile containers distinguish descendant-only exact and RegExp matches, nonmatches and empty candidates. The actual production mutation disabling descendant reads fails the new control; restored production passes all9 native locate tests. A separate root review rebuilt the actual packages and passed native mobile tests, types and lint.