refactor(cua-driver): clarify macOS drag endpoint semantics - #3270
refactor(cua-driver): clarify macOS drag endpoint semantics#3270ctaylor86 wants to merge 1 commit into
Conversation
injaneity
left a comment
There was a problem hiding this comment.
blocking: this changes the recorded endpoint from the release location to an earlier movement sample.
drag_to stores the last MouseDragged event, while (x, y) on MouseUp is where the button was released. those values answer different questions: the dragged sample can classify whether a drag occurred, but the mouse-up sample is the final endpoint. event sampling can legitimately make them differ, so consistency is not evidence that the earlier value is correct. the windows backend also records its button-up position as HumanEvent::Drag::to.
please keep (x, y) as the emitted endpoint and clarify the classification variable instead. if macOS reports unreliable mouse-up coordinates, this needs native evidence establishing that platform limitation. the added test currently enshrines a stale endpoint without such evidence.
Keep the mouse-up position as the recorded drag endpoint while naming the last dragged sample for its classification-only role. Add a regression test proving the distinction.
2f84957 to
ce9883c
Compare
|
Thank you, this distinction is correct. I reconciled the review against the Windows backend and amended the PR: the recorded endpoint remains the |
What
Clarifies the macOS drag endpoint semantics after maintainer review of the original follow-up.
The last
MouseDraggedsample is used only to classify whether the gesture crossed the drag threshold. The emittedHumanEvent::Drag::toremains theMouseUprelease position, matching the Windows backend. The classification-only variable is now named accordingly, and a regression test uses intentionally different dragged and release coordinates to prove the distinction.This focused follow-up targets the owning
feat/demonstration-recordingbranch after #3248 was merged into #2016.Verification
cargo fmt --all -- --checkcargo clippy -p input-capture --all-targets -- -D warningscargo test -p input-capture --no-fail-fast: 27 passedcargo test -p cua-driver-core --locked: 427 unit, 2 contract-parity and 3 session-lifecycle tests passedgit diff --checkce9883c2: passed with no security or logic findingsFollow-up to #3248. Parent contribution: #2016.