feat(selectors): treat a bare tap target as visible text

Merged
TH
2d ago
+102-8

Summary

In Codex gpt-6-luna transcripts using agent-device 0.21.42–0.21.45, bare press Products or click Products cost an extra retry in 2 of 6 public runs and four local reproductions, about 3 seconds each. Agents retried with text=Products.

press, click, and longpress now translate one bare target argument into a quoted text selector. The prior refusal guided callers to that same selector. Ref, malformed selector, and trailing argument checks still apply. The existing selector path owns ambiguity and dispatch. The change preserves main’s fill grammar and error redaction.

Before / after

press General --settle previously returned INVALID_ARGS with a suggestion to use text="General". On the iPad (A16) simulator, the pre-rebase build at 63a80cfc68 switched Settings from Appearance to General:

Tapped text="General" (160, 277)
settled after 525ms: +15 -22 (~25 unchanged)
+ @e5~s633800 [cell] "General" [selected]
+ @e25~s633800 [navigation-bar] "General"

Validation

Oxlint passed on the two changed TypeScript files, and all 16 focused selector tests passed at 63e8ccf5e38c. All 44 focused selector and daemon tests passed at the prior head 49890486c1b2. The pre-rebase build and live check passed. The bare-text dispatch path was unchanged by the rebase. CI owns broader validation.