Repository navigation
fix(click): emit every press in a DOM multi-click sequence - #353
Merged
Merged
Conversation
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.
Summary
For a DOM ref or CSS selector,
click_count: 2currently sends only one press/release pair with CDPclickCount: 2. Chrome emitsdblclick, but the firstmousedown,mouseup, andclicknever occur. A widget that uses the first click to select an item and the second to open it therefore receives a different sequence from a normal double-click.Emit every consecutive native press/release pair for DOM clicks. Fixes #349.
Reproduction and evidence
Failing base: 8cbcc490. Validated PR head: c8269cc1.
On a page with
#target, recordmousedown,mouseup,click, anddblclick, including each event'sdetailandisTrusted. The affected command is:The committed dom-multiclick.browser.test.ts invokes the equivalent production
handleClickrequest, then compares it with an explicit count-1/count-2 native CDP control on the same element.All recorded events have
isTrusted: true. The hosted browser log includesDOUBLE_CLICK_PROOFwith identical fixed and control arrays. The defect is the missing first click; it is not a missingdblclickevent.Implementation
In dispatchClickAtPoint, iterate counts
1through the requested count for both DOM and visual-point paths. Previously only the visual-point path emitted the full sequence.Validation
Local environment: macOS, Node 26.10.0, pnpm 10.17.0, Vitest 4.1.6, Chrome 153.0.8010.54.
visual-ref.test.tsfile-transfer.test.tsgit diff --checkLocal focused total: 162 passed. The new browser regression failed against the base implementation with only the count-2 events.
Use the repository's declared pnpm 10.17.0, from the repository root. The local runs used
npm exec --yes --package pnpm@10.17.0 -- pnpm ...to select that version. SetBSK_CLICK_CHROMEto an installed Chrome executable; without it the browser test is skipped.Hosted status for c8269cc1, checked 2026-09-26 UTC: all 8 reported checks passed, including frontend validation and browser validation. The browser job's
*click*.browser.test.tsselection includes the new test; that job passed 12 tests across 8 files, including the existing debugging and observation suites.Verification boundary
The browser regression exercises a selector against real Chrome; the ref path and interruption cases use unit adapters. The headless harness adapts tab/window metadata and invokes the extension handler directly, so it is not an installed CLI/daemon/extension end-to-end run. Both tests and observed output focus on double-clicks; the implementation also emits the requested consecutive sequence for larger valid DOM counts.