-
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
Feature/38774 expensify persona #41343
Feature/38774 expensify persona #41343
Conversation
@sobitneupane Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
AuthPR deployed to prod, let's get this one reviewed. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
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.
- The chat with Expensify persona is created as a group chat with two members(user and Expensify persona). Is it expected?
- The Expensify persona in message header changes to Expensify Concierge after few seconds.
Screenshots/Videos
MacOS: Chrome / Safari
Screen.Recording.2024-05-01.at.20.27.19.mov
Screen.Recording.2024-05-01.at.20.29.18.mov
src/libs/ReportUtils.ts
Outdated
@@ -4974,7 +4974,6 @@ function shouldReportBeInOptionList({ | |||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | |||
report?.isHidden || | |||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing |
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.
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing |
src/libs/actions/Report.ts
Outdated
const actorAccountID = PersonalDetailsUtils.getAccountIDsByLogins([targetEmail])[0]; | ||
const targetChatReport = ReportUtils.getChatByParticipants([actorAccountID]); | ||
// TODO: using getSystemChat is rather not necessary if we could have participants list filled correctly | ||
const targetChatReport = isAccountIDOdd ? ReportUtils.getSystemChat() : ReportUtils.getChatByParticipants([actorAccountID]); |
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.
Is this TODO within the scope of this PR?
src/libs/SidebarUtils.ts
Outdated
if (report.chatType === CONST.REPORT.CHAT_TYPE.SYSTEM) { | ||
participantAccountIDs = [report.ownerAccountID ?? 0, ...PersonalDetailsUtils.getAccountIDsByLogins([CONST.EMAIL.NOTIFICATIONS])]; | ||
} | ||
|
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.
Are we good to remove this block of code?
@sobitneupane the comments in the code addressed, checking these ones now |
@sobitneupane I dont think its expected that its not showing up, are you able to debug, it should be in LHN. the backend does return it correctly then? |
src/libs/ReportUtils.ts
Outdated
@@ -5274,8 +5274,6 @@ function shouldReportBeInOptionList({ | |||
report?.reportName === undefined || | |||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | |||
report?.isHidden || | |||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | |||
participantAccountIDs.includes(CONST.ACCOUNT_ID.NOTIFICATIONS) || |
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.
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 it was added here #32361 but now we can show it at least in the LHN. You should still not bae able to start a new chat with the [email protected] account
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.
Even when a user accountID is even, we show Expensify persona.
Screen.Recording.2024-06-10.at.15.01.09.mov
Do we want to show chat with Expensify persona only for the first time? Or do we want to always show it (even after user re-login the account)?
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.
@mountiny yeah, but even before my latest changes we had this account displayed when starting a new chat
Do we want to show chat with Expensify persona for the first time only? Do we want to always show it (even after user logs in to already active account)?
- and I also wonder what is expected behavior here? Should we show the Expensify persona chat for all the users?
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 the logic is that in the onboarding flow, some will get the tasks from Concierge and some from the Expensify persona.
It should only show the Expensify persona for those who have the onboarding flow added to the persona chat. Not for the others. I now realize this might be tricky cc @francoisl
yeah, but even before my latest changes we had this account displayed when starting a new chat
I think that is a bug and it should not show up in any of those lists
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.
[email protected] is visible even if I revert the latest changes, so I need to add a new filter.
For displaying the Expensify persona only for the users onboarded by persona - I still need to figure this out.
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.
@mountiny should this persona chat be always visible, or it should disappear at some point?
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.
is there any other situation that we want to hide this kind of chat
Users should not be able to create group chats with the system account, or invite it to existing rooms, workspaces, etc. For example, the "Add to group" button shouldn't appear here for the Expensify row (maybe we can look into that in a follow-up PR if that requires a lot of changes)
It should only show the Expensify persona for those who have the onboarding flow added to the persona chat. Not for the others. I now realize this might be tricky cc @francoisl
Yeah I don't think it's something we had considered originally. To be clear though, do you mean that EITHER Concierge or the system chat would remain sticky in the LHN when you're in "Most Recent" mode? Concierge is pinned by default (I unpinned it here to show that it remains in the LHN), but yes I think I agree that if the onboarding tasks are created in the Concierge chat, then it just adds extra noise in the LHN to also show the system DM, so it would make sense to hide it.
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.
Yeah I don't think it's something we had considered originally. To be clear though, do you mean that EITHER Concierge or the system chat would remain sticky in the LHN when you're in "Most Recent" mode? Concierge is pinned by default (I unpinned it here to show that it remains in the LHN), but yes I think I agree that if the onboarding tasks are created in the Concierge chat, then it just adds extra noise in the LHN to also show the system DM, so it would make sense to hide it.
I agree. I dont think the system chat should be pinned really though so it would only show in the Most Recent as in focus mode it would not be unread
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.
@mountiny @francoisl ok, so I added a logic to display Persona only for users onboarded this way. I agree with @francoisl - filtering [email protected] should be done in a follow-up, as it's something that is occurring on staging
@mountiny lint & typecheck fixed |
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.
Changes look good to me, asking if we can get the checklist soon
Reviewer Checklist
Screenshots/Videos@sobitneupane added above Android: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
Thanks @mountiny for completing the checklist. MacOS: Chrome / SafariScreen.Recording.2024-06-11.at.21.50.47.movScreen.Recording.2024-06-11.at.21.52.04.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.
Thanks! Looks good and works well.
@@ -5,4 +5,6 @@ import type {Account} from '@src/types/onyx'; | |||
const isValidateCodeFormSubmitting = (account: OnyxEntry<Account>) => | |||
!!account?.isLoading && account.loadingForm === (account.requiresTwoFactorAuth ? CONST.FORMS.VALIDATE_TFA_CODE_FORM : CONST.FORMS.VALIDATE_CODE_FORM); | |||
|
|||
export default {isValidateCodeFormSubmitting}; | |||
const isAccountIDOddNumber = (accountID: number) => accountID % 2 === 1; |
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.
NAB - this could be made a bit more generic as NumberUtils.isOdd(value: number)
✋ 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/francoisl in version: 1.4.82-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.82-4 🚀
|
Hi team, coming from this issue #43564. Because I don't have access to the design doc of this PR. Can anyone confirm if step 4 in the Test steps is our new expected behavior for all platforms?
Previously, when we only displayed onboarding information in the Concierge page, then in small screen devices(native, mWeb), we wouldn't redirect users to the Concierge page (user remains in LHN). (link to Stage 1 of Guided Setup design doc) Now with A/B testing Expensify DM, I think step 4 above makes sense. |
@@ -104,6 +105,12 @@ function getOrderedReportIDs( | |||
return false; | |||
} | |||
|
|||
const participantAccountIDs = Object.keys(report?.participants ?? {}).map(Number); | |||
|
|||
if (currentUserAccountID && AccountUtils.isAccountIDOddNumber(currentUserAccountID) && participantAccountIDs.includes(CONST.ACCOUNT_ID.NOTIFICATIONS)) { |
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 team, coming from #43782
This early return returns true
(displays in LHN) for all chats that have CONST.ACCOUNT_ID.NOTIFICATIONS
as a participant.
Domain chat room does have CONST.ACCOUNT_ID.NOTIFICATIONS
as a participant, but doesn't need to be displayed in focus mode, since there are no unread messages
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.
@eVoloshchak Should I fix it or you're going with someone's proposal?
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.
@koko57, I'm not entirely sure
On the one hand, this PR was deployed to prod 5 days ago, it's still in 7-day regression period, so it makes sense to fix it here
On the other hand, we've opened up the issue to contributors and have already received valid proposals
@twisterdotcom, could you weigh in on this please?
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.
@koko57 yes please, lets fix it, its still in the regression period
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.
@mountiny can you help me to check a question here #41343 (comment)? 🏆 |
@@ -5,4 +5,6 @@ import type {Account} from '@src/types/onyx'; | |||
const isValidateCodeFormSubmitting = (account: OnyxEntry<Account>) => | |||
!!account?.isLoading && account.loadingForm === (account.requiresTwoFactorAuth ? CONST.FORMS.VALIDATE_TFA_CODE_FORM : CONST.FORMS.VALIDATE_CODE_FORM); | |||
|
|||
export default {isValidateCodeFormSubmitting}; | |||
const isAccountIDOddNumber = (accountID: number) => accountID % 2 === 1; |
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.
Can we please move this to the permissions
file so that it is treated just like any of the other betas?
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.
Fair, I think we were not looking at this as a beta, but I can see where you are coming from. @koko57 do you think you could move this around to permissions file?
Details
Fixed Issues
$ #38774
PROPOSAL:
Tests
Offline tests
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 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
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)Design
label 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop
Screen.Recording.2024-04-30.at.17.32.02.mp4
Screen.Recording.2024-04-30.at.17.33.19.mp4