-
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
Address #5047 - Open global create when a user logs in for the first time #5214
Conversation
Looks like there's a weird issue on iOS causing the menu not to open on first load. Investigating now. |
Here's a demonstration of the issue: Screen.Recording.2021-09-13.at.12.50.21.AM.movThe menu opens when you refresh the simulator, but not when the app first loads (which will presumably happen in production). But I think I've zeroed in on what's causing it. This is the only PopoverMenu in the app that has an issue rendering on first load [on mobile] because it's the only one inside
When it gets passed directly as a screen, it has no issue rendering on first load
demo2.movThe only workaround I've found is to set a timeout in
But obviously that's... not ideal. Since it seems like the issue is with |
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.
Please keep semicolons on each line, and trailing commas :D Expensify style preference
@mateomorris thanks for the investigation into the issues on mobile! If your temporary workaround (using |
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.
Nice! Tests well, please feel free to report the issue regarding the race condition so we don't have to keep the setTimeout
for iOS!
✋ 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 @Beamanator in version: 1.0.97-1 🚀
|
setTimeout(() => { | ||
this.toggleCreateMenu(); | ||
|
||
// Set the NVP back to false (this may need to be moved if this NVP is used for anything else later) |
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.
(this may need to be moved if this NVP is used for anything else later)
This comment isn't really useful. Why are we thinking about what we might do with this later. Let's just focus on what we are using it for now because we don't know how else it would be used or why that would make a difference to the code here.
|
||
if (this.props.isFirstTimeNewExpensifyUser) { | ||
// For some reason, the menu doesn't open without the timeout | ||
setTimeout(() => { |
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.
For some reason, the menu doesn't open without the timeout
This isn't really an acceptable solution and we should try to avoid adding things to the code that we don't understand.
Just one idea that I haven't tested but to get around the SidebarScreen.propTypes = propTypes;
export default compose(
withLocalize,
withWindowDimensions,
withOnyx({
betas: {
key: ONYXKEYS.BETAS,
},
isFirstTimeNewExpensifyUser: {
key: ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER,
initWithStoredValues: false, // Ensure we always use the value from the server
},
}),
)(SidebarScreen); Then have a componentDidUpdate(prevProps) {
if (!prevProps.isFirstTimeNewExpensifyUser && this.props.isFirstTimeNewExpensifyUser) {
this.toggleCreateMenu();
NameValuePair.set(CONST.NVP.IS_FIRST_TIME_NEW_EXPENSIFY_USER, false, ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER);
}
} |
This has been deployed to production and is now subject to a 7-day regression period. |
🚀 Deployed to production by @francoisl in version: 1.0.98-1 🚀
|
Discussed with @marcaaron , I'm removing |
Details
When a user opens New Expensify for the first time, the Global Create Menu should open automatically.
Fixed Issues
$ #5047
Tests
Ensure that menu opens for new users & existing users logging in for the first time since update
Ensure that menu doesn't open for existing users who the menu has already opened for
QA Steps
Using a brand new account:
Using an existing account which hasn't seen the menu open automatically yet
Using the same existing account
Tested On
Screenshots
Web
OpenGlobalCreate.mov
Desktop
Attached is an example of the menu not opening for an existing user, but not it opening for a new user.
I can't see a way to test for a new user on desktop because I can't replace the address in Electron (meaning I can't create a new account & click the signup link to open the desktop app). If necessary, I could create a url bar in Electron, but that would take some extra work.
Desktop.mov
Mobile Web
mobilewebdemo.mov
iOS
iosDemoOpenMenu.mov
Android
Incoming - still getting my environment set up