Fix inconsistency font size of amount text between report preview and split bill#30960
Conversation
|
cc @dukenv0307 Please fix the screenshots. |
Reviewer Checklist
Screenshots/Videos |
|
@fedirjh I updated. |
| variables.fontSizeXLarge, | ||
| variables.lineHeightXXLarge, |
There was a problem hiding this comment.
variables is already imported inside StyleUtils.ts. Let's remove these parameters and use the imported ones inside the file.
| const numberOfAvatar = numberOfParticipant < 4 ? numberOfParticipant : 4; | ||
| if (isSmallScreenWidth && windowWidth <= 410) { | ||
| const widthDifferent = 410 - windowWidth; | ||
| switch (true) { |
There was a problem hiding this comment.
Can we add a comment here explaining how the calculation is done ?
| const widthDifference = variables.mobileResponsiveWidthBreakpoint - windowWidth; | ||
| const numberOfAvatar = numberOfParticipant < 4 ? numberOfParticipant : 4; | ||
| if (isSmallScreenWidth && windowWidth <= 410) { | ||
| const widthDifferent = 410 - windowWidth; |
There was a problem hiding this comment.
| const widthDifferent = 410 - windowWidth; | |
| const widthDifference = 410 - windowWidth; |
|
@fedirjh I updated. |
fedirjh
left a comment
There was a problem hiding this comment.
@dukenv0307 The font-size calculation is not working as expected. When comparing two split previews with different amounts, the current result shows that both are responsive in the same way. The expected result for the small amount is to display the text with the static font size.
CleanShot.2023-11-08.at.14.06.32.mp4
| case widthDifference > 60: | ||
| if (18 - numberOfAvatar * 2 < displayAmountLength) { | ||
| toSubtract = numberOfAvatar * 2; | ||
| } | ||
| break; | ||
| case widthDifference > 50: | ||
| if (18 - numberOfAvatar * 2 < displayAmountLength) { | ||
| toSubtract = (numberOfAvatar - 1) * 2 + 1; | ||
| } | ||
| break; | ||
| case widthDifference > 40: | ||
| if (20 - numberOfAvatar * 2 < displayAmountLength) { | ||
| toSubtract = (numberOfAvatar - 1) * 2; | ||
| } | ||
| break; | ||
| case widthDifference > 30: | ||
| if (20 - numberOfAvatar * 2 < displayAmountLength) { | ||
| toSubtract = (numberOfAvatar - 1) * 2 - 1; | ||
| } | ||
| break; | ||
| case widthDifference > 350: | ||
| toSubtract = 4; | ||
| case widthDifference > 20: | ||
| if (20 - numberOfAvatar * 2 < displayAmountLength) { | ||
| toSubtract = (numberOfAvatar - 2) * 2; | ||
| } |
There was a problem hiding this comment.
Let's add a comment explaining the calculation logic.
|
@fedirjh I just updated. |
|
✋ 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/nkuoch in version: 1.3.99-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.99-0 🚀
|
|
🚀 Deployed to staging by https://github.com/nkuoch in version: 1.4.0-0 🚀
|




















Details
Fix inconsistency font size of amount text between report preview and split bill
Fixed Issues
$ #30275
PROPOSAL: #30275 (comment)
Tests
410pxor the amount text is short, the font size of amount text is the same between report preview and split billOffline tests
Same as above
QA Steps
410pxor the amount text is short, the font size of amount text is the same between report preview and split billPR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
Screen.Recording.2023-11-07.at.20.32.34.mov
Android: mWeb Chrome
Screen.Recording.2023-11-07.at.20.27.57.mov
iOS: Native
Screen.Recording.2023-11-07.at.14.47.03.mov
iOS: mWeb Safari
Screen.Recording.2023-11-07.at.20.24.11.mov
MacOS: Chrome / Safari
Screen.Recording.2023-11-07.at.20.22.39.mov
MacOS: Desktop
Screen.Recording.2023-11-07.at.20.35.03.mov