Skip to content

chore: Track where script is copied from#820

Merged
going-confetti merged 3 commits intomainfrom
chore/script-copy-track-source
Sep 12, 2025
Merged

chore: Track where script is copied from#820
going-confetti merged 3 commits intomainfrom
chore/script-copy-track-source

Conversation

@going-confetti
Copy link
Collaborator

@going-confetti going-confetti commented Sep 11, 2025

Description

Add the new source property to the script_copied event payload to better understand the real user flow.

How to Test

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (npm run lint) and all checks pass.
  • I have run tests locally (npm test) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Screenshots (if appropriate):

Related PR(s)/Issue(s)

}, [])

const handleCopy = useTrackScriptCopy(script)
const handleCopy = useTrackScriptCopy(script, 'validator')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this is confusing when a debug run is started from the validator dialog?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to start calling it debugger in the code. We mention debugging in the Home-page, so I feel its a good fit.

@going-confetti going-confetti marked this pull request as ready for review September 12, 2025 10:32
@going-confetti going-confetti requested a review from a team as a code owner September 12, 2025 10:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

@allansson allansson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@going-confetti going-confetti merged commit 23836a0 into main Sep 12, 2025
7 checks passed
@going-confetti going-confetti deleted the chore/script-copy-track-source branch September 12, 2025 13:34
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.

2 participants