Skip to content

Add geometry-aware element diff and stable IDs#366

Merged
JE-Chen merged 1 commit into
devfrom
feat/element-diff-batch
Jun 23, 2026
Merged

Add geometry-aware element diff and stable IDs#366
JE-Chen merged 1 commit into
devfrom
feat/element-diff-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 23, 2026

Copy link
Copy Markdown
Member

screen_state.diff_snapshots keys element identity strictly on (role, name) — it can't match a renamed-but-stationary control or a moved one, nor produce persistent IDs across frames.

  • match_elements(before, after, iou_threshold) (AC_match_elements): greedy IoU matching (reusing element_parse.iou) → {matched: [{before, after, iou}], added, removed}.
  • assign_stable_ids(elements, prior, iou_threshold) (AC_assign_stable_ids): tag each element with an id; with a prior frame, carry the id of the most-overlapping prior box (moved button keeps its id), new elements get fresh ids — so an agent can refer to "element 7" turn-over-turn.
  • Pure-stdlib over element dicts; fully headless-testable (move/rename/add cases). Wired through all 5 layers + headless test + EN/Zh docs + WHATS_NEW. Qt-free.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 35 complexity · 0 duplication

Metric Results
Complexity 35
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit a637dd3 into dev Jun 23, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/element-diff-batch branch June 23, 2026 13:36
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant