-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Corrected Currency Display: Enforce Two Decimal Places in Amounts #35797
Corrected Currency Display: Enforce Two Decimal Places in Amounts #35797
Conversation
@eVoloshchak Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosAndroid: Native24-03-19-17-19-43.mp4Android: mWeb ChromeScreen.Recording.2024-03-19.at.17.36.21.moviOS: NativeScreen.Recording.2024-03-19.at.17.24.48.moviOS: mWeb SafariScreen.Recording.2024-03-19.at.17.28.12.movMacOS: Chrome / SafariScreen.Recording.2024-03-19.at.17.39.29.movMacOS: DesktopScreen.Recording.2024-03-19.at.17.22.21.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug:
- Open any 1:1 chat
- Press '+' button -> Request Money
- Enter an amount without the decimal point (i.e. "5")
- Click "Next"
- Click "Back"
- Notice the amount is now "5.00"
Screen.Recording.2024-02-06.at.15.22.18.mov
This is kind of an edge case, this comment explains it well
you're not wrong #34894 (comment), it's not quite consistent, but I think if the user has JUST entered a value, we'd want to maintain it as is, making it easier for the user to fix if needed. This is also how Square Cash and Venmo do it, as a reference.
done .. please review the latest change |
This is still present |
@eVoloshchak why do you consider the case mentioned in the video attached as a bug, i think it makes sense to be converted to the thing is, the amount of the transaction is saved as a number in the server and either you enter |
@abzokhattab, this isn't a bug per se, but I agree with this comment
The key here is we shouldn't change the amount if user JUST entered it. Say, you enter 8.8, click 'Next' and immediatelly come back wanting to change it. If it's immediately converted to 8.80, you have one additional keypress to do (and it's much worse for 8.00) |
Do you mean that we should only add a new var ( |
Video below demonstrates the desired behavior Essentially, if you enter an amount, press next and then immediately press 'Back', amount should stay the same. |
…ctions-amounts-the-same-as-the-user-entered
Okay, i removed the logic that updates the amount on clicking on next below: but this will cause this issue again as a regression, so if we are fine with that we can move forward. here the result: Screen.Recording.2024-02-18.at.11.31.13.PM.mov |
@abzokhattab, this doesn't seem to work correctly, I can still see the same bug Screen.Recording.2024-02-21.at.20.06.12.mov |
…ctions-amounts-the-same-as-the-user-entered
@eVoloshchak okay done please be aware that this change will cause those issues, if we are fine with this new approach then we can discard them |
@abzokhattab, took a look at #33125 #33123 #30505, we're definitely don't want those issues to come back |
…ctions-amounts-the-same-as-the-user-entered
do you have any idea in mind, I agree that we shouldn't bring them back, the problem is with this App/src/pages/iou/steps/MoneyRequestAmountForm.tsx Lines 129 to 136 in 104565b
however, i think we shouldn't remove it , let me know if you have any approach in mind or what should we do in this case. Thanks @eVoloshchak |
kindly reminder @eVoloshchak |
@dangrous okay i added some tests for the edge cases ... please let me now if you have any other comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor change just to make typescript happy!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, this looks good to me!
aw shoot, I was slow - can you update the merge conflicts @abzokhattab? Then we should be good to go |
4d26474
to
89d4d77
Compare
…ctions-amounts-the-same-as-the-user-entered
There we go @dangrous |
arggghhh sorry. One more time? I'll keep this tab open so it hopefully doesn't happen again |
…ctions-amounts-the-same-as-the-user-entered
😂😂😂😂 hopefully this is the last time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do it!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Reverting due to #39599 |
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.60-13 🚀
|
Details
Fixed Issues
$ #34894
$ #34894 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-02-02.at.2.15.48.AM.mov
Android: mWeb Chrome
Screen.Recording.2024-02-05.at.10.21.39.AM.mov
iOS: Native
Screen.Recording.2024-02-02.at.2.15.48.AM.mov
iOS: mWeb Safari
Screen.Recording.2024-02-05.at.10.21.39.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-02-05.at.10.20.36.AM.mov
MacOS: Desktop
Screen.Recording.2024-02-05.at.10.20.59.AM.mov