Fix Emoji picker's position changes on decreasing the screen size#22792
Fix Emoji picker's position changes on decreasing the screen size#22792Li357 merged 7 commits intoExpensify:mainfrom
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. |
|
|
||
| function AddReactionBubble(props) { | ||
| const ref = useRef(); | ||
| useEffect(() => EmojiPickerAction.resetEmojiPopoverAnchor, []); |
There was a problem hiding this comment.
Why is this needed? Didn't we decide to not worry about this component?
There was a problem hiding this comment.
I thought we agreed to fix this issue as well #21982
There was a problem hiding this comment.
Yep. We do. Apologies for the bump. I lost the context.
Li357
left a comment
There was a problem hiding this comment.
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 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)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)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
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