-
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variables
is already imported inside StyleUtils.ts
. Let's remove these parameters and use the imported ones inside the file.
const widthDifference = variables.mobileResponsiveWidthBreakpoint - windowWidth; | ||
const numberOfAvatar = numberOfParticipant < 4 ? numberOfParticipant : 4; | ||
if (isSmallScreenWidth && windowWidth <= 410) { | ||
const widthDifferent = 410 - windowWidth; | ||
switch (true) { |
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.
Can we add a comment here explaining how the calculation is done ?
src/styles/StyleUtils.ts
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const widthDifferent = 410 - windowWidth; | |
const widthDifference = 410 - windowWidth; |
@fedirjh I updated. |
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.
@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
src/styles/StyleUtils.ts
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a comment explaining the calculation logic.
@fedirjh I just updated. |
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.
Looks good and tests well.
✋ 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
410px
or 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
410px
or the amount text is short, the font size of amount text is the same between report preview and split billPR 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
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)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.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