Repository navigation
fix(cua): retarget SoM container-clicks to the nearest link/button — fix multi-step nav - #955
Merged
Merged
Conversation
…fix multi-step nav Re-audit on the current build isolated the last open fault: multi-step click+nav (and the contenteditable-write flow it gates) failed because a SoM click on a feed row resolved to a NON-actionable container (DIV.post-author-meta) even though the brain aimed at the author-name link inside it. cdp_click_at_point's el.click() on that div does nothing, so navigation clicks looped to a halt. Fix (same family as #952's el.focus): before clicking, snap a non-actionable target to the nearest actionable element — an ancestor <a>/<button>, or a SINGLE actionable descendant whose box is within 40px of the click point (bounded so we never jump to a distant link in a huge container). Report retargeted/target_tag. VERIFIED live: the multi-step "open the author's profile and read the headline" task went halted(loop) → succeeded — the click retargeted to <a href="/in/lena-tanaka-9d79/"> and navigated to the profile (logs show the next frame is DIV.hero-banner on the profile page). Tests: test_cua_input_focus_feedback.py — SoM JS carries the retarget helpers and clicks the retargeted element. 6 pass; ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The last open fault from the re-audit
The re-audit (#954 harness) on the current build isolated the real remaining
CUA fault: multi-step click+nav (and the contenteditable-write flow it
gates) failed. Diagnosis from the executor logs:
The brain correctly aimed at the author's name, but the SoM click resolved
to the parent
DIV.post-author-meta, not the<a class="post-author-name" href="/in/...">inside it.cdp_click_at_point'sel.click()on a non-linkdiv does nothing → no navigation → loop → halt.
Fix (same family as #952's
el.focus)Before clicking, snap a non-actionable target to the nearest actionable element:
an ancestor
<a>/<button>, or a single actionable descendant whose box iswithin 40px of the click point (bounded so we never jump to a distant link
in a huge container). Report
retargeted/target_tag.Verified live
Deployed to cua-server; the multi-step "open the author's profile and read the
headline" task went halted (loop) →
succeeded. Logs show the clickretargeted to
<a href="/in/lena-tanaka-9d79/">and the very next frame isDIV.hero-banneron the profile page — real navigation.Tests
test_cua_input_focus_feedback.py— the SoM JS carries the retarget helpers andclicks the retargeted element. 6 pass;
ruffclean.This closes the multi-step click fault; combined with #948/#951/#952 (brain +
type-landing), the
/v1/cuacapability now covers read + type + click-to-navigate.🤖 Generated with Claude Code