Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: convert analytics context from string to enum #1551

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

VolodymyrBg
Copy link

@VolodymyrBg VolodymyrBg commented Jan 12, 2025

What changed? Why?

  • Added AnalyticsContext enum to replace string-based context values
  • Updated CCAEventData type to use AnalyticsContext enum
  • Renamed React context to AnalyticsReactContext to avoid naming conflicts
  • Consolidated all known context values into a single enum
    These changes improve type safety by preventing typos in context values and make it easier to track all possible analytics contexts in one place. This resolves the TODO comment about converting context to enum.

Notes to reviewers

  • The change is mostly type-level, with no runtime behavior changes
  • All existing context string values have been preserved in the enum
  • The enum is split into two sections: Navigation/UI contexts and Feature-specific contexts
  • The React context was renamed to avoid naming collision with the new enum

How has it been tested?

  • TypeScript compilation passes
  • Existing usage of context values remains compatible through the enum values
  • No runtime behavior changes as the string values remain the same
  • Manual testing of analytics events confirms data is still logged correctly

Copy link

vercel bot commented Jan 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web-base-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 12, 2025 9:02am

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Jan 12, 2025

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

Copy link

vercel bot commented Jan 12, 2025

@VolodymyrBg is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
base web review To be reviewed by the Base web team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants