use PopoverMenu for account switcher modal#49051
Conversation
@s77rt Fixed two bugs above. About the first bug, the reason is the wrap view of |
@s77rt Can't reproduce the first bug. Screen.Recording.2024-09-16.at.18.04.40.mov |
|
@nkdengineer Close the modal and open it again |
69f4a85 to
70aa7f3
Compare
|
@s77rt I updated. Please help to check again. |
|
I don't think that would work, it will probably cause flickering issues especially since we have |
|
@s77rt To fix that we can do something like this and remove |
57288cf to
4e20be9
Compare
|
@s77rt I tested and it works well. Please help to check again. |
|
Thanks for figuring that out! let us know if that looks good to you, @s77rt |
|
@nkdengineer The solution looks good to me. Now it looks like some merge conflicts caused a styling issue (the badge is at the edge)
|
|
@s77rt It's correct for me. Screen.Recording.2024-10-11.at.12.02.21.mov |
|
@dangrous I fixed it now. |
src/libs/Permissions.ts
Outdated
| import * as Environment from './Environment/Environment'; | ||
|
|
||
| function canUseAllBetas(betas: OnyxEntry<Beta[]>): boolean { | ||
| return true; |
There was a problem hiding this comment.
need to remove this before merging
|
@dangrous I updated. |
dangrous
left a comment
There was a problem hiding this comment.
awesome! This looks great, thanks for puzzling out all those bugs.
|
✋ 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: 9.0.49-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.0.49-2 🚀
|
| PopoverMenu, | ||
| (prevProps, nextProps) => | ||
| prevProps.menuItems.length === nextProps.menuItems.length && | ||
| lodashIsEqual(prevProps.menuItems, nextProps.menuItems) && |
There was a problem hiding this comment.
Hey 👋 , coming from this issue. We changed the menuItems.length comparison to a deep comparison of menuItems, which may be causing the Popover menu flicker by re-rendering the component. We fixed it by using the existing shouldFreezeCapture prop in the ActiveHoverable component. However, if we use only the length comparison instead of a deep comparison, the issue doesn’t seem to occur
There was a problem hiding this comment.
Using the length is not enough to check if the items changed. I'm not sure if the freeze approach is best here. I think it's better to investigate why it did re-render, if the list was not changed you should memoise it.
|
Coming from #52114, the |








Details
use PopoverMenu for account switcher modal
Fixed Issues
$ #48292
PROPOSAL: #48292 (comment)
Tests
Offline tests
Same as above
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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
Screen.Recording.2024-09-12.at.16.37.31.mov
Android: mWeb Chrome
Screen.Recording.2024-09-12.at.16.41.41.mov
iOS: Native
Screen.Recording.2024-09-12.at.16.42.31.mov
iOS: mWeb Safari
Screen.Recording.2024-09-12.at.16.38.51.mov
MacOS: Chrome / Safari
Screen.Recording.2024-09-12.at.16.36.32.mov
MacOS: Desktop
Screen.Recording.2024-09-12.at.16.46.39.mov