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: Adding context to get current confirmation PR-6 #26685

Merged
merged 32 commits into from
Sep 5, 2024

Conversation

jpuri
Copy link
Contributor

@jpuri jpuri commented Aug 27, 2024

Description

Using context to get currently selected confirmation in re-designed confirmation pages. This is done to switch to using react context transient UI state in re-designed confirmation pages.

Related issues

Ref: #26414

Manual testing steps

NA

Screenshots/Recordings

NA

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.

@jpuri jpuri added the team-confirmations Push issues to confirmations team label Aug 27, 2024
@jpuri jpuri requested review from a team as code owners August 27, 2024 14:16
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

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.15%. Comparing base (9f07ef5) to head (2910775).
Report is 8 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #26685      +/-   ##
===========================================
- Coverage    70.15%   70.15%   -0.00%     
===========================================
  Files         1425     1425              
  Lines        49647    49653       +6     
  Branches     13890    13893       +3     
===========================================
+ Hits         34828    34832       +4     
- Misses       14819    14821       +2     

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

@metamaskbot
Copy link
Collaborator

Builds ready [231ab8e]
Page Load Metrics (72 ± 7 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint7414397189
domContentLoaded5012067157
load5612072147
domInteractive12412673
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0.00%)
  • ui: 2.96 KiB (0.04%)
  • common: -461 Bytes (-0.01%)

matthewwalsh0
matthewwalsh0 previously approved these changes Aug 30, 2024
const processAction = useConfirmationAlertActions();
setConfirmationAlerts();

return (
<AlertMetricsProvider>
<AlertMetricsProvider
metrics={{
Copy link
Member

Choose a reason for hiding this comment

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

Great spot, there could be alternate systems in future using the alert metrics that won't want to add metrics to transactions and signatures.

@@ -1,17 +1,26 @@
import React, { createContext, useContext, ReactNode, useMemo } from 'react';
import { useConfirmationAlertMetrics } from '../../../../pages/confirmations/hooks/useConfirmationAlertMetrics';

const AlertMetricsContext = createContext<{
trackAlertActionClicked: (alertKey: string) => void;
Copy link
Member

Choose a reason for hiding this comment

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

Minor, could we define a type for the track methods to avoid this duplication, such as AlertMetricsCallbacks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 👍

Base automatically changed from confirmation_context_5 to develop September 4, 2024 10:16
@jpuri jpuri dismissed matthewwalsh0’s stale review September 4, 2024 10:16

The base branch was changed.

@jpuri jpuri requested review from a team as code owners September 4, 2024 10:16
Copy link

sonarqubecloud bot commented Sep 4, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [2910775]
Page Load Metrics (1837 ± 120 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint25726931617623299
domContentLoaded156625941821244117
load157426431837251120
domInteractive126436146
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: -59 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@jpuri jpuri requested a review from matthewwalsh0 September 4, 2024 16:01
@jpuri jpuri merged commit 46e05e6 into develop Sep 5, 2024
78 checks passed
@jpuri jpuri deleted the confirmation_context_6 branch September 5, 2024 09:34
@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2024
@metamaskbot metamaskbot added the release-12.6.0 Issue or pull request that will be included in release 12.6.0 label Sep 5, 2024
@gauthierpetetin gauthierpetetin added release-12.5.0 Issue or pull request that will be included in release 12.5.0 and removed release-12.6.0 Issue or pull request that will be included in release 12.6.0 labels Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.5.0 Issue or pull request that will be included in release 12.5.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants