Skip to content

fix(record): deduplicate clicks forwarded by label activation - #652

Open
columbia11 wants to merge 1 commit into
Tencent:mainfrom
columbia11:codex/fix-645-label-click-dedup
Open

columbia11 wants to merge 1 commit into
Tencent:mainfrom
columbia11:codex/fix-645-label-click-dedup

Conversation

@columbia11

Copy link
Copy Markdown
Contributor

A real pointer click on a clickable label produces a trusted label click followed by a trusted control click, both with detail: 1. The recorder only suppressed a forwarded click with detail: 0, so one checkbox activation could be recorded as separate label and input actions.

Suppress the associated control click only after the label was actually recorded and its control is enabled. Use a bounded, single-use activation record that expires after the event task and is cleared on disposal. Preserve the originating event's cancellation and dispatch state to distinguish a synchronous handler-forwarded click from an independent control click after the handler returns.

Add real Chrome regressions covering pointer and plain labels, implicit labels, direct and subsequent control clicks, Space activation, cancelled labels, handler forwarding, disabled and missing controls, nested buttons, activation expiry, and programmatic clicks. The change is limited to the collector and its browser tests; it does not change the buffer or reducer.

Fixes #645.

Validation against upstream main at 9084a36e:

  • Six test files: 98 passed, including 14 real Chrome cases, with no skipped cases in that run.
  • Biome check for both changed files and git diff --check: passed.
  • Independent code review, including the final event-phase case: no findings.
  • Local type checking is not green: the existing Chrome-only configuration reports 1790 baseline diagnostics and 1792 with this patch. The two added diagnostics are missing node:url/process ambient types in the new Node browser fixture; production code adds none. With the same installed Node ambient types loaded on both sides, both report 2757 diagnostics with zero new fingerprints. No dependencies or project type configuration were changed.

The browser tests bundle the production collector and use an owned headless Chrome profile with real CDP pointer/keyboard input. They do not claim installed-extension, CLI, daemon, or recipe-playback end-to-end coverage.

This branch has not been deployed

No deployments
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.

录制将一次 pointer 样式的 label 点击重复记为 label 和 checkbox 两步

1 participant