Skip to content
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

[$250] Add a more inviting sign-off from Concierge after our onboarding messages so it looks good in the LHN #51501

Open
jamesdeanexpensify opened this issue Oct 25, 2024 · 40 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@jamesdeanexpensify
Copy link
Contributor

jamesdeanexpensify commented Oct 25, 2024

Slack thread
https://expensify.slack.com/archives/C07HPDRELLD/p1729810967369919

Problem
For new users viewing the LHN, we draw attention to their Concierge chat with a GBR and "Get started here!" tooltip, which is great. However, the message preview from Concierge shows a task to complete depending on your onboarding intent selection. This is subjective, but it doesn't feel very welcoming/inviting, and also a bit strange and random.

Solution
Let's add a more inviting sign-off from Concierge after our onboarding messages (so it shows in the LHN message preview). It could be as simple as "It's great to meet you!"

Where I'm talking about
image (97)

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021850951668861078961
  • Upwork Job ID: 1850951668861078961
  • Last Price Increase: 2024-11-04
  • Automatic offers:
    • shubham1206agra | Contributor | 104743508
Issue OwnerCurrent Issue Owner: @jasperhuangg
@jamesdeanexpensify jamesdeanexpensify added Daily KSv2 Internal Requires API changes or must be handled by Expensify staff Planning Changes still in the thought process labels Oct 25, 2024
@jamesdeanexpensify jamesdeanexpensify self-assigned this Oct 25, 2024
@jamesdeanexpensify jamesdeanexpensify added Help Wanted Apply this label when an issue is open to proposals by contributors External Added to denote the issue can be worked on by a contributor Bug Something is broken. Auto assigns a BugZero manager. and removed Internal Requires API changes or must be handled by Expensify staff Planning Changes still in the thought process Help Wanted Apply this label when an issue is open to proposals by contributors labels Oct 25, 2024
@melvin-bot melvin-bot bot added the Overdue label Oct 28, 2024
@melvin-bot melvin-bot bot changed the title Add a more inviting sign-off from Concierge after our onboarding messages so it looks good in the LHN [$250] Add a more inviting sign-off from Concierge after our onboarding messages so it looks good in the LHN Oct 28, 2024
Copy link

melvin-bot bot commented Oct 28, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021850951668861078961

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 28, 2024
Copy link

melvin-bot bot commented Oct 28, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @situchan (External)

Copy link

melvin-bot bot commented Oct 28, 2024

