fix: Rules - No space between currency sign and amount in RHP field “Amount” - #59792
Conversation
…Amount” Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@DylanDylann 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] |
| paddingBottom: 8, | ||
| }, | ||
|
|
||
| pb2half: { |
There was a problem hiding this comment.
Why do we need to adjust padding bottom here?
There was a problem hiding this comment.
Which thing are you adjusting though? Are you adjusting the currency symbol or the input?
There was a problem hiding this comment.
Also, what happens when the currency is multiple letters/symbols?
There was a problem hiding this comment.
Which thing are you adjusting though? Are you adjusting the currency symbol or the input?
I have adjusted the currency symbol by updating padding bottom from 8px to 10px.
Also, what happens when the currency is multiple letters/symbols?
Monosnap.screencast.2025-04-10.10-58-21.mp4
There was a problem hiding this comment.
Interesting, I'm surprised we didn't just use flexbox here so we didn't need to do custom padding calculations.
There was a problem hiding this comment.
Interesting, I'm surprised we didn't just use flexbox here so we didn't need to do custom padding calculations.
That's because we are using absolute positioning for the currency symbol so we need to calculate the padding for the amount.
There was a problem hiding this comment.
Yes, what I am saying is that I am surprised that we chose that path instead of flexbox.
| }, | ||
|
|
||
| pr0half: { | ||
| paddingRight: 2, |
There was a problem hiding this comment.
Where exactly are these half values being used? Are we sure we can't just use 4?
There was a problem hiding this comment.
This was not needed, reverted.
| }, | ||
|
|
||
| pl0half: { | ||
| paddingLeft: 2, |
There was a problem hiding this comment.
Same comment as above - why 2 and not 4?
There was a problem hiding this comment.
The current padding is based on the left margin obtained from getCharacterPadding, which provides only an approximate value rather than an exact one. As a result, we previously needed additional padding. However, now that we have the exact width of the currency symbol and want to maintain the current spacing, we need to reduce the padding to 2.
Current spacing (previously it was 4px but now we need 2px to make it the same):
If we keep the previously value:
There was a problem hiding this comment.
I think the previous value was totally fine personally. I don't think we need to adjust it.
There was a problem hiding this comment.
Agree with that as well 👍
|
Hmm this feels like a ton of changes just to add a bit of spacing on the left? Maybe that's just me though... |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
There's multiple screenshots and adjustments happening above. What specifically are we referring to here? |
|
I think the idea was to just create more space between the fixed currency symbol and the editable number input. |
I don't think that's a good idea, because if we just add more space, it will look weird when the currency has a single letter or symbol, and we've added space based on the longest currency code. That's why we need to get the exact width of the selected currency. |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
I dunno enough about the implications, but I guess my thought is that the spacing when you have a |
Yes, I have added 4px of padding as per this comment. Monosnap.screencast.2025-04-10.10-58-21.mp4 |
|
Okay, can we resolve conflicts and get this prepped for another round of review? Sorry for all of the small comments but I just want to make sure we are taking the most simple approach here and not overcomplicating these inputs. |
| paddingBottom: 8, | ||
| }, | ||
|
|
||
| pb2half: { |
There was a problem hiding this comment.
| pb2half: { | |
| pb2_5: { |
There was a problem hiding this comment.
I still don't quite understand this one. Can you show me the before/after when this is and isn't applied?
There was a problem hiding this comment.
Ahhh, It is not a bug, just a new idea about naming constant
There was a problem hiding this comment.
@DylanDylann we need to name the variable pb2half else it would give lint error Object Literal Property name pb2_5 must match one of the following formats: camelCase, UPPER_CASE, PascalCase.
There was a problem hiding this comment.
I'm still waiting to see a screenshot of before and after this addition. We didn't have this before, so I'm wondering why we need to add it now.
There was a problem hiding this comment.
There was a problem hiding this comment.
Got it, thanks for clarifying 👍
|
@Krishna2323 Could you please resolve conflict? |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@Krishna2323 failed lint |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Reviewer Checklist
Screenshots/Videos |
|
✋ 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/madmax330 in version: 9.1.28-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.1.28-15 🚀
|
| const inputPaddingLeft = !!prefixCharacter && StyleUtils.getPaddingLeft(StyleUtils.getCharacterPadding(prefixCharacter) + styles.pl1.paddingLeft); | ||
| const inputPaddingRight = !!suffixCharacter && StyleUtils.getPaddingRight(StyleUtils.getCharacterPadding(suffixCharacter) + styles.pr1.paddingRight); | ||
| const inputPaddingLeft = !!prefixCharacter && StyleUtils.getPaddingLeft(prefixCharacterPadding + styles.pl1.paddingLeft); | ||
| const inputPaddingRight = !!suffixCharacter && StyleUtils.getPaddingRight(prefixCharacterPadding + styles.pr1.paddingRight); |
There was a problem hiding this comment.
The changes here led to the following issue:
which was addressed in a follow-up PR.












Explanation of Change
Fixed Issues
$ #58942
PROPOSAL: #58942 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android_native.mp4
Android: mWeb Chrome
android_chrome.mp4
iOS: Native
ios_safari.mp4
iOS: mWeb Safari
ios_safari_org.mp4
MacOS: Chrome / Safari
web_chrome.mp4
MacOS: Desktop
desktop_app.mp4