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: fetch nfts on components #24547

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from

Conversation

sahar-fehri
Copy link
Contributor

@sahar-fehri sahar-fehri commented May 15, 2024

Description

This PR aims to:
1- Enable nft autodetection by default
2- Show a modal only once if the user disables the nft autodetection
3- Make NFT detection tied to the components that use the NFTs instead of the 3mins polling strategy.

This PR goes with this core PR: MetaMask/core#4281

Open in GitHub Codespaces

Related issues

Related to: MetaMask/core#4281

Manual testing steps

Test the nft auto detection modal

  1. Do a fresh import of the wallet
  2. Go to settings => Security and privacy and make sure the toggle enable NFT auto detection is ON
  3. Turn the nft auto detection toggle OFF
  4. Go back to home page and you should see a new modal
  5. Clicking on not right now button should close the modal and closing on allow button should enable the nft auto detection modal.

Test the removal of the polling in the backgound:

We have the toggle enabled by default now but this should not trigger calls to NFT-API every 3 mins anymore.
Instead the calls should be triggered only when you click on the NFT tab.

  1. Open the background console and click on Networks tab.
  2. Filter by /tokens (so you are able to see only the calls that will fetch user nfts)
  3. Notice that as long as you did not click on the NFT tab, you should not be able to see any calls made in the backround.
    (where the old logic should keep detecting your NFTs every 3 mins as long as you have MM open)
  4. Click on the NFT tab and you should be able to see the requests in the background to fetch your nfts.
  5. You can also click on Send, and click on asset picker and click on NFT tab, you should be able to see your NFTs there too.
  6. Calls should be made only when you click on the NFT tab.

Screenshots/Recordings

Before

Screen.Recording.2024-06-06.at.21.57.21.mov

After

after.mov

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

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.

@sahar-fehri sahar-fehri requested a review from a team as a code owner May 15, 2024 18:41
@sahar-fehri sahar-fehri marked this pull request as draft May 15, 2024 18:41
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.

@sahar-fehri sahar-fehri force-pushed the feat/refactor-nft-experience branch 2 times, most recently from 88a439f to 5ca4a88 Compare May 30, 2024 14:20
@sahar-fehri sahar-fehri added needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. team-assets labels Jun 6, 2024
@sahar-fehri sahar-fehri marked this pull request as ready for review June 6, 2024 20:13
@metamaskbot
Copy link
Collaborator

Builds ready [0383c5a]
Page Load Metrics (159 ± 228 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6313084189
domContentLoaded9321373
load412228159475228
domInteractive9321373
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 407 Bytes (0.01%)
  • ui: 8.92 KiB (0.13%)
  • common: 3 KiB (0.05%)

@metamaskbot
Copy link
Collaborator

Builds ready [0383c5a]
Page Load Metrics (159 ± 228 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6313084189
domContentLoaded9321373
load412228159475228
domInteractive9321373
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 407 Bytes (0.01%)
  • ui: 8.92 KiB (0.13%)
  • common: 3 KiB (0.05%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants