fix: cache macos computer-use snapshot ax reads (#6130)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -60,6 +60,20 @@ public struct SnapshotTabStripCompaction: Equatable {
|
||||
}
|
||||
|
||||
public enum SnapshotRenderHeuristics {
|
||||
public static func shouldProbeSecureTextMetadata(role: String) -> Bool {
|
||||
let normalized = role.lowercased()
|
||||
return normalized.contains("text") ||
|
||||
normalized.contains("field") ||
|
||||
normalized.contains("password") ||
|
||||
normalized.contains("search") ||
|
||||
normalized.contains("combo")
|
||||
}
|
||||
|
||||
public static func supportsAttribute(_ attribute: String, advertisedAttributes: Set<String>?) -> Bool {
|
||||
guard let advertisedAttributes else { return true }
|
||||
return advertisedAttributes.contains(attribute)
|
||||
}
|
||||
|
||||
public static func displayName(_ node: SnapshotRenderNode) -> String? {
|
||||
if let title = clean(node.title) {
|
||||
return title
|
||||
|
||||
Reference in New Issue
Block a user