fix(help): give every selector key a rule and list every selector command
Merged
IM
5d ago+201+201+012345678901234567890123456789-10-10-01234567890123456789
Summary
Follow-up to #5009, from its review notes.
- Shape: a term is
key=valueor a bare boolean key (checkedmeanschecked=true). - Keys:
appnameandwindowtitlesay what they match and which snapshots report them: Linux, the macOS desktop, frontmost-app and menubar surfaces, and macOS app sessions on the native backend.checkedstates its three values:checked=trueandchecked=falsematch only an explicit state; mixed or absent match neither. - Commands: the list adds
gesture pinch(#4998) andscreenshot --crop-on. selectors.md also addsclick,hoverandgesture drag. - Test:
cli-help-selectors.test.tsparses everyagent-deviceexample selector in the topic and selectors.md. Nine rule examples (bare key, escaped quote,button="Save"rejected, whole-field match, bothcheckedvalues,||order) must appear in both texts and get the expected parser or matcher result. Every parser key must open a rule clause in the topic's Matching section and have a table row or Boolean keys entry in selectors.md. The prose around an example is not checked.
Before / after
$ agent-device help selectors (lines that differ)
base aecafaf30:
... is, wait, scroll --until, and gesture drag accept a selector wherever they accept an @ref; ...
One or more key=value terms separated by spaces. ...
Boolean keys take true or false, and a bare key means true: visible=false, editable=true, checked.
head:
... and gesture pinch as the element to pinch. find takes one as its query, and scroll --until and screenshot --crop-on as the flag value.
One or more terms separated by spaces. ... A term is key=value, or a boolean key alone, which means key=true: checked is checked=true. ...
appname and windowtitle are the owning app's name and window title. Linux snapshots and the macOS desktop, frontmost-app, and menubar surfaces report them; ...
checked tests a switch, checkbox, or radio. checked=true matches only an explicitly checked control and checked=false only an explicitly unchecked one; ...
Validation
check:affected --run --head 23d94bfc7: format, lint, typecheck, layering, fallow, build and vitest-related pass.check:doc-linksandcheck:doc-prosepass.- The new test fails 3 of 13 against the base topic and docs. Fourteen parser, matcher and text mutants each fail it.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.