fix: element_index clicks should produce click.png in cua-driver-rs trajectory recorder (Windows)#1737
Conversation
…rajectory recorder (Windows)
|
@mvanhorn is attempting to deploy a commit to the Cua Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThis PR adds click.png markers for element_index-based clicks on Windows by parsing screen coordinates from result_summary and converting them to screenshot-local coordinates using a new platform callback that resolves window bitmap origins via DwmGetWindowAttribute. ChangesClick.png markers for element_index clicks with window bitmap coordinate conversion
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
libs/cua-driver/rust/crates/platform-windows/src/recording_hooks.rs (1)
68-70: 💤 Low valueConsider centralizing
DWM_CROP_INSET_PX.The constant is duplicated with a sync comment. A shared constant in a common module would eliminate the risk of divergence during future maintenance.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@libs/cua-driver/rust/crates/platform-windows/src/recording_hooks.rs` around lines 68 - 70, Multiple copies of DWM_CROP_INSET_PX are maintained separately (here and in capture::DWM_CROP_INSET_PX and tools::impl_::bitmap_to_screen); create a single shared constant and reference it everywhere to avoid drift. Add a single public constant (e.g., pub(crate) const DWM_CROP_INSET_PX: i32 = 1) in a common module (like a new crate-level constants module or existing capture module), replace the local const DWM_CROP_INSET_PX in recording_hooks.rs with an import/use of that shared constant, and update the other places (capture and tools::impl_::bitmap_to_screen) to reference the same symbol instead of defining their own copies; keep the type as i32 and ensure visibility is appropriate for all callers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@libs/cua-driver/rust/crates/platform-windows/src/recording_hooks.rs`:
- Around line 68-70: Multiple copies of DWM_CROP_INSET_PX are maintained
separately (here and in capture::DWM_CROP_INSET_PX and
tools::impl_::bitmap_to_screen); create a single shared constant and reference
it everywhere to avoid drift. Add a single public constant (e.g., pub(crate)
const DWM_CROP_INSET_PX: i32 = 1) in a common module (like a new crate-level
constants module or existing capture module), replace the local const
DWM_CROP_INSET_PX in recording_hooks.rs with an import/use of that shared
constant, and update the other places (capture and
tools::impl_::bitmap_to_screen) to reference the same symbol instead of defining
their own copies; keep the type as i32 and ensure visibility is appropriate for
all callers.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e47c1614-78fa-469a-bccb-4d795843b2cb
📒 Files selected for processing (4)
libs/cua-driver/rust/crates/cua-driver-core/src/recording.rslibs/cua-driver/rust/crates/cua-driver-core/src/recording_loader.rslibs/cua-driver/rust/crates/cua-driver/src/main.rslibs/cua-driver/rust/crates/platform-windows/src/recording_hooks.rs
Summary
fix: element_index clicks should produce click.png in cua-driver-rs trajectory recorder (Windows)
Closes #1725
AI was used for assistance.
Summary by CodeRabbit
Bug Fixes
Tests