Fix createMenuPositionSidebar style#31679
Conversation
Reviewer Checklist
Screenshots/Videos |
|
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
| ({ | ||
| horizontal: 18, | ||
| vertical: windowHeight - 75, | ||
| vertical: windowHeight - 87, |
There was a problem hiding this comment.
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.
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.
@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.
We try to always use units of 4... so perhaps + 12 makes more sense here
| avatarSizeMentionIcon: 16, | ||
| avatarSizeSmallSubscript: 14, | ||
| defaultAvatarPreviewSize: 360, | ||
| fabBottom: 25, |
There was a problem hiding this comment.
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.
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
|
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 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)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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop