Skip to content

docs(flows): list the empty fields matches: '^$' never passes on - #1486

Draft
latekvo wants to merge 3 commits into
mainfrom
docs/flows-empty-match-limits
Draft

latekvo wants to merge 3 commits into
mainfrom
docs/flows-empty-match-limits

Conversation

@latekvo

@latekvo latekvo commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Problem

reference/e2e-yaml.mdx (flow-yaml.mdx in #1288) says "Use '^$' to check that a field is empty" and names only the iOS text field as an exception. Many empty fields have text in the flow tree, so '^$' can never pass on them.

Fix

Docs only. The paragraph now says '^$' checks an element with no text, and a table lists the empty fields it never passes on, with the text Argent reads instead. Tests pin each row. A code comment and a test comment that repeated "can check an empty field" are corrected.

Empty field Docs before Docs after (= measured)
Android password field '^$' passes reads [password]
Android field with a hint '^$' passes reads the hint
Android field with a content description '^$' passes reads the description
Chromium password input '^$' passes reads [password]
Chromium input/textarea with aria-label, aria-labelledby or placeholder '^$' passes reads that text, also after typing
Chromium input/textarea with title '^$' passes reads the title

No workaround is documented: Chromium never reads the value of those fields, and the only candidate elsewhere (equals: <hint>) also passes when the typed text equals the hint.

E2E on Electron: same 26 flows, before (0.29.0 bundle, = origin/main code) and after (this branch's packages/argent/dist/cli.js)

Fixture: one page with each field kind; one flow per field asserting matches: '^$' while empty, then type abc + contains: abc. Run with argent flow run <file> --device chromium-cdp-9391. Results are identical on both builds (only the docs changed); the after run's tool-server was packages/argent/dist/tool-server.cjs from this branch.

Field empty '^$' after typing abc, contains: abc
<input>, <input> with <label for>, <textarea> pass pass
aria-label input / textarea fail, reads Name / Long text fail, still reads the label
aria-labelledby input fail, reads Email fail
placeholder input / textarea fail, reads Type here / Notes fail, still reads the placeholder
title input / textarea fail, reads Hint / Comment pass
type=password fail, reads [password] fail, reads [password]

A raw-CDP oracle confirmed every field held abc after typing.

Android rows: source (flow-android-tree.ts labelOf/[password]; the devtools helper dumps an empty hinted field's text as its hint) plus earlier emulator runs of flow-execute on 0.28.0 and 0.29.0: element matched id="ff" but its text was "Type here" (wanted to match /^$/) and ... id="fg" but its text was "[password]" for an empty password field.

Tests and local CI

New tests pin each documented row. Each was checked against a mutation of the code it pins; every mutation fails only the new test in its file:

Mutation Fails
Android [password] only when the field has text new Android test
Android ignores content-desc on an EditText new Android test
Android reads "" for showing-hint new Android test
Chromium placeholder / aria-label only when the value is empty new walker test
Chromium drops the title fallback new walker test
Chromium adapter redacts only a labelled password new adapter test
  • npx tsc --build, typecheck:tests, typecheck:scripts: pass
  • tool-server suite: 478 files, 6910 passed / 1 skipped
  • other workspaces: pass, except @argent/installer opencode globalPath failing only because this machine has a real ~/.config/opencode/opencode.jsonc (passes with a clean HOME; test(installer): keep the opencode default globalPath test out of the real home #1351)
  • prettier --check ., npm run knip (dist-free tree), eslint on the changed files: pass
  • npx docusaurus build and docs typecheck: pass

The flow-yaml reference said '^$' checks that a field is empty and named
only the iOS text field as an exception. On Android a password field, an
empty field with a hint and a field with a content description read text;
on Chromium a password input and an input or textarea with an aria-label,
aria-labelledby, placeholder or title do. List them, and pin each row
with a test.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant