Skip to content

fix: asset picker touch ups#23264

Merged
bergeron merged 12 commits intodevelopfrom
brian/asset-picker-qa
Mar 7, 2024
Merged

fix: asset picker touch ups#23264
bergeron merged 12 commits intodevelopfrom
brian/asset-picker-qa

Conversation

@bergeron
Copy link
Copy Markdown
Contributor

@bergeron bergeron commented Mar 1, 2024

Description

Fixes some things with the asset picker.

  1. Too tall.

Vertical padding was increased in 4a930f9 to support the NFT case, but this made native + erc20 too tall.

before:
Screenshot 2024-02-29 at 11 39 32 PM

after:
Screenshot 2024-02-29 at 11 44 57 PM

original figma design:
Screenshot 2024-02-29 at 11 32 53 PM

  1. Token id not always right aligned during NFT case
  2. Images missing from pill in NFT and some ERC20 cases
  3. ERC721 balance had regressed - showing blank instead of # of NFTs you own.

before:
Screenshot 2024-03-05 at 12 14 20 PM

after:
Screenshot 2024-02-29 at 11 53 51 PM

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  • Send an NFT in the new asset flow, verify the pill has the NFT's image

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@bergeron bergeron requested a review from a team as a code owner March 1, 2024 07:56
@bergeron bergeron requested review from darkwing and salimtb March 1, 2024 07:56
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 1, 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.

@bergeron bergeron changed the title Asset input touch ups Asset picker touch ups Mar 1, 2024
@bergeron bergeron requested a review from sahar-fehri March 1, 2024 08:03
salimtb
salimtb previously approved these changes Mar 1, 2024
@bergeron bergeron added the needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. label Mar 1, 2024
@bergeron bergeron changed the title Asset picker touch ups fix: asset picker touch ups Mar 4, 2024
@bergeron bergeron mentioned this pull request Mar 4, 2024
13 tasks
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [9460f33]
Page Load Metrics (936 ± 409 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint702581354421
domContentLoaded990382412
load661992936853409
domInteractive990382412
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 396 Bytes (0.01%)
  • common: 0 Bytes (0.00%)

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.62%. Comparing base (9dcd9f5) to head (48b2cb4).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #23264      +/-   ##
===========================================
+ Coverage    68.61%   68.62%   +0.01%     
===========================================
  Files         1101     1101              
  Lines        43206    43214       +8     
  Branches     11568    11573       +5     
===========================================
+ Hits         29645    29654       +9     
+ Misses       13561    13560       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [48b2cb4]
Page Load Metrics (1428 ± 278 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint751871353215
domContentLoaded1070392110
load8821161428580278
domInteractive1070392110
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 534 Bytes (0.01%)
  • common: 0 Bytes (0.00%)

Comment on lines +39 to +49
if (asset.type === AssetType.native) {
image = nativeCurrencyImage;
} else if (asset.type === AssetType.token) {
image =
asset.details?.image ??
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: type 'string' can't be used to index type '{}'
tokenList?.[asset.details?.address?.toLowerCase()]?.iconUrl;
} else if (asset.type === AssetType.NFT) {
image = getAssetImageURL(asset.details?.image, ipfsGateway);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: Can we use switch to make it easier to read and modify / add more conditions in the future ?

@bergeron bergeron merged commit dec5421 into develop Mar 7, 2024
@bergeron bergeron deleted the brian/asset-picker-qa branch March 7, 2024 18:08
@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2024
@metamaskbot metamaskbot added the release-11.14.0 Issue or pull request that will be included in release 11.14.0 label Mar 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. release-11.14.0 Issue or pull request that will be included in release 11.14.0 team-assets

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants