MetaMask / MetaMask/metamask-extension

[Enhancement] Logic for native value below fiat value needs to match the same logic in the overall account balance

Open
#23,187 0 comments 0 reactions 0 assignees View on GitHub
external-contributor release-11.12.0 team-core-extension-ux ux-enhancement
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:
![image](https://github.com/MetaMask/metamask-extension/assets/120041701/35114260-5313-45d6-b69c-3e0a5d9b0ab2)

While on fiat:
![image](https://github.com/MetaMask/metamask-extension/assets/120041701/297ce335-9cf9-4844-a30f-a83af1e74778)

Logic followed appropriately in version 10.29.0 as example:
![image](https://github.com/MetaMask/metamask-extension/assets/120041701/ae147010-1c96-4ab0-9e39-2ccc08179ba2)

### 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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.