-
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 Emoji picker's position changes on decreasing the screen size #22792
Conversation
@allroundexperts Please 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] |
@allroundexperts please hold-on review this PR. I found some regression bug with this implement. I.e: if there are few of report message having reactions, if we're opening a EmojiPicker and one of those report message is deleted, this EmojiPicker will be hide automatically as well |
Any update here @hoangzinh? |
@allroundexperts Sorry for lated updates. I'm still on it. I'm still struggling to find a good solution for this. I will post my explored options soon. |
Any update @hoangzinh? |
Hi @allroundexperts after testing it carefully, I found another bug if we go with unmount approach. Screen.Recording.2023-07-19.at.18.12.46.movIn web, when we hover on a message, there are 2 opening EmojiPicker buttons. So if we click on of them, another one will unmount -> it calls EmojiPickerAction.resetEmojiPopoverAnchor -> the emojiPopoverAnchor is null -> when we add a emoji, it doesn't show anything. So I think about another option that finding a way to check emojiPopoverAnchor.current is null in this handler App/src/components/EmojiPicker/EmojiPicker.js Lines 42 to 46 in f225936
Take a look at this comment of Ali #17603 (comment) I think it's correct because we're passing the value of useRef to emojiPopoverAnchor.current. So when the component is unmount, emojiPopoverAnchor.current still reference to value of useRef.current not the useRef. So I think we should pass useRef object instead of useRef.current, it will be nil if the component unmount. Wdyt? I have implemented this idea in this PR https://github.com/Expensify/App/pull/23161/files |
cc @allroundexperts ^ |
Hi @hoangzinh! |
Okay. Quick question @hoangzinh. Why do we even need to worry about the Emoji picker buttons other than the one in composer? Without applying your changes, they seem to work fine. |
If my above comment doesn't work, then I think another easier approach would be to update your |
Yeah you're right. We don't really need to worry about it. I just revert changes to only affect in composer and context menu. I will try to test every thing again. Will let you know how is it going. |
@allroundexperts I finished update recording videos with latest PR. Could you help to review this PR again? Thanks |
@hoangzinh All of your tests are passing? |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-07-24.at.7.57.33.PM.movMobile Web - ChromeScreen.Recording.2023-07-24.at.8.06.51.PM.movMobile Web - SafariScreen.Recording.2023-07-24.at.8.05.24.PM.movDesktopScreen.Recording.2023-07-24.at.8.00.16.PM.moviOSScreen.Recording.2023-07-24.at.8.08.08.PM.movAndroidScreen.Recording.2023-07-24.at.8.08.53.PM.mov |
Sorry for late response. Yeah. I have tested several cases, both adding emoji (to ensure it won't break add emoji) and the main issues we're fixing. |
@@ -55,6 +55,7 @@ const defaultProps = { | |||
|
|||
function AddReactionBubble(props) { | |||
const ref = useRef(); | |||
useEffect(() => EmojiPickerAction.resetEmojiPopoverAnchor, []); |
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.
Why is this needed? Didn't we decide to not worry about this component?
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.
I thought we agreed to fix this issue as well #21982
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.
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.
Yep. We do. Apologies for the bump. I lost the context.
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!
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, thanks for thoroughly testing!
✋ 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/Li357 in version: 1.3.46-0 🚀
|
🚀 Deployed to staging by https://github.com/Li357 in version: 1.3.47-0 🚀
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.46-2 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.47-6 🚀
|
Details
Fixed Issues
$ #17603
PROPOSAL: #17603 (comment)
Tests
On Web/Desktop
Test case 1: Test Emoji button in composer box
Test case 2: Test Emoji button in context menu
Offline tests
The PR changes is not affected by network
QA Steps
Same as Tests
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
Screen.Recording.2023-07-23.at.22.39.52.-.web.mp4
Mobile Web - Chrome
Screen.Recording.2023-07-23.at.22.49.41.-.android.chrome.mov
Mobile Web - Safari
Screen.Recording.2023-07-23.at.23.03.53.-.ios.safari.mp4
Desktop
Screen.Recording.2023-07-23.at.22.45.33.-.desktop.mp4
iOS
Screen.Recording.2023-07-23.at.23.09.11.-.ios.mov
Android
Screen.Recording.2023-07-23.at.23.11.41.-.android.mp4