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: Support standalone confirmation for re-redesigned confirmations #13550

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

OGPoyraz
Copy link
Member

Description

This PR aims to implement support of standalone confirmation for redesigned confirmations.

Related issues

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

Manual testing steps

N/A

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.

@OGPoyraz OGPoyraz requested review from a team as code owners February 17, 2025 08:53
@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Feb 17, 2025
@OGPoyraz OGPoyraz added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Feb 17, 2025
@OGPoyraz
Copy link
Member Author

OGPoyraz commented Feb 17, 2025

Adding skip-sonar-cloud because throwing error is a known, expected and already created a task for upcoming work.

@OGPoyraz OGPoyraz added the No E2E Smoke Needed If the PR does not need E2E smoke test run label Feb 17, 2025
@OGPoyraz OGPoyraz enabled auto-merge February 17, 2025 10:48
/>
),
};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

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.

I have some confusions in the PR, I added few questions.

<ConfirmWrapped styles={styles} />
</View>
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should not StandaloneConfirmation be same as FlatConfirmation ?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, because FlatConfirmation is a confirmation with fullscreen that's all.

One example of FlatConfirmation will be SendFlow, where it will have it's own Stack.Navigator and Stack.Screens.

Copy link
Member Author

@OGPoyraz OGPoyraz Feb 18, 2025

Choose a reason for hiding this comment

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

In summary;

ModalConfirmations => for using Signatures, all other Transaction types etc
FlatConfirmation => A confirmation where it needs to be a full flow, has it's own navigator inside
StandaloneConfirmation => Where we can put a confirmation anywhere in the app (In any Stack)

I think these covering all the use cases we have it in mobile today

Copy link
Contributor

Choose a reason for hiding this comment

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

But I think we need only 2 types of styling, which essentially is point of classification here - modal and full screen.

@amitabh94
Copy link
Contributor

Why are we not running e2e tests on this ? We should run the staking e2e tests atleast so as to avoid any regressions.

I see from staking point of view you are just adding a route but would feel more comfortable approving this if we can run the tests.

@OGPoyraz
Copy link
Member Author

OGPoyraz commented Feb 18, 2025

@amitabh94 if you are asking the label no smoke e2e - we could run (I believe this should be default, not tied to any label as in extension), but as we all know this has no affect in the current flows it felt a bit unnecessary for now. (considering we've been told several times that running e2e tests are spending lot of credits on Bitrise) Once we toggled on / start using new flow - as expected there will be no PR with that label. But since this is asked I will do that now.

Update: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/f9e83941-fe03-430a-a9a6-4f328860da44?tab=workflows
It works properly for staking as expected.

If you are asking of why redesigned staking deposit confirmation not e2e tested, this has some reasons.

  • Not sure if you can see the board but this is already in the upcoming tasks to handle e2e (https://github.com/orgs/MetaMask/projects/78?pane=issue&itemId=95989587)
  • We are trying to keep iterations with small PRs so easier to review
  • Staking deposit is the first re-designed transaction confirmation so first PRs in this effort is settling lot of infrastructure required by our team

@OGPoyraz OGPoyraz added Run Smoke E2E Triggers smoke e2e on Bitrise and removed No E2E Smoke Needed If the PR does not need E2E smoke test run labels Feb 18, 2025
Copy link
Contributor

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: 0768be2
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/30ab5a89-9d49-462d-b64d-3019f895a8c8

Note

  • This comment will auto-update when build completes
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@OGPoyraz OGPoyraz added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 18, 2025
Copy link
Contributor

github-actions bot commented Feb 18, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: a00e484
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/f9e83941-fe03-430a-a9a6-4f328860da44

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@OGPoyraz OGPoyraz added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 19, 2025
Copy link
Contributor

github-actions bot commented Feb 19, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 51084ca
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/72fd88dc-c4f9-4ec5-b81a-55f42a8a68ba

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@@ -60,9 +61,14 @@ const Title = () => {
const { approvalRequest } = useApprovalRequest();
const signatureRequest = useSignatureRequest();
const { styles } = useStyles(styleSheet, {});
const { isStandaloneConfirmation } = useStandaloneConfirmation();
Copy link
Contributor

Choose a reason for hiding this comment

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

We should be able to use useFlatConfirmation here.

expect(mockNavigate).toHaveBeenCalledTimes(1);
expect(mockNavigate).toHaveBeenCalledWith(Routes.CONFIRM_FLAT_PAGE);
});
// TODO: Add unit test for once we have any existing flat confirmation
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not remove the test case till code is there.

@jpuri
Copy link
Contributor

jpuri commented Feb 20, 2025

Hey @OGPoyraz : let's try to enable sonar again, the issue might already be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Run Smoke E2E Triggers smoke e2e on Bitrise skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-confirmations Push issues to confirmations team
Projects
Status: Needs dev review
Development

Successfully merging this pull request may close these issues.

5 participants