Closed zed-wong closed 5 months ago
This PR is being deployed to Railway ๐
This PR is being deployed to Railway ๐
The latest updates on your projects. Learn more about Vercel for Git โ๏ธ
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
mr-market | โ Ready (Inspect) | Visit Preview | Apr 17, 2024 10:12am |
PR Description updated to latest commit (https://github.com/Hu-Fi/Mr.Market/commit/e5151143087a9e890b7fc34ba3b45cbac906afef)
โฑ๏ธ Estimated effort to review [1-5] | 2, because the changes are straightforward and localized to input field attributes across several Svelte components. The modifications are mainly about removing the 'inputmode' attribute and adjusting regex patterns for input validation. |
๐งช Relevant tests | No |
๐ Possible issues | Regex Pattern Inconsistency: The regex pattern "\d*\.?\d*" used in 'exchanges.svelte' might not be robust enough for strict decimal validation as it allows multiple dots and does not enforce digit presence before or after the dot. |
๐ Security concerns | No |
relevant file | interface/src/lib/components/grow/arbitrage/new/easy/exchanges.svelte |
suggestion | Consider refining the regex pattern to ensure it accurately validates decimal inputs. A more precise pattern might be "^\d+(\.\d+)?$" which ensures at least one digit before and at most one dot followed by one or more digits. [important] |
relevant line | pattern="\d*\.?\d*" |
PR Description updated to latest commit (https://github.com/Hu-Fi/Mr.Market/commit/e5151143087a9e890b7fc34ba3b45cbac906afef)
Persistent review updated to latest commit https://github.com/Hu-Fi/Mr.Market/commit/e5151143087a9e890b7fc34ba3b45cbac906afef
Category | Suggestions |
Enhancement |
Enhance the regex pattern to enforce a specific number of decimal places.___ **The regex pattern for the input field only allows numbers and a single dot, which mightnot be sufficient for all decimal inputs, especially those requiring a specific format or precision. Consider enhancing the regex pattern to enforce a more precise format, such as limiting the number of decimal places.** [interface/src/lib/components/grow/arbitrage/new/easy/exchanges.svelte [233]](https://github.com/Hu-Fi/Mr.Market/pull/160/files#diff-76a6a96298f7905c2da1e23483669b1951f5de3e0b25f37df050d78eb0878233R233-R233) ```diff -pattern="\d*\.?\d*" +pattern="^\d+(\.\d{1,2})?$" ``` |
Usability |
Restore the input mode for decimal numbers to improve mobile usability.___ **The input field lacks an explicit input mode for decimal numbers, which was present in theprevious version. Restoring inputmode="decimal" can improve the mobile user experience by bringing up the appropriate keyboard.** [interface/src/lib/components/grow/marketMaking/new/easy/amount.svelte [35]](https://github.com/Hu-Fi/Mr.Market/pull/160/files#diff-459a25a5ea5b96b0229135f3d0cef5dfc4bb8b073efd3be20b13d92890eade55R35-R35) ```diff - + ``` |
Add
___
**The removal of | |
Reinstate
___
**Consider reintroducing | |
Restore
___
**Adding |
Category | Suggestions |
Enhancement |
Refine the regex pattern to ensure only valid decimal numbers can be entered.___ **Thepattern attribute for the input field is set to allow any number of digits followed by an optional decimal point and more digits. This regex pattern does not restrict the input to valid decimal numbers as it allows multiple decimal points. Consider refining the regex pattern to ensure only valid decimal numbers can be entered.** [interface/src/lib/components/grow/arbitrage/new/easy/exchanges.svelte [233]](https://github.com/Hu-Fi/Mr.Market/pull/160/files#diff-76a6a96298f7905c2da1e23483669b1951f5de3e0b25f37df050d78eb0878233R233-R233) ```diff -pattern="\d*\.?\d*" +pattern="^\d+(\.\d+)?$" ``` |
Add a pattern attribute to restrict input to numeric values.___ **The input field lacks any constraints on the type of data that can be entered. To improveusability and prevent errors, consider adding a pattern attribute to restrict input to numeric values, similar to other input fields in the project.** [interface/src/lib/components/grow/marketMaking/new/easy/amount.svelte [35]](https://github.com/Hu-Fi/Mr.Market/pull/160/files#diff-459a25a5ea5b96b0229135f3d0cef5dfc4bb8b073efd3be20b13d92890eade55R35-R35) ```diff - + ``` | |
Usability |
Reintroduce
___
**The removal of |
Add
___
**The removal of | |
Reinstate
___
**Similar to other inputs, the removal of |
Type
Enhancement
Description
inputmode="decimal"
and introduced regex patterns where necessary to validate decimal input.Changes walkthrough
exchanges.svelte
Update input pattern for decimal validation
interface/src/lib/components/grow/arbitrage/new/easy/exchanges.svelte - Changed input pattern to allow decimal numbers.
amount.svelte
Simplify input fields and remove inputmode
interface/src/lib/components/grow/marketMaking/new/easy/amount.svelte
inputs.svelte
Refactor input fields for bids component
interface/src/lib/components/spot/bids/inputs.svelte
input.svelte
Remove inputmode from swap input field
interface/src/lib/components/swap/input.svelte - Removed inputmode attribute from the input field.
output.svelte
Remove inputmode from swap output field
interface/src/lib/components/swap/output.svelte - Removed inputmode attribute from the output field.