MetaMask / MetaMask/metamask-extension
[Enhancement] Logic for native value below fiat value needs to match the same logic in the overall account balance
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
### What is this about?
With [this commit](https://github.com/MetaMask/metamask-extension/pull/22601) in v11.10.0 native value was moved from under token name to under fiat value without respecting the logic for overall account balance.
Currently, with Native (ETH) primary currency selected, overall account balance is first displayed in native (ETH) and then fiat (USD), while token balance is reversed, to USD and then ETH below.
Hence, switching primary currency to Fiat (USD) will change overall account balance to USD and ETH below, and token balance to ETH and USD below.
This logic was appropriately implemented in older versions such as 10.29.0.
### Scenario
A.
- GIVEN a user chooses Native as Primary currency
- WHEN the user goes to the main screen
- AND the user checks the overall account balance and the token balance in Tokens list
- THEN the user should see Native option first (ETH) and fiat option below (USD) in both overall account balance and tokens list
B.
- GIVEN a user chooses Fiat as Primary currency
- WHEN the user goes to the main screen
- AND the user checks the overall account balance and the token balance in Tokens list
- THEN the user should see Fiat option first (USD) and Native option below (ETH) in both overall account balance and tokens list
### Design
While on native:

While on fiat:

Logic followed appropriately in version 10.29.0 as example:

### Technical Details
_No response_
### Threat Modeling Framework
_No response_
### Acceptance Criteria
_No response_
### Stakeholder review needed before the work gets merged
- [ ] Engineering (needed in most cases)
- [ ] Design
- [ ] Product
- [ ] QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
- [ ] Security
- [ ] Legal
- [ ] Marketing
- [ ] Management (please specify)
- [ ] Other (please specify)
### References
_No response_
Contributor guide
Research direction
No files, tests, or entry points are named. Start by tracing the main screen's overall account balance and the Tokens list balance display, then compare their currency-ordering logic with the behavior described for native and fiat primary currencies. Done means both displays show the selected primary currency first and the other value below.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100