Skip to content

fix(wait): ignore an editable field's typed value in wait text - #4489

Merged
thymikee merged 8 commits into
mainfrom
fix/wait-text-editable-value
Nov 12, 2026
Merged

thymikee merged 8 commits into
mainfrom
fix/wait-text-editable-value

Conversation

@thymikee

@thymikee thymikee commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

After fill, wait text matched the field's own typed value and passed before Save/OK stored anything. Now an editable field never matches by its current value, or by a label repeating it (Android reports typed text as both), unless the value is its shown placeholder. Applies to every editable field. Editability comes from isNodeEditable (the editable fact, else the platform type). One rule in the snapshot path (matchesWaitText, @agent-device/selectors) and the iOS runner's native findText, pinned by contracts/fixtures/wait-text-policy.json.

Scope expansion: isFillableType treats web textbox/searchbox as fillable. Web captures have no editable fact, so editable=true missed web fields and fill warned on them. 14 files; help and docs updated.

Fixes #4479

Validation

Base eec35e9, head b1790c1 (live runs at the SHAs named below; later commits move the rule into internal/node.ts and honor hintShowing, with no change to these runs).

  • Provider scenarios fail on base, pass at head: android-find.test.ts (no editable fact), ios-wait-selector.test.ts. Golden table in TS; Swift twin in the macOS host lane.
  • iOS 27.0 simulator, Contacts, typed benchad: 0.21.31 passes in 276 ms; head 1dcee88 times out (3012 ms). "First name" and empty-field placeholders match; the saved name matches in 103 ms.
  • Android 15 emulator (android-helper 0.21.37-dev), Device name, fill bench-ad: 0.21.31 passes in 20 ms; head f1c0a01 → wait_target_absent, still absent at the warning dialog, then matches the stored name in 116 ms.
  • check:affected: CI validates the pushed head.

🤖 Generated with Claude Code

After fill, wait text matched the field's own value and passed before the
app stored anything. An editable node now satisfies wait text only by its
identifier or by a label distinct from its value, in the snapshot path and
the iOS runner's native findText, pinned by one golden table.

Fixes #4479

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.23 MB 6.23 MB +1.2 kB
Package (unpacked) 6.23 MB 6.23 MB +1.2 kB
Package (download) 1.89 MB 1.89 MB +332 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 22.7 ms 21.6 ms -1.0 ms
CLI --help 49.3 ms 46.9 ms -2.4 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 issues found across 11 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="test/integration/provider-scenarios/android-find.test.ts">

<violation number="1" location="test/integration/provider-scenarios/android-find.test.ts:118">
P3: This comment incorrectly says only the identifier can satisfy `wait text`; the fixture's distinct `Search` label also matches editable fields. Mention both the identifier and labels distinct from the current value.</violation>
</file>

<file name="contracts/fixtures/wait-text-policy.json">

<violation number="1" location="contracts/fixtures/wait-text-policy.json:17">
P2: This golden table does not cover Android `EditText` nodes whose native type identifies them as editable but whose `editable` fact is absent. Add a type-based editable case and extend the shared fixture/test contract so the typed value is asserted not to match for that shape; otherwise the advertised policy is not pinned for all Android editable fields.</violation>
</file>

<file name="packages/contracts/src/wait.ts">

<violation number="1" location="packages/contracts/src/wait.ts:76">
P2: This drops a visible Android hint when Appium cannot report hint state: the producer retains the same text as both label and value, so the matcher removes the label and `wait text` times out. Preserve a hint-equal label when hint state is unknown.

