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

[ECO-2313] Fix input fields on market and pools pages #308

Merged
merged 7 commits into from
Oct 31, 2024
Merged

Conversation

CRBl69
Copy link
Collaborator

@CRBl69 CRBl69 commented Oct 21, 2024

Description

This PR fixes input fields on the market and the pools pages.

Before, inputing small values would glitch the inputs.

Now, you can input values as small as 0.00000001, which is the smallest number you can trade.

Testing

Input small values on the market and the pools pages in vercel.

Copy link

vercel bot commented Oct 21, 2024

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

Name Status Preview Comments Updated (UTC)
emojicoin-dot-fun ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 31, 2024 3:36am
emojicoin-dot-fun-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 31, 2024 3:36am

Copy link
Collaborator

@xbtmatt xbtmatt left a comment

Choose a reason for hiding this comment

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

So as we discussed on call I think this is fairly complex because we're doing manual form validation with a custom decimal display (from the Aptos coin module)

I think there's two ways we can go with this:

  1. Add several unit tests specifically for the functions used in these components, and maybe a couple in playwright as well with actual input changes. This would be faster but it will continue to be difficult to maintain and update, although this likely won't change much again, + with tests it's easier to update safely.
  2. Refactor this to use some form validation library and minimize the amount of code we use and make it modular for any future frontend stuff we do with input + display coin decimal formatting

If we go with #1 I think it's important to also document what all the various regex patterns do- at least the ones that take more than 5 seconds (for a human) to parse and understand

I'm comfortable with either one, so it's up to you to choose. if I had to choose, I'd say number 2

@CRBl69 CRBl69 requested a review from xbtmatt October 28, 2024 17:24
@CRBl69 CRBl69 added urgency-medium Check after high urgency size-medium A medium sized PR. This can be reviewed and merged in a moderate amount of time. labels Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size-medium A medium sized PR. This can be reviewed and merged in a moderate amount of time. urgency-medium Check after high urgency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants