-
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
Fix createMenuPositionSidebar style #31679
Fix createMenuPositionSidebar style #31679
Conversation
Reviewer Checklist
Screenshots/Videos |
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.
LGTM.
We did not find an internal engineer to review this PR, trying to assign a random engineer to #31632 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
src/styles/styles.ts
Outdated
@@ -1395,7 +1395,7 @@ const styles = (theme: ThemeColors) => | |||
createMenuPositionSidebar: (windowHeight: number) => | |||
({ | |||
horizontal: 18, | |||
vertical: windowHeight - 75, | |||
vertical: windowHeight - 87, |
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.
Really don't like these random numbers being thrown around, any chance we can construct this value out of existing constants? Why is it changing from 75 => 87?
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.
It was mentioned in the description of this PR. But you're right it could be written more readably, so I refactored this code and added a comment with some explanations
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.
@jasperhuangg Could you check if the last change in this line is ok?
src/styles/styles.ts
Outdated
vertical: windowHeight - 75, | ||
// Menu should be displayed 10px above the floating action button. | ||
// To achieve that sidebar must be moved by: distance from the bottom of the sidebar to the fab (variables.fabBottom) + fab height (variables.componentSizeLarge) + distance above the fab (10px) | ||
vertical: windowHeight - (variables.fabBottom + variables.componentSizeLarge + 10), |
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.
We try to always use units of 4... so perhaps + 12
makes more sense here
@@ -43,6 +43,7 @@ export default { | |||
avatarSizeMentionIcon: 16, | |||
avatarSizeSmallSubscript: 14, | |||
defaultAvatarPreviewSize: 360, | |||
fabBottom: 25, |
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.
What does this mean exactly? It's the distance of the FAB to the bottom of the screen? What was it before we made any of these changes?
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.
Yes, it's this distance. I've added this variable only to use it in a calculation of the menu position. Thanks to that it's easier to understand how we set the menu position
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.
Sounds good.
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.
Thanks!
All yours @shawnborton |
✋ 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/shawnborton in version: 1.4.10-0 🚀
|
🚀 Deployed to staging by https://github.com/shawnborton in version: 1.4.10-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.10-1 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.10-1 🚀
|
Details
Floating action button size was changed from 40px x 40px to 52px to 52px. This PR fixes the position of the sidebar menu which wasn't adjusted to the new button size. The button size has changed by 12px, so the position of the sidebar menu has increased also by 12px. This update is quite simple, so I've attached screenshots only for the web version.
Fixed Issues
Before:
After:
$ #31632
PROPOSAL:
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)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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop