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: display loader on re-designed confirmation page while blockaid validation is in progress #25477

Merged
merged 5 commits into from
Jun 27, 2024

Conversation

jpuri
Copy link
Contributor

@jpuri jpuri commented Jun 21, 2024

Description

display loader on re-designed confirmation page while blockaid validation is in progress

Related issues

Fixes: #25323

Manual testing steps

  1. Go to test DAPP
  2. Submit signature request
  3. You may momentarily see loader on confirmation page

Screenshots/Recordings

Screenshot 2024-06-22 at 12 13 15 AM

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 confirmation-redesign team-confirmations Push issues to confirmations team labels Jun 21, 2024
@jpuri jpuri requested a review from a team as a code owner June 21, 2024 18:48
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.

@metamaskbot
Copy link
Collaborator

Builds ready [f24c8be]
Page Load Metrics (51 ± 3 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint70958273
domContentLoaded9131111
load43705173
domInteractive9131111
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 3.24 KiB (0.05%)
  • common: 0 Bytes (0.00%)

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.66%. Comparing base (1cc54f6) to head (36e1a6c).
Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25477      +/-   ##
===========================================
+ Coverage    69.65%   69.66%   +0.01%     
===========================================
  Files         1347     1348       +1     
  Lines        47803    47816      +13     
  Branches     13184    13188       +4     
===========================================
+ Hits         33296    33309      +13     
  Misses       14507    14507              

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

matthewwalsh0
matthewwalsh0 previously approved these changes Jun 25, 2024

const signatureSecurityAlertResponse = useSelector(
(state: SignatureSecurityAlertResponsesState) =>
state.metamask.signatureSecurityAlertResponses?.[
Copy link
Member

Choose a reason for hiding this comment

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

Since we also do this raw selector inside useBlockaidAlerts, is it worth a selector function for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR is updated to address this.

if (
signatureSecurityAlertResponse?.result_type === BlockaidResultType.Loading
) {
return (
Copy link
Member

Choose a reason for hiding this comment

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

Minor, but we could also early return null to avoid nesting the core logic of the component.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR is updated to address this.

expect(container).toMatchSnapshot();
});

it('returns null if blockaid validaiton is not in progress', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Minor, but would we benefit from a test to ensure it renders correctly with no Blockaid response at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR is updated to address this.

@metamaskbot
Copy link
Collaborator

Builds ready [36e1a6c]
Page Load Metrics (52 ± 4 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6610882115
domContentLoaded9201131
load39675284
domInteractive9201131
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 2.44 KiB (0.04%)
  • common: 1020 Bytes (0.02%)

@jpuri jpuri requested a review from matthewwalsh0 June 26, 2024 05:31
@@ -43,3 +48,23 @@ export const confirmSelector = (state: ConfirmMetamaskState) => state.confirm;

export const currentConfirmationSelector = (state: ConfirmMetamaskState) =>
state.confirm.currentConfirmation;

export const currentSignatureRequestSecurityResponseSelector = (
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't need addressing now but we have lots of competing standards for selector names such as XSelector, getX, or selectX.

My understanding was the latter is best as it's the most explicit, makes auto-complete easy, and is recommended by Redux.

@jpuri jpuri merged commit e0fb582 into develop Jun 27, 2024
70 checks passed
@jpuri jpuri deleted the blockaid_loading_indicator branch June 27, 2024 08:39
@github-actions github-actions bot locked and limited conversation to collaborators Jun 27, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
confirmation-redesign release-12.1.0 Issue or pull request that will be included in release 12.1.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-introduce spinner for blockaid warnings on redesigned confirmations
4 participants