-
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 popover menu anchor alignment prop #19849
Fix popover menu anchor alignment prop #19849
Conversation
@iwiznia @Santhosh-Sellavel One of you needs to 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] |
Apologies for the lint issues, I will try best for them to not happen again! |
Bump for review @Santhosh-Sellavel |
@huzaifa-99 Conflicts |
@Santhosh-Sellavel Fixed merge conflicts! |
Reviewer Checklist
Screenshots/VideosWeb & DesktopScreen.Recording.2023-06-07.at.12.37.08.AM.movMobile Web - Chrome & Androiddevice-2023-06-02-022200.mp4Mobile Web - Safari & iOSSimulator.Screen.Recording.-.iPhone.14.-.2023-06-02.at.02.16.58.mp4 |
@Santhosh-Sellavel bump for review. |
@huzaifa-99 There are conflicts again |
@Santhosh-Sellavel resolved |
@huzaifa-99 All looks good, there is slight inconsistency between Desktop & Web |
I did some digging, its because we are adding an extra I suggest we make a height style utility, and use it like this threeDotsPopoverOffset: (windowWidth) => ({
vertical: height(60),
horizontal: windowWidth - 60,
}), and we create the desktop variant import styles from '../styles';
import variables from '../variables';
export default (height) => {
return height + 12; // we add 12px as a header gap on desktop
}; In desktop it will add @Santhosh-Sellavel please let me know if you agree so I add these changes. |
Looks good @iwiznia Thoughts? |
hmmmm kind of odd, do we do something like that? Define specific helper methods for styling different the different platforms? Would it be better to do something like pass the heather gap height as a param to the method, so it can add that to the position? |
@iwiznia cc: @huzaifa-99 |
I like that more. |
Or maybe |
// On desktop app we are adding a header gap of 12px | ||
// which we need to add to vertical offset when setting | ||
// offset on desktop | ||
vertical: vertical + 12, |
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.
12 should be made as CONST
and used at both places.
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.
Done @Santhosh-Sellavel
Updated test videos for desktop and web. |
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.
@iwiznia Do you have any suggestions?
@@ -0,0 +1,8 @@ | |||
import CONST from '../../CONST'; | |||
|
|||
export default (vertical) => ({ |
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.
Add JS Doc
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.
Done
src/CONST.js
Outdated
@@ -827,6 +827,7 @@ const CONST = { | |||
WIDTH: 320, | |||
HEIGHT: 416, | |||
}, | |||
DESKTOP_HEADER_HEIGHT: 12, |
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.
DESKTOP_HEADER_HEIGHT: 12, | |
DESKTOP_HEADER_PADDING: 12, |
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.
Make changes in other places too
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.
Done
@Santhosh-Sellavel bump for review. The suggested changes are done! |
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.
All yours @iwiznia!
@iwiznia bump for review |
@@ -0,0 +1,13 @@ | |||
import CONST from '../../CONST'; |
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.
Comment related to the whole directory, not this specific line.
Can we make the name of this function be more clear? Like can we add it under a directory that indicates what components use this or add something to the name or something?
Reading getVerticalOffset tells you nothing about what vertical offset is this supposed to be.
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 make the name of this function be more clear? Like can we add it under a directory that indicates what components use this or add something to the name or something?
I think the one's directly in /styles/
folder are for these one-off cases like cardStyles, addOutlineWidth, editedLabelStyles and more, and those in styles/utilities are proper style utilities like cursor, visibility etc. (By one-off cases i meant the one we have in PR)
But i maybe wrong here since we also have bold and italic directly in /styles and not in /styles/utilities and vice versa. TBH idk why we have the styles/utilities in the first place it just seems unnecessary or if it is necessary then the styles folder's outside of it seems unnecessary.
Reading getVerticalOffset tells you nothing about what vertical offset is this supposed to be.
Its a little ambiguous yes, maybe we could add a direction with it like getVerticalOffsetFromTop
etc or any other name, @Santhosh-Sellavel curious if you have any suggestions here?
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.
Sorry for not being clear. This style is related to the PopOver component, no?
threeDotsPopoverOffset and threeDotsPopoverOffsetNoCloseButton then createMenuPositionProfile also ends up passing this to a PopOver component.
So, a better name might be getPopOverVerticalOffset
or similar.
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, Thank you! I will be updating it.
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.
✋ 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/iwiznia in version: 1.3.27-0 🚀
|
🚀 Deployed to staging by https://github.com/iwiznia in version: 1.3.27-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.27-7 🚀
|
Details
Fixed Issues
$ #19453, #19791
PROPOSAL: #19453 (comment)
Tests
/settings/profile
- verify that on clicking the photo icon the popover is not covering the profile photo/workspace/:id/settings
- verify that on clicking the photo icon the popover is not covering the workspace photo/workspace/:id
- verify that on clicking the 3-dots the popover is not covering the headerOffline tests
Same as above
QA Steps
Same as above
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)/** 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
Web
Chrome
Web.chrome.mp4
Safari
Web.Safari.mp4
Mobile Web - Chrome
mWeb.Chrome.mp4
Mobile Web - Safari
IOS.Safari.mp4
Desktop
Desktop.mp4
iOS
ios.-.compressed.mp4
Android
Android.mp4