From 2463a742205ccafccc81259468632de2a89467d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Sat, 19 Sep 2026 14:53:02 +0200 Subject: [PATCH] refactor(ios): drop the flat sweep's discarded hittable computation Since #2669 the one normalization pass in captureWithBackend recomputes hittable for every acquired node, so the value flatSnapshotNode computed from the reported frame was overwritten before anything read it. The sweep now passes hittable: false like the recursive walker and private AX do, and the viewport parameter that only fed that computation goes with it. No presented output changes. Raised as a non-blocking note on #2669. --- .../RunnerTests+Snapshot.swift | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift index dc13dacb68..40b23e6a08 100644 --- a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +++ b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift @@ -446,12 +446,7 @@ extension RunnerTests { truncated = true break } - guard let node = flatSnapshotNode( - element: element, - index: 0, - parentIndex: 0, - viewport: viewport - ) else { + guard let node = flatSnapshotNode(element: element, index: 0, parentIndex: 0) else { continue } let key = "\(node.type)-\(node.label ?? "")-\(node.identifier ?? "")-\(node.value ?? "")-\(node.rect.x)-\(node.rect.y)-\(node.rect.width)-\(node.rect.height)" @@ -1323,8 +1318,7 @@ extension RunnerTests { private func flatSnapshotNode( element: XCUIElement, index: Int, - parentIndex: Int?, - viewport: CGRect + parentIndex: Int? ) -> RawAXNode? { var node: RawAXNode? let exceptionMessage = RunnerObjCExceptionCatcher.catchException({ @@ -1338,11 +1332,6 @@ extension RunnerTests { let valueText = snapshotValueText(element) let elementType = element.elementType let enabled = element.isEnabled - let hittable = SnapshotGeometry.isGeometricallyActionable( - enabled: enabled, - frame: frame, - viewport: viewport - ) node = RawAXNode( index: index, @@ -1354,7 +1343,7 @@ extension RunnerTests { enabled: enabled, focused: elementHasFocus(element) ? true : nil, selected: element.isSelected ? true : nil, - hittable: hittable, + hittable: false, depth: 1, parentIndex: parentIndex, hiddenContentAbove: nil,