(Based on your team's feedback about Android field metadata.)</violation>
</file>

<file name="packages/contracts/src/wait.test.ts">

<violation number="1" location="packages/contracts/src/wait.test.ts:8">
P3: This comment points contributors to a nonexistent Swift test file. Update it to `RunnerTests+InteractionTests.swift` so the cross-runtime golden-table test remains discoverable.</violation>
</file>

<file name="packages/command-surface/src/capture/wait.ts">

<violation number="1" location="packages/command-surface/src/capture/wait.ts:62">
P2: This description narrows the exclusion to user-typed values, but the matcher excludes the current value of every editable field, including prefilled or app-supplied content. Say that editable fields never match their current value, while non-editable nodes may match by value.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/contracts/src/wait.ts Resolved
Comment thread website/docs/docs/commands.md Resolved
Comment thread packages/contracts/src/wait.test.ts Resolved
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel

Verdict: approve

4 finding(s): 4 minor.

🟡 Minor (4)

Where Finding
packages/contracts/src/wait.ts:71 Android wait text still matches typed input when the node carries no editable fact
packages/contracts/src/wait.ts:71 Swift findText keys on elementType, TS on editable fact: same table, different rule
packages/contracts/src/wait.ts:71 label != value and label === node.value can disagree; the table has no case for it
website/docs/docs/commands.md:433 wait @​ref on an editable field can never succeed now

1 finding below minor not shown (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (eec35e9622c3).

Feedback goes in the review comment threads, as a reply under the inline comment of a finding:

Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.

Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.

Comment @apex-sentinel-staging review on this conversation to run a full review.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 4 new findings on 7ae01f9. The verdict and the full list are in the summary comment.

Comment thread packages/contracts/src/wait.ts Resolved
Comment thread packages/contracts/src/wait.ts Resolved
Comment thread packages/contracts/src/wait.ts Resolved
Comment thread website/docs/docs/commands.md Resolved
thymikee and others added 3 commits November 12, 2026 17:02
Move the wait text rule beside checkWaitText and decide editability with
isNodeEditable, so an Android EditText without an editable fact (fallback
or Appium) is covered and a disabled field's value still matches. A field
whose value equals its placeholder is showing its hint, so it matches like
any node; iOS reports an empty field that way. The runner predicate and the
golden table follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Web captures publish no editable fact, so isFillableType decided and
answered false for ARIA text inputs: editable=true missed web fields, fill
warned it was attempting anyway, and wait text matched a web field's typed
value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 14 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

thymikee and others added 2 commits November 12, 2026 17:11
…dule

A separate module added one eagerly evaluated module to every importer of
the selectors entry, which the closure budget refuses. matchesWaitText now
lives beside isNodeEditable, which the closure already evaluates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/selectors/src/internal/node.ts Resolved
…wait text

A field that reports its hint hidden holds typed text even when that text
equals the placeholder. The placeholder comparison stays the fallback when
the producer does not report hint state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel could not review commit aa5c21bc. No review ran, so there are no findings; this is not a verdict on the change.

Apex Sentinel hit an internal error and could not finish this review. This is a problem on Sentinel's side, not with the change; if it keeps happening, tell whoever runs Sentinel for this repository. Push a new commit or comment @apex-sentinel-staging review to try again.

@thymikee

Copy link
Copy Markdown
Member Author

@apex-sentinel-staging review

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at aa5c21b. I found no problems in the code.

No conflicts. 21 of 22 checks pass. The only one not passing is an external review check that is still queued. It runs no build or test code, so the diff does not affect it. Nothing else must happen before merge.

Not blocking, and you can take or leave these: (1) matchesWaitText reuses isNodeEditable, and isFillableType returns true for an empty type (https://github.com/callstack/agent-device/blob/aa5c21b/packages/selectors/src/internal/node.ts#L38), so an untyped node such as {label:"Total", value:"$5"} no longer satisfies wait text $5. Should typed content require an editable fact or a non-empty fillable type, as isTextField does in node-touch-point.ts, with an untyped row in the golden table? (2) The web textbox/searchbox fillable rule in https://github.com/callstack/agent-device/blob/aa5c21b/packages/contracts/src/snapshot-text.ts#L24 also changes the fill warning, web fill focus-target selection and the editable=true selector, so please list those in the PR body or split the rule out. (3) On iOS every enabled TextView counts as editable by type, including read-only ones, so the docs at website/docs/docs/commands.md#L433 could say that is text, get text or a selector reads those. (4) The PR body says 14 files but the diff has 13, and the help in wait.ts omits the placeholder and disabled-field exceptions that the website docs state.

I did not run the provider scenarios or the Swift unit test. I checked the regression by reading the old findNodeByLabel path. The Swift test evaluates NSPredicate against a dictionary, so whether XCUIElementQuery resolves placeholderValue the same way on a live element rests on your iOS live run at 1dcee88. The live iOS and Android runs are as you reported them. I did not re-run them. I also could not tell whether any producer emits untyped snapshot nodes, and I did not check whether the macOS lane that runs RunnerTests is part of required CI.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 12, 2026
@thymikee
thymikee merged commit ade2e43 into main Nov 12, 2026
21 of 22 checks passed
@thymikee
thymikee deleted the fix/wait-text-editable-value branch November 12, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wait text matches the editable field's own typed value

1 participant