Skip to content

Add action telemetry to onboarding funnel - #442

Open
shilman wants to merge 4 commits into
shilman/storybook-10-5from
shilman/action-telemetry
Open

Add action telemetry to onboarding funnel#442
shilman wants to merge 4 commits into
shilman/storybook-10-5from
shilman/action-telemetry

Conversation

@shilman

@shilman shilman commented Jul 26, 2026

Copy link
Copy Markdown
Member

@ghengeveld My biggest concern here is this event, which is kind of weird. Do we need the path at all? Can it be simplified? I also don't know if we need every single event here. But I don't think it hurts. Also there is telemetry for startBuild events (including a bugfix for the test provider build, which you should look at), but no telemetry for buildComplete/buildError, which is a little weird.

Screen Action Trigger Extra
CatchAChangeComplete completeOnboarding Done / Take a tour path: skippedSecondBuild | completedSecondBuild

Summary

Add action telemetry for the VTA onboarding funnel

  • return a screen-scoped action tracker from useTelemetry
  • track user actions throughout authentication, project linking, and onboarding
  • attach onboarding screen context to existing build actions
  • add Storybook interaction coverage for key telemetry payloads, including the persisted welcome/sign-in edge case

Events

Screen Action Trigger Extra
Welcome continue Get started
Welcome uninstallAddon Uninstall addon
Signin goBack Return to welcome
Signin signIn Sign in with Chromatic
Signin signInWithSSO Choose SSO
Subdomain goBack Return to sign in
Subdomain submitSubdomain Submit SSO subdomain
Verify goBack Return to sign in
Verify signIn Go to Chromatic
LinkProject selectAccount Select an account
LinkProject createProject Open project creation
LinkProject selectProject Select an existing project
LinkedProject continue Continue to onboarding
InitialBuild startBuild Take snapshots
InitialBuild skipOnboarding Skip walkthrough
InitialBuildComplete catchAChange Start change walkthrough
InitialBuildComplete skipOnboarding Skip walkthrough
CatchAChange startBuild Run visual tests
CatchAChange skipOnboarding Skip walkthrough
CatchAChangeComplete completeOnboarding Done / Take a tour path: skippedSecondBuild | completedSecondBuild
CatchAChangeComplete skipOnboarding Skip walkthrough
BuildError startBuild Try again
BuildError skipOnboarding Skip walkthrough
AccountSuspended continue Dismiss and continue

Screen impressions remain unchanged and continue to emit { location, screen } without an action.

Validation

  • yarn gate

Copilot AI review requested due to automatic review settings July 26, 2026 13:25
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.94118% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.51%. Comparing base (384fa45) to head (0f90147).

Files with missing lines Patch % Lines
src/screens/Authentication/Authentication.tsx 73.91% 12 Missing ⚠️
src/screens/Onboarding/CatchAChangeComplete.tsx 46.66% 8 Missing ⚠️
src/utils/useBuildEvents.ts 0.00% 7 Missing and 1 partial ⚠️
src/screens/LinkProject/LinkProject.tsx 46.15% 7 Missing ⚠️
src/screens/LinkProject/LinkedProject.tsx 40.00% 3 Missing ⚠️
src/screens/Onboarding/CatchAChange.tsx 82.35% 3 Missing ⚠️
src/screens/Onboarding/InitialBuildComplete.tsx 83.33% 3 Missing ⚠️
src/TestProviderRender.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##           shilman/storybook-10-5     #442      +/-   ##
==========================================================
+ Coverage                   74.46%   74.51%   +0.05%     
==========================================================
  Files                         163      164       +1     
  Lines                       12753    12900     +147     
  Branches                     1123     1136      +13     
==========================================================
+ Hits                         9496     9612     +116     
- Misses                       3240     3271      +31     
  Partials                       17       17              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 expands telemetry to include a consistent, screen-scoped “action” vocabulary across the authentication → project linking → onboarding funnel, and adds Storybook interaction coverage to validate key telemetry payloads (including the persisted welcome/sign-in edge case).

Changes:

  • Introduces a closed TelemetryAction union and returns a screen-scoped action tracker from useTelemetry (plus a new useTrackAction for action-only tracking).
  • Threads action tracking through Authentication / LinkProject / Onboarding flows and tags build-trigger events with optional { location, screen } context.
  • Adds a reusable Storybook telemetrySpy helper and new interaction stories that assert emitted telemetry payloads.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/utils/useBuildEvents.ts Adds optional build trigger context and includes it in startBuild/stopBuild telemetry payloads.
src/utils/telemetrySpy.tsx Adds a Storybook helper to inject a telemetry spy for interaction assertions.
src/utils/TelemetryContext.tsx Adds TelemetryAction, useTrackAction, and updates useTelemetry to return an action tracker.
src/TestProviderRender.tsx Wrapes build stop handler to avoid passing click events into the new signature.
src/screens/VisualTests/StoryInfo.tsx Wrapes build start handler to avoid passing click events into the new signature.
src/screens/VisualTests/SnapshotControls.tsx Wrapes build start handler to avoid passing click events into the new signature.
src/screens/VisualTests/RunBuildContext.tsx Updates context typings so build actions can accept optional telemetry context.
src/screens/VisualTests/NoBuild.tsx Wrapes build start handler to avoid passing click events into the new signature.
src/screens/VisualTests/BuildResults.tsx Wrapes start/stop handlers to avoid passing click events into the new signature.
src/screens/Onboarding/Onboarding.tsx Tracks actions on error/suspended flows and tags retry build with screen context.
src/screens/Onboarding/Onboarding.stories.tsx Adds Storybook interaction coverage asserting onboarding/build-error telemetry payloads.
src/screens/Onboarding/InitialBuildComplete.tsx Tracks “catchAChange” and “skipOnboarding” actions.
src/screens/Onboarding/InitialBuild.tsx Tracks “skipOnboarding” and tags “startBuild” with onboarding screen context.
src/screens/Onboarding/CatchAChangeComplete.tsx Tracks completion/skips and includes a path discriminator in completion payloads.
src/screens/Onboarding/CatchAChange.tsx Tracks skip action and tags “startBuild” with onboarding screen context.
src/screens/LinkProject/LinkProject.tsx Tracks account/project selection and project creation actions.
src/screens/LinkProject/LinkedProject.tsx Tracks “continue” action when proceeding to onboarding.
src/screens/Authentication/Verify.tsx Tracks verify-step sign-in action without duplicating view telemetry.
src/screens/Authentication/Authentication.tsx Tracks navigation/sign-in actions and fixes screen attribution for persisted welcome→signin case.
src/screens/Authentication/Authentication.stories.tsx Adds Storybook interaction coverage asserting authentication telemetry payloads (including persisted state case).
Comments suppressed due to low confidence (1)

src/utils/useBuildEvents.ts:61

  • context is optional, but it's being object-spread into the telemetry payload. This will fail TypeScript type-checking and should default to {} when omitted.
            trackEvent?.({ ...context, action: 'stopBuild' });

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/utils/useBuildEvents.ts Outdated
Comment thread src/utils/TelemetryContext.tsx
Comment thread src/utils/telemetrySpy.tsx
@shilman shilman added enhancement Classification: Improvement to existing feature patch Auto: Increment the patch version when merged labels Jul 26, 2026
@shilman shilman added the release Auto: Create a `latest` release when merged label Jul 26, 2026
@shilman shilman assigned ghengeveld and unassigned ghengeveld Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Classification: Improvement to existing feature patch Auto: Increment the patch version when merged release Auto: Create a `latest` release when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants