fix: guard transient controls and verify timeline endpoints

This commit is contained in:
chenmingxuan committed 2026-11-02 13:54:50 +08:00
1 parent 479a185192
commit 00e62a663a
29 files changed
+1150 -90

No files matched your search

+8 -3
View File
@@ -321,7 +321,10 @@ def format_minimal_list_with_points(
continue
norm_bounds = normalize_bounds(left, top, right, bottom)
lines.append(f"[{idx}] Text: '{text.strip()}' | Bounds: {norm_bounds}")
line = f"[{idx}] Text: '{text.strip()}' | Bounds: {norm_bounds}"
if resource_id := node.get("resource-id") or node.get("resource_id"):
line += f" | resource_id: '{resource_id}'"
lines.append(line)
items_bounds.append((idx, (left, top, right, bottom)))
points.append([cx, cy])
@@ -392,7 +395,7 @@ def format_minimal_list_with_elements(
"text": ocr["text"].strip(),
"bounds": [left, top, right, bottom],
"class": node.get("class"),
"resource_id": node.get("resource-id"),
"resource_id": node.get("resource-id") or node.get("resource_id"),
"is_ocr": True,
}
)
@@ -422,6 +425,8 @@ def format_minimal_list_with_elements(
norm_bounds = normalize_bounds(left, top, right, bottom)
kind = "Text" if text.strip() else "Hint"
line = f"[{idx}] {kind}: '{shown}' | Bounds: {norm_bounds}"
if resource_id := node.get("resource-id") or node.get("resource_id"):
line += f" | resource_id: '{resource_id}'"
if error:
line += f" | Error: '{error}'"
if value_evidence:
@@ -437,7 +442,7 @@ def format_minimal_list_with_elements(
"text": shown,
"bounds": [left, top, right, bottom],
"class": node.get("class"),
"resource_id": node.get("resource-id"),
"resource_id": node.get("resource-id") or node.get("resource_id"),
"is_ocr": False,
}
if not text.strip():