chore: Track where script is copied from#820
Merged
going-confetti merged 3 commits intomainfrom Sep 12, 2025
Merged
Conversation
going-confetti
commented
Sep 12, 2025
| }, []) | ||
|
|
||
| const handleCopy = useTrackScriptCopy(script) | ||
| const handleCopy = useTrackScriptCopy(script, 'validator') |
Collaborator
Author
There was a problem hiding this comment.
Perhaps this is confusing when a debug run is started from the validator dialog?
Collaborator
There was a problem hiding this comment.
I want to start calling it debugger in the code. We mention debugging in the Home-page, so I feel its a good fit.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds tracking functionality to identify where script copying originates from in the application. The change enhances analytics by distinguishing between scripts copied from the generator view versus the validator view.
- Adds source parameter to track script copy events with 'generator' or 'validator' origin
- Updates the useTrackScriptCopy hook to accept and pass the source parameter
- Modifies ScriptCopiedEvent type to include payload with source information
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/hooks/useTrackScriptCopy.ts | Updates hook signature to accept source parameter and includes it in tracking event |
| src/services/usageTracking/types.ts | Adds payload with source field to ScriptCopiedEvent interface |
| src/views/Generator/GeneratorTabs/ScriptPreview.tsx | Passes 'generator' as source when calling useTrackScriptCopy |
| src/components/Validator/ExecutionDetails.tsx | Passes 'validator' as source when calling useTrackScriptCopy |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Description
Add the new
sourceproperty to thescript_copiedevent payload to better understand the real user flow.How to Test
Checklist
npm run lint) and all checks pass.npm test) and all tests pass.Screenshots (if appropriate):
Related PR(s)/Issue(s)