Fix the user's name/picture is not dynamically updated if the Emoji popup is open#20243
Conversation
| this.state.popoverAnchorPosition !== nextState.popoverAnchorPosition || | ||
| previousLocale !== nextLocale || | ||
| (this.state.isPopoverVisible && | ||
| (!_.isEqual(prevSelectedReaction, selectedReaction) || |
There was a problem hiding this comment.
I don't think we really need to compare prevSelectedReaction and selectedReaction. Reasons:
- What we are displaying in the Popover is emojiName, emojiCount, emojiCode, hasUserReacted and users state which are retrieved from
selectedReaction=> I think we just need to compare those states are enough to decide whether the component should update - We're using deep comparison which will cause performance concern => If we can avoid, we should.
There was a problem hiding this comment.
@hoangzinh I think this is necessary, when user 2 reacts with new emoji, the popover doesn’t re-render and that will cause this bug , we should fix this case as well.
Bug.mov
There was a problem hiding this comment.
@fedirjh could you give expectation when User 2 reacts with new emoji, what should be displayed in the Popoper?
There was a problem hiding this comment.
Hmm, I think I was wrong, I thought the popover should display all reacted emojis , but it seems that we don't have all emojis popover yet. So I guess this is fine for now
Reviewer Checklist
Screenshots/VideosWebWeb.1.movWeb.2.movMobile Web - ChromeChrome.movMobile Web - SafariSafari.mp4DesktopDesktop.moviOSIOS.mp4AndroidAndroid.mov |
|
✋ 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/dangrous in version: 1.3.26-0 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.26-4 🚀
|
Details
Fixed Issues
$ #19788
PROPOSAL: #19788 (comment)
Tests
Offline tests
Can not test when offline
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-06-06.at.16.41.58.-.web.mp4
Mobile Web - Chrome
Screen.Recording.2023-06-06.at.18.05.34.-.android.chrome.mp4
Mobile Web - Safari
Screen.Recording.2023-06-06.at.18.16.30.-.ios.safari.mp4
Desktop
Screen.Recording.2023-06-06.at.17.01.56.-.desktop.mp4
iOS
Screen.Recording.2023-06-06.at.18.19.57.-.ios.mp4
Android
Screen.Recording.2023-06-06.at.18.08.09.-.android.mp4