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(4057): replace asset avatars with network avatars #13910

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

vinnyhoward
Copy link
Contributor

@vinnyhoward vinnyhoward commented Mar 7, 2025

Description

This PR changes the account list item to display network avatars. This change supports a more network-centric approach to account selection, which is more valuable in a multichain context. Here is the Figma

Implementation

  • The account list now shows the top 4 networks by total value for each account
  • Networks are sorted by their total fiat balance
  • Only networks with a balance greater than zero are displayed
  • The implementation uses the existing useMultiAccountChainBalances hook to get balance data across chains for all accounts

Related issues

Feature: #4057

Manual testing steps

  1. Go to this page wallet home screen
  2. Click on account picker at the top
  3. Observe that account selector now have network icons sorted by aggregated network balance

Screenshots/Recordings

Recording

Before After
before after

Screenshot

Before After
before after

Before

NA

After

NA

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.

…n list. added new hook to fetch aggregated chain data for all accounts
Copy link
Contributor

github-actions bot commented Mar 7, 2025

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.

@vinnyhoward vinnyhoward added Run Smoke E2E Triggers smoke e2e on Bitrise team-design-system All issues relating to design system in Mobile labels Mar 11, 2025
Copy link
Contributor

https://bitrise.io/ Bitrise

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

Commit hash: 3e47871
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/0fd910bc-3219-456b-bdd8-231a4dbe78f1

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

…4057-replace-asset-avatars-with-network-avatars
@vinnyhoward vinnyhoward added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Mar 11, 2025
Copy link
Contributor

github-actions bot commented Mar 11, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 675ab11
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/9c920c5d-8d96-44f2-b6f1-5e82aee097e8

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

@@ -27,51 +27,55 @@ const AvatarGroup = ({
maxStackedAvatars = DEFAULT_AVATARGROUP_MAXSTACKEDAVATARS,
includesBorder = true,
spaceBetweenAvatars,
renderOverflowCounter = true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is introduced to optionally avoid rendering the overflow counter to match the Figma

with prop without prop
with without

expect(
within(businessAccountItem).getByText(regex.usd(3200)),
).toBeDefined();

expect(within(businessAccountItem).queryByText('••••••')).toBeNull();
});
});
it('Text is hidden when privacy mode is on', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test is removed because we are no longer showing the selected network token balance, instead it shows the network avatar icons. See the before and after screenshots

const fiatBalanceStrSplit = fiatBalance.split('\n');
const fiatBalanceAmount = fiatBalanceStrSplit[0] || '';
const tokenTicker = fiatBalanceStrSplit[1] || '';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No longer shows the token balance based on selected network. See before and after screenshots

@@ -73,7 +78,7 @@ const useAccounts = ({
);
const formattedTokensWithBalancesPerChain = useGetFormattedTokensPerChain(
internalAccounts,
!isTokenNetworkFilterEqualCurrentNetwork,
shouldAggregateAcrossChains || !isTokenNetworkFilterEqualCurrentNetwork,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This arg is added to allow the opting out of the popular network filter. Going forward we should always show the aggregated balance of each account in the app/components/UI/AccountSelectorList/AccountSelectorList.tsx. The network filter should not affect the AccountSelectorList component and should only affect the token list

@vinnyhoward vinnyhoward added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Mar 12, 2025
Copy link
Contributor

github-actions bot commented Mar 12, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 01a4d95
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/29440b90-9e84-49cc-bb83-d62d6781bf89

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

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@vinnyhoward vinnyhoward added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Mar 12, 2025
@vinnyhoward vinnyhoward added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Mar 12, 2025
Copy link
Contributor

github-actions bot commented Mar 12, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: f741507
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c7ea3a8d-b5ca-433c-80e4-5cd5c9ffeb01

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

Comment on lines +37 to +42
avatarGroup: {
borderRadius: 4,
borderWidth: 2,
height: 16,
width: 16,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Will these styles be applied to all AvatarGroup styles throughout the app?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Theres only one other instance of it being used which is network permission summary when interacting with dapps. I believe this change is fine for that scenario but I'll double check with Hester

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Run Smoke E2E Triggers smoke e2e on Bitrise team-design-system All issues relating to design system in Mobile team-wallet-ux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants