Skip to content

fix: token name sort #31302

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

Merged
merged 5 commits into from
Mar 28, 2025
Merged

fix: token name sort #31302

merged 5 commits into from
Mar 28, 2025

Conversation

gambinish
Copy link
Contributor

@gambinish gambinish commented Mar 25, 2025

Description

We recently decided that we wanted to sort by token name, rather than symbol. The problem is that native tokens for several chains display Ethereum when in actuality the name we get from the token API is something like Linea. This would cause native tokens on some EVM chains to be miscategorized in sort.

This PR overrides the token name for this scenario. It also consolidates the name and title fields to support both EVM and nonEVM chains.

Open in GitHub Codespaces

Related issues

Fixes: #31235

Manual testing steps

  1. Please test on both flask and non flask builds.
  2. EVM and Solana tokens should now be sorted by their display name (not symbol)
  3. Check on both firefox and chrome

Screenshots/Recordings

Before

Before scenarios in bug ticket linked.

After

Chrome:

Screenshot 2025-03-25 at 12 58 45 PM Screenshot 2025-03-25 at 1 01 00 PM

Firefox:

Screenshot 2025-03-25 at 1 07 11 PM

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.

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.

@gambinish gambinish changed the title fix: init name sort fix fix: token name sort Mar 25, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [7595325]
Page Load Metrics (2939 ± 1323 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint32214152269126871290
domContentLoaded154213226252724771189
load160414792293927551323
domInteractive25439638842
backgroundConnect641400404293141
firstReactRender202851046431
getState4679121317684
initialActions00000
loadScripts114811812189322831096
setupStore1050212111857
uiStartup190218542498734641664
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: -112 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@gambinish gambinish marked this pull request as ready for review March 25, 2025 22:15
@Prithpal-Sooriya
Copy link
Contributor

Tested Firefox, Chrome; Flask and Main.
Satisfied with this fix for EVM. I wasn't able to test solana.

@Prithpal-Sooriya
Copy link
Contributor

Tested solana accounts, happy with this change

@gambinish gambinish added this pull request to the merge queue Mar 28, 2025
Merged via the queue into main with commit c1c8fd6 Mar 28, 2025
144 checks passed
@gambinish gambinish deleted the fix/alpha-token-sort-name branch March 28, 2025 22:29
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2025
@metamaskbot metamaskbot added the release-12.17.0 Issue or pull request that will be included in release 12.17.0 label Mar 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.17.0 Issue or pull request that will be included in release 12.17.0 team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Firefox Sort Alphabetically does not work as expected and is not aligned with Chrome
4 participants