Skip to content

feat(cua-driver-rs)(platform-windows,platform-linux): glide agent cursor to the field on set_value/type_text - #1731

Merged
f-trycua merged 1 commit into
mainfrom
feat/agent-cursor-on-type
May 27, 2026
Merged

feat(cua-driver-rs)(platform-windows,platform-linux): glide agent cursor to the field on set_value/type_text#1731
f-trycua merged 1 commit into
mainfrom
feat/agent-cursor-on-type

Conversation

@f-trycua

@f-trycua f-trycua commented May 27, 2026

Copy link
Copy Markdown
Collaborator

What

The agent-cursor overlay previously only glided to click targets. During set_value and type_text the cursor never moved to the field, so recordings showed fields filling with no indication of where the agent was acting.

This moves the agent cursor onto the target element before the write — reusing the same overlay helpers the click path already uses — whenever an element_index is supplied.

Changes

  • Windows (platform-windows/src/tools/impl_.rs): SetValueTool and TypeTextTool now pin_overlay_above + overlay_glide_to(center) + ClickPulse before writing.
  • Linux (platform-linux/src/tools/impl_.rs): SetValueTool and TypeTextTool resolve atspi::get_element_bounds and ClickPulse at the element center (mirrors the existing click path).
  • macOS: already animated the cursor (AgentCursor.animateAndWait) in both tools — no change.

The glide only fires when an element_index is provided (where a position is resolvable); the "type into the focused element" path is unchanged.

Testing

  • Windows: cargo build -p cua-driver
  • Linux / macOS not built on the authoring host (Windows). Linux change mirrors the existing click pattern; macOS was already correct.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added visual cursor animation and click pulse feedback for element-focused text entry operations
    • Added visual cursor animation and click pulse feedback for element-focused value setting operations
    • Available on both Linux and Windows platforms

Review Change Stack

…sor to the field on set_value/type_text

The agent-cursor overlay only animated to click targets, so `set_value`
and `type_text` filled fields with no visual cue of where the agent was
acting. Move/pulse the cursor onto the target element first — reusing the
same overlay helpers the click path already uses — when an `element_index`
is supplied.

- Windows (platform-windows/src/tools/impl_.rs): `SetValueTool` and
  `TypeTextTool` now pin_overlay_above + overlay_glide_to(center) +
  ClickPulse before writing.
- Linux (platform-linux/src/tools/impl_.rs): both tools resolve
  `atspi::get_element_bounds` and ClickPulse at the element center
  (mirrors the existing click path).
- macOS already animated the cursor (AgentCursor.animateAndWait) in both
  tools; no change.

The glide only fires when an element_index is provided (where a position
is resolvable); the focused-element typing path is unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel

vercel Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored May 27, 2026 8:50am

Request Review

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e7f1d88a-4b7e-4b48-aa5c-49d3a592fd82

📥 Commits

Reviewing files that changed from the base of the PR and between 9a36eb3 and 1f347c6.

📒 Files selected for processing (2)
  • libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs
  • libs/cua-driver/rust/crates/platform-windows/src/tools/impl_.rs

📝 Walkthrough

Walkthrough

Visual overlay feedback is added to element-targeted text typing and value setting on Linux and Windows. Tools now animate the cursor to the target element center and emit a click pulse before executing their action when an element index or cached position is available. Failures are silently ignored.

Changes

Overlay Visual Feedback for Element-Targeted Tools

Layer / File(s) Summary
Text input cursor animation
libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs, libs/cua-driver/rust/crates/platform-windows/src/tools/impl_.rs
TypeTextTool on both platforms now resolves or retrieves the target element's center position and emits an overlay ClickPulse before sending typed text, providing visual feedback when element_index or cached element center is available.
Value setting cursor animation
libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs, libs/cua-driver/rust/crates/platform-windows/src/tools/impl_.rs
SetValueTool on both platforms now resolves or retrieves the target element's center position and emits an overlay ClickPulse before executing set_value via AT-SPI or UIA, with graceful failure handling for unresolvable bounds or overlay failures.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A whisper of light, a pulse on the screen,
Where fingers shall type and values are seen—
Two platforms aligned in overlay dance,
Before every keystroke, a visual glance! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: adding agent cursor movement (glide) to target fields during set_value and type_text operations across two platforms.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/agent-cursor-on-type

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@f-trycua
f-trycua merged commit 386819c into main May 27, 2026
6 of 7 checks passed
@f-trycua
f-trycua deleted the feat/agent-cursor-on-type branch May 27, 2026 10:04
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