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: Sort/Import Tokens in Mobile #11618

Merged

Conversation

gambinish
Copy link
Contributor

@gambinish gambinish commented Oct 4, 2024

Description

Implements Token Sorting on mobile. This is the mobile implementation of the same feature on extension: MetaMask/metamask-extension#27184

Note that this currently includes a patch of the PreferencesController. There is a corresponding PR in core to add this to a formal controller release: MetaMask/core#4747

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MMASSETS-357

Manual testing steps

Go to Portfolio Screen
Sort should allow sorting by declining fiat balance by default. Users can then toggle and sort alphabetically or by declining fiat balance.

Import button should function the same as the import token link in footer

Screenshots/Recordings

Screen.Recording.2024-10-03.at.10.37.36.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 28 commits September 26, 2024 17:09
…/metamask-mobile into chore/componetize-tokens-screen
@gambinish gambinish added the No QA Needed Apply this label when your PR does not need any QA effort. label Oct 4, 2024
Copy link
Contributor

github-actions bot commented Oct 4, 2024

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
Copy link
Contributor

I think im still seeing this issue; i remember it was fixed in a previous PR?
Screenshot 2024-10-22 at 09 58 01

Copy link
Member

@andreahaku andreahaku left a comment

Choose a reason for hiding this comment

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

a couple of very minor code optimisations

app/components/UI/Tokens/index.tsx Outdated Show resolved Hide resolved
app/components/UI/Tokens/util/sortAssets.ts Show resolved Hide resolved
@salimtb
Copy link
Contributor

salimtb commented Oct 22, 2024

i just tested the feature , looks great , lgtm ✅

salimtb
salimtb previously approved these changes Oct 22, 2024
@sahar-fehri
Copy link
Contributor

I ve seen this sonar issue https://sonarcloud.io/project/issues?sinceLeakPeriod=true&issueStatuses=OPEN%2CCONFIRMED&pullRequest=11618&id=metamask-mobile&open=AZJ4jkkCJ8jX2B2IGuL8

I think its related to this signature being deprecated
trackEvent( event: IMetaMetricsEvent, properties?: CombinedProperties, saveDataRecording?: boolean, ): void;

I have seen a thread about this suggesting to use MetricsEventBuilder and non-deprecated trackEvent instead:
trackEvent(event: ITrackingEvent, saveDataRecording?: boolean): void;

@gambinish gambinish added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 22, 2024
Copy link
Contributor

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: f376551
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/cfccaf70-e0ea-4a4c-98b8-639a6e2e7a9d

Note

  • This comment will auto-update when build completes
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@gambinish
Copy link
Contributor Author

I think im still seeing this issue; i remember it was fixed in a previous PR?

@sahar-fehri have you pulled the latest? This is what I see:

Screenshot 2024-10-22 at 9 03 46 AM

@gambinish gambinish added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 22, 2024
Copy link
Contributor

github-actions bot commented Oct 22, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: e106631
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/70a5ec82-c3c2-4de4-87c4-e14df4c4abb2

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Copy link

sonarcloud bot commented Oct 22, 2024

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM. Only nit - The term Declining Balance along with the red highlight makes it seem like a destructive action, which is not since sorting is for display only. To keep it neutral and consistent with the other Alphabetically, I'd recommend using the word Balance followed by high to low and remove the red highlight.

@gambinish
Copy link
Contributor Author

LGTM. Only nit - The term Declining Balance along with the red highlight makes it seem like a destructive action, which is not since sorting is for display only. To keep it neutral and consistent with the other Alphabetically, I'd recommend using the word Balance followed by high to low and remove the red highlight.

This is a good callout. I should have cut a new recording since this was addressed:

Screen.Recording.2024-10-22.at.12.02.40.PM.mov

As an aside, I have a follow up PR to update this to a BottomSheet component anyway, so should be pretty short-lived

@gambinish gambinish added this pull request to the merge queue Oct 22, 2024
Merged via the queue into main with commit 0738030 Oct 22, 2024
43 checks passed
@gambinish gambinish deleted the feat/mmassets_357-sort-import-tokens-mobile--token-sort-config branch October 22, 2024 19:29
@github-actions github-actions bot locked and limited conversation to collaborators Oct 22, 2024
@metamaskbot metamaskbot added the release-7.35.0 Issue or pull request that will be included in release 7.35.0 label Oct 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.35.0 Issue or pull request that will be included in release 7.35.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-assets
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants