[ALS-12894] Log token copies made by mouse click - #757
Open
JamesPeck wants to merge 2 commits into
Open
Conversation
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).
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 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 |
|
New Issues (2)Checkmarx found the following issues in this Pull Request
Use @Checkmarx to interact with Checkmarx PR Assistant. |
The only consumer, CopyButtonCell, now declares its log event through logAction/logMetadata, so oncopy has no callers left.
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.


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
CopyButtonitself, on the same success path the copy uses, driven bylogAction/logEventType/logMetadataprops. Call sites just declare what to log. The wrapper span is gone, which also removes arole="button"span nested around a real button.