Triggered auto assignment to @lschurr (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@Anaslancer
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Add a more inviting sign-off from Concierge after our onboarding messages so it looks good in the LHN

What is the root cause of that problem?

There is no converting feature for greetings message instead of "task for ... ".

What changes do you think we should make in order to solve the problem?

What alternative solutions did you explore? (Optional)

N/A

Contributor details

Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01aff093c9a804b145

Copy link

melvin-bot bot commented Oct 28, 2024

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@jamesdeanexpensify
Copy link
Contributor Author

jamesdeanexpensify commented Oct 28, 2024

As additional info - You can see that, depending on which onboarding intent you select, there are various types of messages that finish with a task (or text) that we'll need to update by adding the sign-off "It's great to meet you!":

2024-10-28_15-05-14.mp4
2024-10-28_15-06-41.mp4
2024-10-28_15-08-42.mp4

(Note: the fourth option, "Chat and split expenses with friends," currently has a bug that's being addressed so we can leave that alone for now)

2024-10-28_15-10-33.mp4

@MuaazArshad
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

A non-inviting sign-off from Concierge after our onboarding messages

What is the root cause of that problem?

We're treating Concierge as a standard chat by generating its most recent message based on recent activity, while also considering the first message as part of its activity history.

What changes do you think we should make in order to solve the problem?

We should add a separate condition for Concierge. We can add it like

if(result.isConciergeChat && lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT) {
            result.alternateText = "It's great to meet you!";
        } 

Surely after taking care of the translation. Before this line

result.alternateText =
(ReportUtils.isGroupChat(report) || ReportUtils.isDeprecatedGroupDM(report)) && lastActorDisplayName
? ReportUtils.formatReportLastMessageText(Parser.htmlToText(`${lastActorDisplayName}: ${lastMessageText}`))
: ReportUtils.formatReportLastMessageText(Parser.htmlToText(lastMessageText)) || formattedLogin;

What alternative solutions did you explore? (Optional)

@Anaslancer
Copy link
Contributor

@jamesdeanexpensify Yes, I can handle it. We can add these lines at the SidebarUtils.ts.

import type * as OnyxTypes from '@src/types/onyx';

let introSelected: OnyxEntry<OnyxTypes.IntroSelected>;   // for getting what user selected on onboarding
Onyx.connect({
    key: ONYXKEYS.NVP_INTRO_SELECTED,
    callback: (value) => (introSelected = value),
});

And add this code below line 428

let lastMessageText = Str.removeSMSDomain(lastMessageTextFromReport);

    let onboardingPurpose = introSelected?.choice;
    if (onboardingPurpose) {
        const onboardingMessages: ValueOf<typeof CONST.ONBOARDING_MESSAGES> = CONST.ONBOARDING_MESSAGES[onboardingPurpose];
        const tasks = onboardingMessages.tasks;
        const comparingText = tasks.length ? `task for ${tasks.slice(-1)[0].title}` : onboardingMessages.message;
        
        if (lastMessageText == comparingText) {
            lastMessageText = "It's great to meet you!";
        }
    }

Then we can see these videos with a greetings message. but we should add the "It's great to meet you!" in the en.ts and es.ts files.

@Anaslancer
Copy link
Contributor

Get.Employee.mp4
Manage.Team.mp4
Track.Expense.mp4

@lschurr
Copy link
Contributor

lschurr commented Oct 29, 2024

@situchan can you review the proposals here?

@situchan
Copy link
Contributor

I don't like any of the proposed solutions so far. They will cause regressions when user sends any message to Concierge chat.
Greetings message should show in LHN only when there's only onboarding task, no other report actions.

@Anaslancer
Copy link
Contributor

Anaslancer commented Oct 29, 2024

@situchan I just changed the condition.

    const accountID = session?.accountID;
    let onboardingPurpose = introSelected?.choice;
    if (onboardingPurpose && result.isConciergeChat && report.lastActorAccountID != accountID) {
        const onboardingMessages: ValueOf<typeof CONST.ONBOARDING_MESSAGES> = CONST.ONBOARDING_MESSAGES[onboardingPurpose];
        const tasks = onboardingMessages.tasks;
        const comparingText = tasks.length ? `task for ${tasks.slice(-1)[0].title}` : onboardingMessages.message;
        
        if (lastMessageText.substring(0, 20) == comparingText.substring(0, 20)) {
            lastMessageText = "It's great to meet you!";
        }
    }

result.isConciergeChat : for detecting if Concierge chat
report.lastActorAccountID != accountID : in Concierge chat, for detecting if reported user is a logged in user.

@Anaslancer
Copy link
Contributor

Screenshot_4

@situchan
Copy link
Contributor

I think we should show It's great to meet you! message only when report meets these conditions:

  • concierge chat
  • there are no report actions whose actorAcountID is not 8392101 (concierge account id)
  • last visible report action's childType = task
  • there are no other report actions whose childType = task

This guarantees that user just finished onboarding after sign up.
@jamesdeanexpensify @jasperhuangg What do you think?

@ugogiordano
Copy link

@situchan, I believe your third point is covered by point four. Instead, you can simply check if there is at least one report with a child type of 'task.' If so, it indicates that the user has not completed the onboarding tasks.

So, if i understood correctly, you mean something like this:

    if (optionItem?.isConciergeChat && isOnboardingCompleted && ReportActionsUtils.areOnboardingTasksCompleted(optionItem.reportID)) {
        optionItem.alternateText = translate('onboarding.welcomeSignOffTitle');
    }
function areOnboardingTasksCompleted(reportID: string): boolean {
    const reportActions = Object.values(allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`] ?? {});
    const areAllReportActionsFromConcierge = reportActions.every((ra) => ra.actorAccountID === CONST.ACCOUNT_ID.CONCIERGE);
    const hasPendingTasks = reportActions.some((ra) => ra.childType === CONST.REPORT.TYPE.TASK);
    return areAllReportActionsFromConcierge && !hasPendingTasks;
}

@Anaslancer
Copy link
Contributor

@situchan I don't think your conditions(3 and 4) are correct, because when a user select an last item ("Something else") on the onboarding, I think that is not a task.

last visible report action's childType = task
there are no other report actions whose childType = task

And I checked the conditions (1 and 2)

if (onboardingPurpose && result.isConciergeChat && report.lastActorAccountID != accountID) {

@situchan
Copy link
Contributor

@situchan I don't think your conditions(3 and 4) are correct, because when a user select an last item ("Something else") on the onboarding, I think that is not a task.

Should we still show welcome message even when nothing shows?

@Anaslancer
Copy link
Contributor

Anaslancer commented Oct 31, 2024

@situchan I think yes, according to this;
#51501 (comment)
Please check the last video.

@situchan
Copy link
Contributor

@jamesdeanexpensify can you please confirm #51501 (comment)?

Copy link

melvin-bot bot commented Nov 4, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Nov 4, 2024
@jamesdeanexpensify
Copy link
Contributor Author

@situchan I think if they choose "Something else" as the onboarding option, we can still end that message with "It's great to meet you!" It makes sense to me.

Copy link

melvin-bot bot commented Nov 4, 2024

@jamesdeanexpensify, @jasperhuangg, @lschurr, @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@jasperhuangg
Copy link
Contributor

Mostly OOO today because I hurt my foot and I'm at the hospital getting it checked out.

@situchan Are the next steps here to wait for a proposal that aligns with the clarified requirements?

@situchan
Copy link
Contributor

situchan commented Nov 4, 2024

I will be OOO soon so it's better to reassign C+ since I won't be available by the time the PR will be up

@melvin-bot melvin-bot bot removed the Overdue label Nov 4, 2024
@situchan situchan removed their assignment Nov 4, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 5, 2024
Copy link

melvin-bot bot commented Nov 5, 2024

📣 @shubham1206agra 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@shubham1206agra
Copy link
Contributor

@jamesdeanexpensify @jasperhuangg Can we just simply hide the task messages in Concierge chat in LHN?
It will now show Welcome to Expensify as alternative text.

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 5, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Add a more inviting sign-off from Concierge after our onboarding messages so it looks good in the LHN

What is the root cause of that problem?

} else if (ReportActionUtils.isCreatedTaskReportAction(lastReportAction)) {
lastMessageTextFromReport = TaskUtils.getTaskCreatedMessage(lastReportAction);
} else if (
ReportActionUtils.isActionOfType(lastReportAction, CONST.REPORT.ACTIONS.TYPE.SUBMITTED) ||
ReportActionUtils.isActionOfType(lastReportAction, CONST.REPORT.ACTIONS.TYPE.SUBMITTED_AND_CLOSED)
) {

We display the task message as alternative text in LHN if the last action is the created task report.

What changes do you think we should make in order to solve the problem?

  1. Create a new translation key for It's great to meet you! message

  2. If the report is the concierge chat and the created task action is the onboarding task, we will return It's great to meet you! message or the welcome message text for concierge chat

else if (ReportActionUtils.isCreatedTaskReportAction(lastReportAction)) {
    if (ReportUtils.isConciergeChatReport(report) && Object.values(introSelected ?? {}).includes(lastReportAction?.childReportID ?? '-1')) {
        lastMessageTextFromReport = Localize.translateLocal(newTranslationKey); // newTranslationKey is the new translation key for `It's great to meet you!` message
    } else {
        lastMessageTextFromReport = TaskUtils.getTaskCreatedMessage(lastReportAction);
    }
}

} else if (ReportActionUtils.isCreatedTaskReportAction(lastReportAction)) {
lastMessageTextFromReport = TaskUtils.getTaskCreatedMessage(lastReportAction);
} else if (
ReportActionUtils.isActionOfType(lastReportAction, CONST.REPORT.ACTIONS.TYPE.SUBMITTED) ||
ReportActionUtils.isActionOfType(lastReportAction, CONST.REPORT.ACTIONS.TYPE.SUBMITTED_AND_CLOSED)
) {

Or if we want to always show this message in LHN for concierge chat we can add a case in getLastMessageTextForReport function to return early if the report is concierge chat

else if (ReportUtils.isConciergeChatReport(report)) {
    lastMessageTextFromReport = Localize.translateLocal(newTranslationKey);
}

What alternative solutions did you explore? (Optional)

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 5, 2024

@jamesdeanexpensify When do we want to show the It's great to meet you! message in LHN?

  1. Always
  2. Only show it if the last action in the concierge chat is the onboarding task

@jamesdeanexpensify
Copy link
Contributor Author

Oh this might actually work! Every new account gets that message regardless.

@Anaslancer
Copy link
Contributor

@jamesdeanexpensify My proposal works for every onboarding tasks.
And I attached all videos

@shubham1206agra
Copy link
Contributor

Waiting for @jasperhuangg confirmation on #51501 (comment)

@melvin-bot melvin-bot bot added the Overdue label Nov 11, 2024
Copy link

melvin-bot bot commented Nov 11, 2024

@jamesdeanexpensify, @jasperhuangg, @lschurr, @shubham1206agra Huh... This is 4 days overdue. Who can take care of this?

@shubham1206agra
Copy link
Contributor

Waiting for @jasperhuangg confirmation on #51501 (comment)

@jasperhuangg
Copy link
Contributor

Sorry for the late response! Yeah I think that would work, I don't see why hiding the task messages would hinder anything. We can catch any weirdness in the PR with thorough testing.

@melvin-bot melvin-bot bot removed the Overdue label Nov 12, 2024
@shubham1206agra
Copy link
Contributor

Please adjust the logic everyone.

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 14, 2024

@shubham1206agra Although we can hide the task message in LHN, what is the message that we want to show in this LHN? Because after the onboarding is complete, we have other actions before the task action.

Screenshot 2024-11-14 at 14 58 19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
Status: No status
Development

No branches or pull requests

9 participants