Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Improve claim behalf error #2334

Merged
merged 3 commits into from
Jan 27, 2022
Merged

Improve claim behalf error #2334

merged 3 commits into from
Jan 27, 2022

Conversation

anxolin
Copy link
Contributor

@anxolin anxolin commented Jan 27, 2022

Summary

This PR tries to improve this case:

image

The problem here is that is not clear enough why there's an error. In principle, we should assume users are educated about the investment and they have read the blog post where we mention that investing for others requires investing 100% of the oportunity.

the problem above in my opinion, is that we are not hinting this is the case.

The proposed solution, is to do these small actions:
image

Additionally, for the case of investing with zero balance, i thought the messages were too long, so i did a specific message for it:
image

To Test

  1. Test to claim on behalf of someone having 0 balance
  2. Test to claim on behalf of someone having a fraction of the maximum amount
  3. Test to claim on behalf of someone having all the investment
  4. Claim for yourself, make sure is not broken :)

@github-actions
Copy link
Contributor

  • 🔭 GP Swap: CoW Protocol v2 Swap UI

@anxolin anxolin marked this pull request as ready for review January 27, 2022 15:55
@anxolin anxolin requested review from a team January 27, 2022 15:55
@fairlighteth
Copy link
Contributor

Probably does not make sense to also set the 'Receive XXX vCOW' accordingly right? I guess by keeping it at 0, it emphasizes the error.

@W3stside
Copy link
Contributor

stop setting the base to develop 😂

@elena-zh
Copy link

Hey @anxolin , works great when claim on behalf.
But when claim for yourself, the 'Available investment used' is filled in by 100% when open the form, and the amount to claim is still 0.
It would be nice to keep in empty until a user starts filing in the field:
image

@W3stside W3stside changed the base branch from develop to release/1.10 January 27, 2022 16:34
@anxolin
Copy link
Contributor Author

anxolin commented Jan 27, 2022

I just did some changes to decouple setting the % from the error/warnings.

IMO, they are not connected. Some nice change this brings in my opinion, is that if you invest more than the MAX, you will see 100% not 0%. For me it creates a weird effect when you add an extra 0, and then remove for example (used to go from 100% to 0% and then back to 100%.

I feel the error is clear enough, so is ok to have the 100% even if the user has inputed a high number.

image

@anxolin anxolin force-pushed the improve-claim-behalf-error branch from 1d1e58f to 1d7beda Compare January 27, 2022 18:39
@anxolin anxolin force-pushed the improve-claim-behalf-error branch from 1d7beda to ce7a28a Compare January 27, 2022 18:40
@anxolin anxolin requested review from alfetopito, W3stside and a team January 27, 2022 18:41
@anxolin anxolin merged commit 386b64c into release/1.10 Jan 27, 2022
Copy link
Contributor

@W3stside W3stside left a comment

Choose a reason for hiding this comment

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

good

@elena-zh
Copy link

LGTM!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants