-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix: split amount is put into a second line #43624
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
|
@dukenv0307 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] |
@dukenv0307 PR ready for review. |
@tienifr bump |
@tienifr friendly bump |
On it now. I was working on a related PR and thought it's better to finish it first before this so we wouldn't have expectation conflicts. |
That would be great, thanks! |
touchableInputWrapperStyle={[styles.ml3]} | ||
onFormatAmount={CurrencyUtils.convertToDisplayStringWithoutCurrency} | ||
onAmountChange={(value: string) => onSplitShareChange(participantOption.accountID ?? -1, Number(value))} | ||
maxLength={formattedTotalAmount.length} | ||
contentWidth={CurrencyUtils.convertToDisplayStringWithoutCurrency(maxSplitAmount).length * 9} |
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.
Earlier we assumed each digit occupies 9px
then multiply the total amount with 9
to compute the content width. That's to make sure the all the split input widths are equal and are the longest possible number length which assumingly is the total amount.
But since the paddings, margins... are no longer inclusive in this content width, in case the total amount has more digits than the individual split amount, we would have a larger input width.
So I kept the old requirement: the split input widths are equal and are the longest possible number length but the longest possible number now is not based on the total amount but the individual split amount.
@tienifr I think we need to keep using
|
@tienifr any updates? |
@dukenv0307 As per my investigation, Lines 1106 to 1108 in b573e74
The above snippet was previously used to compute the exact number width based on each digit (but we eventually used fixed width So I think reducing it to
|
I found the following bug:
Screen.Recording.2024-07-10.at.16.03.33.mov |
@tienifr ^ |
@dukenv0307 I see in your recording that there are duplicated participants (2 |
Reviewer Checklist
Screenshots/Videos |
LGTM |
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! One day I feel like we might need to fully refactor BaseTextInput, it's getting kinda complicated... but this works for now!
aw shoot we got some conflicts in the meantime. Sorry @tienifr can you handle those and then I can merge? |
@dangrous All done. |
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.
good to go!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/dangrous in version: 9.0.7-3 🚀
|
🚀 Cherry-picked to staging by https://github.com/thienlnam in version: 9.0.7-4 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.7-8 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.8-6 🚀
|
Details
Split amount overflows and jumps into a second line. This PR fixes that.
Fixed Issues
$ #42117
PROPOSAL: #42117 (comment)
Tests
$199.98
amountOffline tests
NA
QA Steps
$199.98
amountPR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop