-
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
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. |
If you define |
@s77rt I have another idea, we can remove App/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.tsx Lines 232 to 237 in 016822b
then always call App/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.tsx Lines 325 to 327 in 6556e9a
|
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
App/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.tsx Lines 325 to 327 in 6556e9a
|
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
@@ -5,6 +5,7 @@ import type Beta from '@src/types/onyx/Beta'; | |||
import * as Environment from './Environment/Environment'; | |||
|
|||
function canUseAllBetas(betas: OnyxEntry<Beta[]>): boolean { | |||
return true; |
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.
need to remove this before merging
@dangrous I updated. |
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.
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 🚀
|
@@ -328,7 +339,7 @@ PopoverMenu.displayName = 'PopoverMenu'; | |||
export default React.memo( | |||
PopoverMenu, | |||
(prevProps, nextProps) => | |||
prevProps.menuItems.length === nextProps.menuItems.length && | |||
lodashIsEqual(prevProps.menuItems, nextProps.menuItems) && |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
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