Skip to content

feat(dom): name clickables from text, onclick, icon class, role + bump 3.1.0 - #51

Merged
KeyCode17 merged 16 commits into
developfrom
feat/clickable-naming
May 29, 2026
Merged

KeyCode17 merged 16 commits into
developfrom
feat/clickable-naming

Conversation

@KeyCode17

Copy link
Copy Markdown
Owner

Summary

Clickable elements sent to the LLM were bare [N] tag, named only when an aria/alt/title/name/placeholder/value attribute existed. Anchor text, JS click handlers, and icon-only buttons arrived anonymous.

  • Detection unions the attribute heuristic with CDP's native isClickable set (catches JS-attached listeners).
  • ax_name fallback chain: aria/alt/title/name/placeholder → descendant text → onclick handler name (humanized, verb only) → FontAwesome icon class → role.
  • role overrides the displayed tag (<i role="button"> → button).
  • clickable_map: cap 80 → 200, visible-first sort so on-screen elements survive truncation.
  • Split snapshot_parser into snapshot_parser/clickables/clickable_naming for the 200-LOC cap.
  • Workspace bump 3.0.0 → 3.1.0 (minor → triggers crates.io publish on tag).

Verification

  • Unit: ras-dom + ras-agent libs green.
  • Live e2e against headless Chrome: clickable_names_resolve_text_onclick_icon_and_role (ignored test) — anchor text, nested span text, onclick-derived name, role→button all confirmed.

🤖 Generated with Claude Code

KeyCode17 and others added 16 commits May 8, 2026 23:39
# Conflicts:
#	.github/workflows/publish.yml
chore(release): 2.1.0 → main
release: v2.2.0 (agent executor)
release: v2.3.0 (parser hotfix)
release: v2.4.0 (vision feedback)
release: v2.4.1 (anthropic ImageUrl fix)
release: v2.5.0 (CDP DomExtractor)
release: v2.6.0 (agent DOM grounding)
release: 2.7.0 - grounding chain closes
release: develop → main (2.7.x line: agent fixes, type_text index, clippy clean, README 2.x)
release: v3.0.0 — PerimeterX press-and-hold solver + CDP primitives
Previously the LLM received clickables as bare `[N] tag`, named only when
an aria-label/alt/title/name/placeholder/value attribute was present.
Anchor text, JS click handlers, and icon-only buttons arrived anonymous,
leaving the screenshot as the sole disambiguator.

- Detection unions the attribute heuristic with CDP's native isClickable
  set, catching JS-attached listeners, not just markup.
- ax_name falls back through: aria/alt/title/name/placeholder
  -> descendant text -> onclick handler name (humanized, verb only)
  -> FontAwesome icon class -> role.
- role overrides the displayed tag, so <i role="button"> renders as button.
- clickable_map: raise cap 80 -> 200 and sort visible-first so on-screen
  elements survive truncation.
- Split snapshot_parser into snapshot_parser/clickables/clickable_naming
  to satisfy the 200-LOC module cap.

Verified live against headless Chrome via the new (ignored) e2e test
clickable_names_resolve_text_onclick_icon_and_role.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@KeyCode17
KeyCode17 merged commit 97c4a84 into develop May 29, 2026
7 checks passed
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