Skip to content

Improve agent cursor glide timing and click target resolution - #3343

Merged
esokullu merged 3 commits into
webbrain-one:mainfrom
esokullu:main
Nov 9, 2026
Merged

esokullu merged 3 commits into
webbrain-one:mainfrom
esokullu:main

Conversation

@esokullu

@esokullu esokullu commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

esokullu and others added 3 commits November 9, 2026 14:25
The purple agent cursor only started moving as the click went out (and,
for selector clicks, only after the click succeeded), so it always
arrived after the page had already reacted. Its glide was a CSS
transition, which the display:none around each post-action screenshot
cancelled, so it usually looked like a jump.

Cursor (agent-visual-indicator.js, both builds):
- Glides with the Web Animations API, 360-760 ms by distance, so the
  move keeps its timing through screenshot hides.
- New WB_SHOW_AGENT_TARGET phases: 'approach' glides ahead of an input
  and replies arriveInMs; 'done' takes the input's verdict.
- Presses once when the trusted click reaches the page (or on a success
  verdict); a failed click gets no press. Rests and blinks in between.

Agent (agent.js, both builds):
- _leadAgentCursor glides the cursor onto the target and waits for the
  landing (capped at AGENT_CURSOR_LEAD_MAX_MS = 800) before the click's
  page checks and dispatch: click by text, selector, coordinates, vision
  and click_ax in Chrome; click_ax in Firefox.
- Only on a tab showing the run (background.js exposes
  activeIndicatorTabs); no wait in background tabs, during screenshots
  or under reduced motion.
- _settleAgentCursor sends the verdict after click / click_ax.

Tests: test/agent-cursor-lead.mjs (runtime-unit shard) and a browser
test in page-monitor-ui.mjs for glide, capture survival, press-with-
click, no double press, failed-click and blink.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsDq6DfcbTGESyuv6gmM7q
Codex review on #614: click({text}) resolved its target and ran its
SELECT checks, then waited for the cursor glide, then pressed at the
old coordinates. A page that reflowed during the glide (content loading
above the target) could get a different control clicked.

- click by text: resolve, glide the cursor there, and when it waited,
  resolve the text again. The SELECT checks, the progress baseline and
  the press all use the fresh resolution.
- click by coordinates: glide before the SELECT check and the input
  redirect, so they read the page as it is at the click.
- _leadAgentCursor resolves to whether it waited, so a caller holding
  geometry from before the wait knows to resolve again.

Selector, vision and click_ax clicks already glide before resolving
their target.

Tests (delivery-cdp-input.mjs): a text target that moves during the
glide is pressed where it is after it; a coordinate click checks its
point only after the glide. Both fail on the previous commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsDq6DfcbTGESyuv6gmM7q
Agent cursor reaches its target before the click
@vercel

vercel Bot commented Nov 9, 2026

Copy link
Copy Markdown

@esokullu is attempting to deploy a commit to the esokullu's projects Team on Vercel.

A member of the Team first needs to authorize it.

@esokullu
esokullu merged commit 59a90ca into webbrain-one:main Nov 9, 2026
1 of 3 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