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: Added specified error toasts, and improved button states #182

Merged
merged 7 commits into from
Feb 20, 2025

Conversation

Andrew718PLTS
Copy link
Contributor

@Andrew718PLTS Andrew718PLTS commented Jan 13, 2025

Description

Other changes

Added truncated amount and tooltip when the amount is more than 8 digits.
image

Tested

  1. Put >= 22 digits into swap out amount and click the continue button (e.g., 7478773923223123234925).
  2. Put >= 22 digits into swap in amount and click the continue button.
  3. Select any pair with no valid median or where trading is suspended and put some amount (1) (frequently its USDC, USDT, axlUSDC).

Related issues

Checklist before requesting a review

  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • The PR title follows the conventions
  • I have run the regression tests

Copy link

vercel bot commented Jan 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mento-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 20, 2025 1:59pm

@Andrew718PLTS Andrew718PLTS changed the title Feat/ux button and error toasts Feat: Added specified error toasts, and improved button states Jan 13, 2025
@Andrew718PLTS Andrew718PLTS force-pushed the feat/ux-button-and-error-toasts branch from 0cb5dfa to d7ecb94 Compare January 13, 2025 15:20
@Andrew718PLTS Andrew718PLTS force-pushed the feat/ux-button-and-error-toasts branch from d7ecb94 to 14fcbc1 Compare January 14, 2025 10:12
@Andrew718PLTS Andrew718PLTS marked this pull request as ready for review January 14, 2025 10:39
Copy link
Contributor

@RyRy79261 RyRy79261 left a comment

Choose a reason for hiding this comment

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

Followed testing steps, can confirm toasts appear as expected

@nvtaveras
Copy link
Contributor

Spoke to @Andrew718PLTS offline, there's a few weird ux behaviours which we'll fix:

  1. After entering a swap in amount, the button becomes disabled until the quote is returned. It should become enabled again as soon as the quote is fetched (currently it takes a bit longer even though the quote is already there).
  2. While testing the same thing as above, sometimes the button switches to red (error) before finally switching to the continue state
  3. We show an error button whenever trading is disabled (i.e. no valid median, circuit breaker, etc) together with a toast error message. Should it just be the disabled gray continue button instead, since the error is already shown in the toast?

@Andrew718PLTS
Copy link
Contributor Author

@nvtaveras Issues are fixed and tested on test deployment.

Copy link
Contributor

@chapati23 chapati23 left a comment

Choose a reason for hiding this comment

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

Found another issue. There is a race condition if you enter your swapIn amount too early.

Reproduce:

  1. Do a full page reload on the deployed preview app
  2. Paste a number into the swapIn field as quickly as you can
  3. See that the submit button turns red and says "Balance still loading"
  4. This message remains even when the balance has been loaded
Screenshot 2025-02-10 at 12 29 59

@Andrew718PLTS
Copy link
Contributor Author

Andrew718PLTS commented Feb 10, 2025

@chapati23 Thank you, it's a known issue that will be fixed in the scope of this ticket.

@Andrew718PLTS
Copy link
Contributor Author

@chapati23 Fixed here in the third commit.

Copy link
Contributor

@chapati23 chapati23 left a comment

Choose a reason for hiding this comment

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

as just discussed on our call, there's another flaky issue that I found

to reproduce you have to be fast :)

  1. Copy a number that's higher than your current CELO balance into your clipboard
  2. Navigate to the swap page
  3. Position your cursor above the submit button
  4. Do a full page reload of the swap page and paste your high number from your clipboard into the from input as fast as you can
  5. Now hammer the submit button as quickly as you can
  6. If you're fast enough, you are able to bypass all warnings and trigger a swap TX for an amount that's higher than what's actually in your wallet

@bayological bayological removed their request for review February 14, 2025 10:06
@Andrew718PLTS Andrew718PLTS changed the base branch from dev to main February 20, 2025 12:15
Copy link
Contributor

@chapati23 chapati23 left a comment

Choose a reason for hiding this comment

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

looks good, tried a bunch of scenarios on the preview deployment and couldn't reproduce any of the issues

src/features/swap/SwapConfirm.tsx Outdated Show resolved Hide resolved
src/features/swap/SwapConfirm.tsx Outdated Show resolved Hide resolved
src/features/swap/SwapConfirm.tsx Outdated Show resolved Hide resolved
@Andrew718PLTS
Copy link
Contributor Author

@Andrew718PLTS Andrew718PLTS merged commit a06f4c0 into main Feb 20, 2025
7 checks passed
@Andrew718PLTS Andrew718PLTS deleted the feat/ux-button-and-error-toasts branch February 20, 2025 14:16
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.

[Mento-Web] Improve the UX oracle issues
5 participants