Skip to content

[ALS-12894] Log token copies made by mouse click - #757

Open
JamesPeck wants to merge 2 commits into
mainfrom
worktree-copy-button-logging
Open

[ALS-12894] Log token copies made by mouse click#757
JamesPeck wants to merge 2 commits into
mainfrom
worktree-copy-button-logging

Conversation

@JamesPeck

Copy link
Copy Markdown
Collaborator

Copying your token from the Analyze/API page wasn't showing up in the logs. Turns out it never could: the log call lived on a <span> wrapped around the copy button, but the button stops click propagation, so the span's handler never fired. Pressing Enter on the button did log, since keydown wasn't stopped — so we were recording a small and misleading slice of actual token copies.

Logging now lives inside CopyButton itself, on the same success path the copy uses, driven by logAction / logEventType / logMetadata props. Call sites just declare what to log. The wrapper span is gone, which also removes a role="button" span nested around a real button.

The Analyze/API page wrapped the token CopyButton in a span whose onclick
fired the token.copy log event. CopyButton's Popover trigger calls
stopPropagation on click, so that handler never ran and mouse-driven copies
went unlogged; only keyboard Enter, which wasn't stopped, made it through.

Move the logging into CopyButton behind logAction/logEventType/logMetadata
props so it fires on the successful-copy path, and drop the wrapper span
(which also nested a role="button" element around a real button).
@JamesPeck JamesPeck added the bug Something isn't working label Sep 3, 2026
@JamesPeck
JamesPeck requested a review from srpiatt September 3, 2026 23:25
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: b77a76d2-5ea9-4c96-9fff-028b1e3b07c7


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.

@dbmi-svc-checkmarx

dbmi-svc-checkmarx commented Sep 3, 2026

Copy link
Copy Markdown

Logo
Checkmarx One – Scan Summary & Details7e4a96de-9845-4aef-bc2a-2f09fe2c5924


New Issues (2) Checkmarx found the following issues in this Pull Request
# Severity Issue Source File / Package Checkmarx Insight
1 MEDIUM CVE-2026-84371 Npm-sanitize-html-2.17.6
detailsRecommended version: 2.17.7
Description: ApostropheCMS is an open-source Node.js content management system, and sanitize-html provides a simple HTML sanitizer with a clear API. From versio...
Attack Vector: NETWORK
Attack Complexity: LOW
Vulnerable Package
2 MEDIUM CVE-2026-84373 Npm-vitest-4.1.6
detailsRecommended version: 4.1.11
Description: Vitest is a testing framework powered by Vite. From 2.1.0 until 4.1.11 and 5.0.0-rc.2, the public mockerPlugin and standalone interceptorPlugin exp...
Attack Vector: NETWORK
Attack Complexity: HIGH
Vulnerable Package

Use @Checkmarx to interact with Checkmarx PR Assistant.
Examples:
@Checkmarx how are you able to help me?
@Checkmarx rescan this PR

The only consumer, CopyButtonCell, now declares its log event through
logAction/logMetadata, so oncopy has no callers left.
@JamesPeck JamesPeck changed the title [Bug] Log token copies made by mouse click [ALS-12894] Log token copies made by mouse click Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants