From 15224306feb728a91a9da2d688ef690340ab2433 Mon Sep 17 00:00:00 2001 From: injaneity <44902825+injaneity@users.noreply.github.com> Date: Thu, 10 Sep 2026 04:59:34 -0500 Subject: [PATCH 1/2] chore(cua-driver): begin exact consent-label lifecycle regression Refs #3705. Reuse the existing public browser_prepare lifecycle test for native red before changing semantic matching. Related localization contributions #3409 and #3140 remain separate. From fea9517d61258bc918ee72c1f64abdf9018dc4c1 Mon Sep 17 00:00:00 2001 From: injaneity <44902825+injaneity@users.noreply.github.com> Date: Thu, 10 Sep 2026 05:30:47 -0500 Subject: [PATCH 2/2] fix(cua-driver): deduplicate repeated native consent labels Normalize identical AX text fields once so an English Allow/Cancel title repeated in the description remains an exact semantic match. Distinct text still combines, and sheet ownership, action capability, uniqueness, and ambiguity checks remain unchanged. Refs #3705. --- .../platform-macos/src/browser/consent_ui.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libs/cua-driver/rust/crates/platform-macos/src/browser/consent_ui.rs b/libs/cua-driver/rust/crates/platform-macos/src/browser/consent_ui.rs index ff05feaf12..4d2e131a9a 100644 --- a/libs/cua-driver/rust/crates/platform-macos/src/browser/consent_ui.rs +++ b/libs/cua-driver/rust/crates/platform-macos/src/browser/consent_ui.rs @@ -23,7 +23,8 @@ fn refusal(code: BrowserRefusalCode, message: impl Into) -> BrowserRefus } fn normalized_text(node: &AXNode) -> String { - [ + let mut parts = Vec::new(); + for text in [ node.title.as_deref(), node.value.as_deref(), node.description.as_deref(), @@ -31,10 +32,13 @@ fn normalized_text(node: &AXNode) -> String { ] .into_iter() .flatten() - .collect::>() - .join(" ") - .trim() - .to_ascii_lowercase() + { + let text = text.trim().to_ascii_lowercase(); + if !text.is_empty() && !parts.contains(&text) { + parts.push(text); + } + } + parts.join(" ") } fn release_actionable_nodes(nodes: &[AXNode]) {