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

Token table ordering #5189

Merged
merged 23 commits into from
Jul 16, 2024
Merged

Token table ordering #5189

merged 23 commits into from
Jul 16, 2024

Conversation

mstrasinskis
Copy link
Contributor

@mstrasinskis mstrasinskis commented Jul 12, 2024

Motivation

Currently, tokens table has a fixed list of tokens considered important on top ordered (ICP, ckBTC, ckETH, ckUSDC) followed by SNS tokens ordered by creation date. This ordering seems random for new people entering the ecosystem, and only takes into account user balances after a user takes action.

Suggested order:

  1. ICP is always on top regardless of user balance.
  2. Tokens where a user has a higher than 0 balance:
    a. First important token list in predefined order - ckBTC, ckETH, ckUSDC
    b. Sns tokens ordered alphabetically
  3. Tokens where a user has 0 balance (same sub-groups as for tokens with balance):
    a. First important token list in predefined order - ckBTC, ckETH, ckUSDC
    b. Sns tokens ordered alphabetically

Changes

  • New compareTokensForTokensTable merged comparator.
  • Apply sorting to sign-in and sign-out token table.

Tests

  • Old tests were updated to the new order.
  • Tests for new comparators.
  • Test that the Token page display tokens in the expected order (ckUSDC token was added to the mock data).
  • Updated the e2e test because the order changed after getting SNS tokens.

Todos

  • Add entry to changelog (if necessary).

@mstrasinskis mstrasinskis marked this pull request as ready for review July 15, 2024 13:58
@mstrasinskis mstrasinskis requested a review from a team as a code owner July 15, 2024 13:58
@mstrasinskis mstrasinskis requested a review from dskloetd July 15, 2024 14:06
@mstrasinskis mstrasinskis requested a review from dskloetd July 16, 2024 08:14
Copy link
Contributor

@dskloetd dskloetd left a comment

Choose a reason for hiding this comment

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

Thanks!

frontend/src/tests/e2e/sns-governance.spec.ts Show resolved Hide resolved
@mstrasinskis mstrasinskis added this pull request to the merge queue Jul 16, 2024
Merged via the queue into main with commit 0994d30 Jul 16, 2024
40 checks passed
@mstrasinskis mstrasinskis deleted the token-table-ordering branch July 16, 2024 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants