mirror of
https://github.com/lahfir/agent-desktop.git
synced 2026-08-06 06:00:39 +00:00
Code review found the STALE_REF name-divergence class was re-introduced: the snapshot builder stores a ref's name via its own chain (title -> description -> static value -> label_from_children child text), but resolve_element_name — used by strict ref re-resolution — dropped the child-label rung and trimmed blanks differently. So an interactive element named only by descendant text (Finder / Mail / System Settings sidebar cells) or by a whitespace/blank title stored one name and recomputed another, failing identity_matches -> STALE_REF on click/type/get. Confirmed: 5/5 Finder sidebar cells returned STALE_REF. - One shared reducer `builder::accessible_name` (title -> description -> static-text value -> aggregated child label, each trimmed and blank-as-absent), with the own-text portion factored into the pure, unit-testable `reduce_text_name`. Both the snapshot builder and resolve_element_name reduce through it, so a stored ref name always equals what the resolver recomputes. - Deleted the now-single-producer/single-consumer NameEvidence indirection (crates/core/src/accname.rs, crates/macos/src/tree/name_evidence.rs) and the now-dead label_from_child_attrs. - Added reduce_text_name unit tests covering the rung precedence and the blank/whitespace handling that accname_tests used to guard. Verified: 5/5 Finder sidebar cells now re-resolve, e2e 71/0, clippy clean, workspace tests green. |
||
|---|---|---|
| .. | ||
| core | ||
| ffi | ||
| linux | ||
| macos | ||
| windows | ||