fix: restrict grid candidates to valid area size to prevent clicking fullscreen background containers

This commit is contained in:
2026-05-03 23:36:36 +02:00
parent f384fbb749
commit 8a6c8a2249

View File

@@ -133,6 +133,7 @@ class TelepathicEngine:
"description": node.content_desc,
"id": node.resource_id,
"class": node.class_name,
"semantic": node.content_desc or node.text or node.resource_id,
"original_attribs": node.to_dict(),
}
@@ -188,7 +189,8 @@ class TelepathicEngine:
grid_candidates = [
n
for n in all_nodes
if not n.text and ("photo" in n.content_desc.lower() or "video" in n.content_desc.lower() or n.area > 50000)
if not n.text
and ("photo" in n.content_desc.lower() or "video" in n.content_desc.lower() or (50000 < n.area < 400000))
]
best = self._evaluator.evaluate_grid_visuals(device, persona_interests, grid_candidates)