-
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
Show Pop-over on Workspace Welcome #16962
Conversation
…rkspace-popover-welcome
Looking good. Just left a comment. |
…rkspace-popover-welcome
I think the issue is happening because we only update the That's why I can replicate the error in Web (if the screen is small like mWeb) but refreshing the page fixes the problem. |
Both problems are coming from this branch, trying to fix here! Edit: Nevermind, I replicated the |
The console logs were already reported and discussed and has a closed issue. Not sure what happened or how/if it was solved but I'll focus on the actual bug where you can't leave the chat on first sign-in now. |
… on first sign-in
The problem was happening because So as I first imagined the problem is related to the fact that we only update the I fixed this by setting the local Onyx value for the |
@PauloGasparSv is this ready for review? |
Not yet @luacmartins still adding evidences! |
The behavior doesn't work in mWeb! I investigated a bit but still have no idea why that's happening. Screen.Recording.2023-04-12.at.20.33.08.mov |
…rkspace-popover-welcome
All right, this has to do with Problem is that the screen and chat lifecycle is a bit different in that mode because of how the LNH works there in comparison to a fullscreen Web/Desktop. I'm still trying to figure a way to bypass this. |
…rkspace-popover-welcome
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-04-18.at.1.52.54.AM.movMobile Web - ChromeScreen.Recording.2023-04-18.at.1.47.16.AM.movMobile Web - SafariScreen.Recording.2023-04-18.at.1.44.04.AM.movDesktopScreen.Recording.2023-04-18.at.1.59.53.AM.moviOSScreen.Recording.2023-04-18.at.1.37.10.AM.movAndroidScreen.Recording.2023-04-18.at.2.04.05.AM.mov |
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.
Works well!
cc: @luacmartins
🎯 @thesahindia, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #17533. |
@chiragsalian all yours |
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.
I think code LGTM, just left some minor clarifying comments and a suggestion to remove "state" from your comments since I initially thought it was a react state variable. So removing it makes it easier to read imo.
src/libs/actions/Welcome.js
Outdated
@@ -36,7 +37,11 @@ Onyx.connect({ | |||
key: ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER, | |||
initWithStoredValues: false, | |||
callback: (val) => { | |||
isFirstTimeNewExpensifyUser = val; | |||
// If this is a first time new expensify user, let's only update the state of isFirstTimeNewExpensifyUser from true to false |
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.
// If this is a first time new expensify user, let's only update the state of isFirstTimeNewExpensifyUser from true to false | |
// If this is a first time new Expensify user, let's only update isFirstTimeNewExpensifyUser from true to false |
having a mention of "state" is tripping me up a little bit since it's not a state variable (in a react sense). Just my opinion to make it simpler.
isFirstTimeNewExpensifyUser = val; | ||
// If this is a first time new expensify user, let's only update the state of isFirstTimeNewExpensifyUser from true to false | ||
// after running all Welcome related logic in Welcome.show | ||
if (!isFirstTimeNewExpensifyUser) { |
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.
I'm a bit confused, you mention in the comment above this block updates isFirstTimeNewExpensifyUser from true to false.
But for a new user, isFirstTimeNewExpensifyUser is first null from the top and then when backend returns true for ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER
won't this be set from null to true?
Additionally from logic here if isFirstTimeNewExpensifyUser is true it will never set it to false. The condition here will give true only for !false
so you can only change isFirstTimeNewExpensifyUser from false or null to true/false here.
So maybe your comment needs to be rephrased. Let me know if I'm mistaken.
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.
I think my comment is very poorly written @chiragsalian so I'll explain each question and rework the comment too.
But for a new user, isFirstTimeNewExpensifyUser is first null from the top and then when backend returns true for ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER won't this be set from null to true?
Yes, the first time this logic is reached is when we first set isFirstTimeNewExpensifyUser
to true.
Additionally from logic here if isFirstTimeNewExpensifyUser is true it will never set it to false. The condition here will give true only for !false so you can only change isFirstTimeNewExpensifyUser from false or null to true/false here.
Yes! It only updates the value of isFirstTimeNewExpensifyUser
if it already was falsy.
Since we never update isFirstTimeNewExpensifyUser
to true, we only set isFirstTimeNewExpensifyUser
when it first loads through Onyx.
src/libs/actions/Welcome.js
Outdated
Navigation.navigate(ROUTES.getReportRoute(workspaceChatReport.reportID)); | ||
|
||
// If showPopoverMenu exists and returns true then it opened the Popover Menu succesfully and we can update the state of isFirstTimeNewExpensifyUser |
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.
// If showPopoverMenu exists and returns true then it opened the Popover Menu succesfully and we can update the state of isFirstTimeNewExpensifyUser | |
// If showPopoverMenu exists and returns true then it opened the Popover Menu successfully, and we can update isFirstTimeNewExpensifyUser |
src/libs/actions/Welcome.js
Outdated
@@ -124,6 +142,9 @@ function show({routes, showCreateMenu}) { | |||
if (!Policy.isAdminOfFreePolicy(allPolicies) && !isDisplayingWorkspaceRoute) { | |||
showCreateMenu(); | |||
} | |||
|
|||
// Update state of isFirstTimeNewExpensifyUser so the Welcome logic doesn't run again |
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.
// Update state of isFirstTimeNewExpensifyUser so the Welcome logic doesn't run again | |
// Update isFirstTimeNewExpensifyUser so the Welcome logic doesn't run again |
@PauloGasparSv let's address Chirag's comment above and get this one merged today! |
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.
We also have conflicts now
af0539e
Fixed the conflicts with Re-testing everything here. |
Re-tested and so far everything is working. WebWeb.movWeb.small.screen.movMobile Web - ChromemWeb.Chrome.movMobile Web - SafarimWeb.Safari.movDesktopDesktop.moviOSScreen.Recording.2023-04-19.at.16.37.15.movAndroidhttps://user-images.githubusercontent.com/6564265/233170196-44c52cfc-2376-465c-98aa-7bc83037ecb9.mov |
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.
LGTM
Going ahead and merging since it was mostly minor changes since the latest approvals. |
✋ 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/chiragsalian in version: 1.3.3-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.3-2 🚀
|
Details
This changes our logic for new accounts that access newDot for the first time!
If the new account is part of a workspace because it was invited then in their first signin the app should:
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/270487
PROPOSAL: GH_LINK_ISSUE(COMMENT)
Tests
This requires creating multiple accounts to test/QA!
isFirstTimeNewExpensifyUser
:Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
Screen.Recording.2023-04-14.at.16.02.10.mov
Screen.Recording.2023-04-14.at.16.06.12.mov
Mobile Web - Chrome
Screen.Recording.2023-04-14.at.16.14.27.mov
Mobile Web - Safari
Screen.Recording.2023-04-14.at.16.16.20.mov
Desktop
Screen.Recording.2023-04-14.at.16.13.14.mov
iOS
Screen.Recording.2023-04-14.at.16.38.31.mov
Android
Screen.Recording.2023-04-14.at.16.20.29.mov