Skip to content

Conversation

@ckbedwell
Copy link
Contributor

Problem

Currently, we don't track when users interact with feature tabs in the check editor sidepanel. This limits our ability to understand which features are being used and how users navigate between different feature tabs.

Solution

This PR adds tracking for feature tab changes in the check editor. When a user switches between feature tabs (such as Secrets, Docs, etc.), we now track this interaction with the feature_tab_changed event. The tracking includes the label of the selected tab and the source context (check_editor_sidepanel_feature_tabs), providing visibility into feature usage patterns.

The implementation:

  • Adds a new tracking event function trackFeatureTabChanged in the check form events module
  • Integrates the tracking into the FeatureTabsContext to automatically track tab changes
  • Uses a callback wrapper to ensure tracking fires whenever a tab is activated

@ckbedwell ckbedwell requested a review from a team as a code owner November 27, 2025 10:49
@ckbedwell ckbedwell requested review from VikaCep and removed request for a team November 27, 2025 10:49
@github-actions github-actions bot added the feature A feature added to the application. label Nov 27, 2025
@github-actions
Copy link

github-actions bot commented Nov 27, 2025

Script size changes

Name +/- Main This PR Outcome
[502.js] = 1,736.41 kB 1,736.41 kB
[224.js] = 955.56 kB 955.65 kB
[datasource/module.js] = 24.49 kB 24.49 kB
[692.js] = 20.41 kB 20.41 kB
[663.js] = 5.84 kB 5.84 kB
[module.js] = 4.92 kB 4.92 kB

Totals

Name +/- Main This PR Outcome
[Scripts] = 2,747.63 kB 2,747.72 kB
[Non-script Assets] = 2,660.26 kB 2,660.26 kB
[All] = 5,407.88 kB 5,407.97 kB

Generated by 🚫 dangerJS against 8967d40

@ckbedwell ckbedwell requested a review from Copilot November 27, 2025 10:56
Copilot finished reviewing on behalf of ckbedwell November 27, 2025 10:59
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 for feature tab changes in the check editor sidepanel to provide visibility into how users interact with different features. When users switch between tabs (Test, Secrets, Docs), the feature_tab_changed event is now tracked with the selected tab label and source context.

Key changes:

  • Added a new trackFeatureTabChanged function to track tab selection events
  • Integrated tracking into the FeatureTabsContext using a callback wrapper
  • Added a minor formatting improvement to SecretsPanel.tsx

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/features/tracking/checkFormEvents.ts Defines the new trackFeatureTabChanged tracking event with label and source parameters
src/components/Checkster/contexts/FeatureTabsContext.tsx Wraps the setActive function with handleSetActive callback that triggers tracking on tab changes
src/components/Checkster/feature/secrets/SecretsPanel.tsx Minor formatting change (added blank line)

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


interface FeatureTabChanged extends TrackingEventProps {
/** The label of the feature tab. */
label: FeatureTabLabel;
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

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

The label field in FeatureTabChanged interface is typed as FeatureTabLabel, which is ComponentProps<typeof Tab>['label']. This type can include React elements and other non-primitive values. However, TrackingEventProps only accepts boolean | string | number | undefined. This type mismatch could cause runtime issues if a tab label is anything other than a string or number.

Consider constraining the type to ensure only trackable values are accepted:

interface FeatureTabChanged extends TrackingEventProps {
  /** The label of the feature tab. */
  label: string;
}
Suggested change
label: FeatureTabLabel;
label: string;

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm. Good point. We should change this to only allowing a string in the label prop. Will do that in another PR.

VikaCep
VikaCep previously approved these changes Nov 27, 2025
Copy link
Contributor

@VikaCep VikaCep left a comment

Choose a reason for hiding this comment

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

LGTM!

@ckbedwell ckbedwell merged commit 271340f into main Nov 27, 2025
25 checks passed
@ckbedwell ckbedwell deleted the feat/track-feature-tab-changes branch November 27, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A feature added to the application.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants