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

feat: Add metrics event for advanced details section toggling #26083

Merged
merged 6 commits into from
Jul 25, 2024

Conversation

pedronfigueiredo
Copy link
Contributor

@pedronfigueiredo pedronfigueiredo commented Jul 24, 2024

Description

We recently introduced the advanced details toggle for redesigned transactions. This PR adds a metrics event that gets fired every time that toggle is pressed.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2736

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@pedronfigueiredo pedronfigueiredo added the team-confirmations Push issues to confirmations team label Jul 24, 2024
@pedronfigueiredo pedronfigueiredo self-assigned this Jul 24, 2024
@pedronfigueiredo pedronfigueiredo requested review from a team as code owners July 24, 2024 09:30
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR introduces a metrics event for tracking the toggling of the advanced details section in transaction confirmations.

  • test/e2e/tests/confirmations/transactions/metrics.spec.ts: Added a test case to verify the metrics event for the advanced details toggle.
  • ui/pages/confirmations/components/confirm/header/header-info.tsx: Implemented the trackEvent function to log the advanced details toggle event.
  • ui/pages/confirmations/hooks/useTransactionEventFragment.js: Updated to include the fragment object in the returned value, ensuring proper tracking and updating of transaction event fragments.

3 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR adds a metrics event for tracking the toggling of the advanced details section in transaction confirmations.

  • app/scripts/lib/transaction/metrics.test.ts: Added getIsConfirmationAdvancedDetailsOpen mock function to mockTransactionMetricsRequest.
  • app/scripts/lib/transaction/metrics.ts: Introduced getIsConfirmationAdvancedDetailsOpen method to capture the state of the advanced details section.
  • app/scripts/metamask-controller.js: Added getIsConfirmationAdvancedDetailsOpen method to controllerActions for state retrieval.
  • test/e2e/tests/confirmations/transactions/metrics.spec.ts: Added assertions for transaction_advanced_view property in metrics events.
  • ui/pages/confirmations/components/confirm/header/header-info.tsx: Removed trackEvent call from setShowAdvancedDetails function.

5 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR introduces a metrics event for tracking the toggling of the advanced details section in transaction confirmations.

  • test/e2e/tests/confirmations/transactions/metrics.spec.ts: Added end-to-end test to verify metrics events for advanced details toggling.
  • app/scripts/lib/transaction/metrics.test.ts: Introduced getIsConfirmationAdvancedDetailsOpen mock function.
  • app/scripts/lib/transaction/metrics.ts: Added getIsConfirmationAdvancedDetailsOpen method to capture advanced details state.
  • app/scripts/metamask-controller.js: Integrated getIsConfirmationAdvancedDetailsOpen method for state retrieval.
  • ui/pages/confirmations/components/confirm/header/header-info.tsx: Removed trackEvent call from setShowAdvancedDetails function.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR introduces a metrics event for tracking the toggling of the advanced details section in transaction confirmations.

  • app/scripts/lib/transaction/metrics.ts: Added getIsConfirmationAdvancedDetailsOpen method to capture advanced details state.
  • app/scripts/metamask-controller.js: Integrated getIsConfirmationAdvancedDetailsOpen method for state retrieval.
  • ui/pages/confirmations/components/confirm/header/header-info.tsx: Added metrics event for advanced details toggling.
  • test/e2e/tests/confirmations/transactions/metrics.spec.ts: Added end-to-end test to verify metrics events for advanced details toggling.
  • app/scripts/lib/transaction/metrics.test.ts: Introduced getIsConfirmationAdvancedDetailsOpen mock function.

115 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR introduces a metrics event for tracking the toggling of the advanced details section in transaction confirmations.

  • ui/pages/confirmations/components/confirm/header/header-info.tsx: Removed unused import and added a new metrics event for toggling the advanced details section.
  • app/scripts/metamask-controller.js: Added getIsConfirmationAdvancedDetailsOpen method for state retrieval.
  • shared/constants/metametrics.ts: Updated to include the new event name for advanced details toggling.

These changes ensure that every time the advanced details section is toggled, a corresponding metrics event is fired.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR introduces a metrics event for tracking the toggling of the advanced details section in transaction confirmations.

  • app/scripts/lib/transaction/metrics.ts: Added getIsConfirmationAdvancedDetailsOpen method and updated buildEventFragmentProperties to include transaction_advanced_view.
  • app/scripts/metamask-controller.js: Added getIsConfirmationAdvancedDetailsOpen method to controllerActions.
  • ui/pages/confirmations/components/confirm/header/header-info.tsx: Integrated trackEvent for advanced details toggle.
  • test/e2e/tests/confirmations/transactions/metrics.spec.ts: Added assertions for transaction_advanced_view property in metrics events.
  • app/scripts/lib/transaction/metrics.test.ts: Added mock function getIsConfirmationAdvancedDetailsOpen to mockTransactionMetricsRequest.

10 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR introduces a metrics event for tracking the toggling of the advanced details section in transaction confirmations.

  • app/scripts/lib/transaction/metrics.test.ts: Added transaction_advanced_view to expectedProperties for various transaction scenarios.
  • shared/modules/metametrics.test.ts: Introduced mock function getIsConfirmationAdvancedDetailsOpen in createTransactionMetricsRequest.
  • ui/pages/confirmations/hooks/useTransactionEventFragment.js: Simplified return object by removing fragment property, exposing only updateTransactionEventFragment.

3 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Contributor

@jpuri jpuri left a comment

Choose a reason for hiding this comment

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

👍

Copy link

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR introduces a metrics event for tracking the toggling of the advanced details section in transaction confirmations.

  • app/scripts/lib/transaction/metrics.ts: Added getIsConfirmationAdvancedDetailsOpen method and transaction_advanced_view property to track advanced details toggling.
  • app/scripts/metamask-controller.js: Introduced getIsConfirmationAdvancedDetailsOpen method to controllerActions.
  • test/e2e/tests/confirmations/transactions/metrics.spec.ts: Added assertions for transaction_advanced_view property in metrics events.
  • ui/pages/confirmations/components/confirm/header/header-info.tsx: Added metrics event dispatch for advanced details toggle.
  • app/_locales/en/messages.json: Added onboardingMetametricsPrivacyDescription message key for enhanced onboarding privacy information.

23 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@metamaskbot
Copy link
Collaborator

Builds ready [f093e6d]
Page Load Metrics (246 ± 258 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint74124100147
domContentLoaded115823147
load502073246537258
domInteractive115823147
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 216 Bytes (0.01%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

codecov bot commented Jul 25, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 69.67%. Comparing base (d6b7829) to head (f093e6d).

Files Patch % Lines
app/scripts/metamask-controller.js 0.00% 2 Missing ⚠️
app/scripts/lib/transaction/metrics.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #26083      +/-   ##
===========================================
- Coverage    69.67%   69.67%   -0.00%     
===========================================
  Files         1405     1405              
  Lines        49733    49737       +4     
  Branches     13751    13751              
===========================================
+ Hits         34651    34652       +1     
- Misses       15082    15085       +3     

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

@pedronfigueiredo pedronfigueiredo merged commit bdcea3d into develop Jul 25, 2024
76 checks passed
@pedronfigueiredo pedronfigueiredo deleted the pnf/2736 branch July 25, 2024 09:40
@github-actions github-actions bot locked and limited conversation to collaborators Jul 25, 2024
@metamaskbot metamaskbot added the release-12.3.0 Issue or pull request that will be included in release 12.3.0 label Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.3.0 Issue or pull request that will be included in release 12.3.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants