Repository navigation
Description
Problem
The macOS engine's ElementIdentity (native/engine/Sources/Engine/Lineage.swift, eleven attributes) includes a field's placeholder. An element's identity decides:
- whether a cached element is still "the same" (the
.ifNeeded,.ignoringValueandrenewre-fetches); - what the tree-walk fallback searches for when a handle goes stale.
So any change to a placeholder between an observation and an action, or between an action's write and its post-write re-check, makes cua treat the same field as a different element.
#366 found this through Chromium's switch to complete accessibility mode: the placeholder only appears then (none → "Search"). set_value's post-write re-fetch (ValueSetting.swift) then answered elementNoLongerValid after the value went in, and the old-identity fallback couldn't find the field either (run 44068144650). #366 handles that case, with an observation-side wait, a same-handle refresh and valueUnconfirmed (ruling 1ea561bc:772). The fragility itself remains.
Where else it bites (to verify)
-
Placeholders that change on focus or input:
- floating-label patterns that clear the placeholder on focus;
- search boxes that rotate their placeholder ("Search people…", "Search files…");
- inputs that switch placeholder with a mode toggle or a selected filter;
- React or Vue components that set the placeholder from state.
Each focus-then-act sequence (click to focus then set_value, or type_text after a click) can then re-check against a stale placeholder.
-
Localization or theme reloads that rewrite placeholders while the agent works.
-
Native AppKit fields whose placeholder string the app changes (NSSearchField's recent-search hints, and the like).
-
Any engine path that re-fetches with an identity after acting: set_value's post-write check, click's and scroll's read-backs that re-find the element, and the fallback walk after a stale handle.
Question to settle
Should the placeholder leave ElementIdentity's strict comparison and count only as a tiebreak among several otherwise-matching candidates in the fallback walk?
- Leave it out if role, label, lineage and the other attributes already separate fields in practice. Measure collisions without the placeholder on real pages, such as forms with several unlabeled inputs that differ only by placeholder.
- Keep it as a tiebreak if those collisions exist: use it only to break a tie, never to reject a single match.
Success criteria
- A measurement of how often the placeholder is the only attribute separating two fields, on a sample of real pages and AppKit apps.
- Fixture cells where the placeholder changes on focus and on input: click then set_value, and type_text after a click. Neither may answer elementNoLongerValid or valueUnconfirmed while the field is unchanged.
- No case where relaxing the identity adopts a different field: each candidate is checked against the live handle.
Spawned by #366. No parent, not blocked.
Activity
SSFSKIM commentedon Nov 19, 2026
[board] in-progress: taken by cursor235 after #361; measure placeholder-only collisions on hosted macOS, then decide tiebreak vs drop
macOS engine: the placeholder leaves element identity only for the st…
macOS engine: a same-handle match by the placeholder alone renews not…
Evidence: #398's hosted measurement and qualification (refs #398)
SSFSKIM commentedon Nov 19, 2026
[board] in-review: PR #430 open; ci-gate GREEN on 76658e4; hosted qualification green on its gates
SSFSKIM commentedon Nov 19, 2026
[review-trail] Reviews: reviewer-high on 4630985 (incorrect: 3 P1 + 1 P2 wrong-field adoptions from the walk relaxation -> design narrowed to same-handle only; four sequences now refusing tests); reviewer-medium on 8ed0e07 (incorrect: P2 placeholder-only renewal dropped the observed value -> 3c99e09 renews nothing). 3c99e09 checked by dispatcher's diff read. Hosted run 44480787749 on 3c99e09: same-handle 960/960 exact (main refused 484), stale 320/320 as main, 0 wrong adoptions.
macOS engine: a field whose placeholder changes is still the same ele…
SSFSKIM commentedon Nov 19, 2026
[board] done: Landed via PR #430 (cua 0.28.18)