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: PortfolioView #28593

Merged
merged 417 commits into from
Nov 21, 2024
Merged

feat: PortfolioView #28593

merged 417 commits into from
Nov 21, 2024

Conversation

gambinish
Copy link
Contributor

@gambinish gambinish commented Nov 21, 2024

Description

This consolidates the changes from a series of 3 Multichain Asset List PRs that built on each other:

  1. Product code (feature branch): feat: Multichain AssetList #28386
  2. Unit tests: fix: Multichain AssetList unit tests #28451
  3. e2e tests: fix: Multichain AssetList e2e tests #28524

We created separate branches for rapid iteration and isolated testing. The code is now cleaner and stable enough for review and merge into develop, gated by the PORTFOLIO_VIEW feature flag.

We will introduce another PR to remove this feature flag when we are ready to ship it.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/orgs/MetaMask/projects/85/views/35?pane=issue&itemId=82217837

Manual testing steps

PORTFOLIO_VIEW=1 yarn webpack --watch

  1. View tokens across all networks in one unified list.
  2. Filter tokens by selected network
  3. Crosschain navigation:
    • Token detail pages update to display data from the appropriate network.
    • Send/Swap actions automatically adjust the selected network for user convenience.
    • Ensure that network switch is functional, and sends/swaps happen on correct chain.

Known caveats:

  1. POL native token market data not populating. Will be addressed here: fix: market data for native tokens with non zero addresses #28584 and fix: price fetching for native tokens with non zero addresses core#4952
  2. Native token swapping on different network than selected network swaps incorrect token: Fix #28534 - Show correct swap value from asset details #28587
  3. Multichain token detection experimental draft: feat: multichain token detection #28380

Screenshots/Recordings

Screen.Recording.2024-11-20.at.11.19.12.AM.mov
Screen.Recording.2024-11-20.at.10.20.44.PM.mov

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.

gambinish and others added 30 commits November 12, 2024 18:21
…-balances' of github.com:MetaMask/metamask-extension into e2e-tests-token-list-aggregated-balance
…bject Model (#28383)

## **Description**

- Migrate e2e tests `test/e2e/tests/tokens/nft/auto-detect-nft.spec.js`
to TS and Page Object Model, to reduce flakiness.
- Migrate e2e tests `test/e2e/tests/tokens/nft/import-nft.spec.js` to TS
and Page Object Model, to reduce flakiness.
- Create page classe functions for nft
- Deprecate/remove old functions in `helper.js`


[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27155?quickstart=1)

## **Related issues**

Fixes: #28388

## **Manual testing steps**
Check code readability, make sure tests pass.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
There is a race condition in our testing setup, which causes that the
expected fixtures state, not being there when we start the test. This
has been surfaced in [this
branch](#28277),
where the account tracker multi polling is being added.
The problem is that if we don't have the AccountTracker in state when
the `resetState` function is called (at the beginning of wallet loading)
the balance will remain loading until we refresh the wallet.

Edit: performing the load state early in the test setup fixes the issue.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28421?quickstart=1)

## **Related issues**

Fixes: MetaMask/MetaMask-planning#3627

## **Manual testing steps**

1. Check all tests continue to pass
2. Check this changes fix this branch ENS test
https://github.com/MetaMask/metamask-extension/pull/28402/files#diff-1acb7898d60977530c97169551d22dbe477a4e3aeb74f1f14bf2eea0b4d75d35
. Alternatively, see videos below with before and after behaviours

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**




https://github.com/user-attachments/assets/8f50ec04-cf96-478e-9c3c-dce54254a628



### **After**


https://github.com/user-attachments/assets/0f109b1a-9289-48d9-b337-d51890c9d448




## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
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.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

This PR reintroduces the happy path send flow tests for BTC

## **Related issues**

Fixes: https://github.com/MetaMask/accounts-planning/issues/668

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
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.

---------

Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
…#28403)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Previously, some gas fee parameters defaulted to dApp suggested fee
values. This was problematic, because these values are always defined,
even when the user changed to a custom priority.

To fix the issue, we now only show the fees contained in txParams,
trusting they match the user selected priority level in the gas fees
modal.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28403?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

See screen recording below.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->



https://github.com/user-attachments/assets/3874d3b6-ad96-4fd9-9f40-361b38a0253b



### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
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.
…-balances' into e2e-tests-token-list-aggregated-balance
…-balances' into e2e-tests-token-list-aggregated-balance
…-balances' into e2e-tests-token-list-aggregated-balance
@metamaskbot
Copy link
Collaborator

Builds ready [1a8cb68]
Page Load Metrics (1843 ± 101 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint28323081755392188
domContentLoaded15292226180520297
load154623111843210101
domInteractive139934189
backgroundConnect999432512
firstReactRender53135992311
getState55720188
initialActions01000
loadScripts10961722131718086
setupStore66113147
uiStartup173425662047228109
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 8.02 KiB (0.10%)
  • common: 1.85 KiB (0.02%)

@gambinish gambinish marked this pull request as ready for review November 21, 2024 06:56
@gambinish gambinish requested review from a team as code owners November 21, 2024 06:56
@salimtb
Copy link
Contributor

salimtb commented Nov 21, 2024

hey @gambinish
1 bug found , token detail page redirect to the wrong block explorer ( see the video below )

portfolio.mov

@metamaskbot
Copy link
Collaborator

Builds ready [a8de3b2]
Page Load Metrics (1980 ± 122 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint29122511774485233
domContentLoaded162129221944259124
load167029491980254122
domInteractive176735126
backgroundConnect1198432813
firstReactRender613061598038
getState587272814
initialActions01000
loadScripts11622192142220599
setupStore66111126
uiStartup183237392321407195
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 8.02 KiB (0.10%)
  • common: 1.85 KiB (0.02%)

salimtb
salimtb previously approved these changes Nov 21, 2024
@salimtb
Copy link
Contributor

salimtb commented Nov 21, 2024

LGTM ✅

@metamaskbot
Copy link
Collaborator

Builds ready [bc6c4df]
Page Load Metrics (2006 ± 57 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint17922332200312158
domContentLoaded17772207195910852
load17832288200611957
domInteractive17219545325
backgroundConnect9137473517
firstReactRender671991212814
getState566212010
initialActions01000
loadScripts1269162614379948
setupStore66212126
uiStartup20032476224212962
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 8.22 KiB (0.11%)
  • common: 1.85 KiB (0.02%)

@gambinish gambinish added this pull request to the merge queue Nov 21, 2024
Merged via the queue into develop with commit a04b34b Nov 21, 2024
75 checks passed
@gambinish gambinish deleted the feat/portfolio-view branch November 21, 2024 18:14
@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2024
@metamaskbot metamaskbot added the release-12.9.0 Issue or pull request that will be included in release 12.9.0 label Nov 21, 2024
@@ -352,13 +375,29 @@ const CoinButtons = ({
}
///: END:ONLY_INCLUDE_IF
default: {
trackEvent(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is wrong. We already have this event above. Probably a bad conflict resolution? 😅

We are probably sending this event twice now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.9.0 Issue or pull request that will be included in release 12.9.0 team-assets team-wallet-ux
Projects
None yet
Development

Successfully merging this pull request may close these issues.