Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.52k stars 2.87k forks source link

[$250] Skip onboarding screen with company size if signupQualifier is VSB #51750

Open carlosmiceli opened 5 days ago

carlosmiceli commented 5 days ago

When signing up as a company between 1-9 employees, the user is redirected to New Expensify and is welcomed by the onboarding flow. However the first thing we ask them after they open new expensify, is how big a company they want to set up. This is redundant and makes for a bad first impression.

Let's select 1-10 employees by default for signups with the 'vsb' signnpQualifier NVP and start the onboarding flow in the accounting software section. Let's also make sure that whatever logic is triggered by selecting 1-10 also occurs (before displaying the onboarding modal) for these signups.

Select this: Screenshot 2024-10-30 at 12 48 09 PM

Skip this screen (but keep the choice logic): Screenshot 2024-10-30 at 1 23 29 PM

This should be the first screen they see in the modal: Screenshot 2024-10-30 at 1 25 44 PM

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021851663004588841867
  • Upwork Job ID: 1851663004588841867
  • Last Price Increase: 2024-10-30
  • Automatic offers:
    • nkdengineer | Contributor | 104676448
Issue OwnerCurrent Issue Owner: @jayeshmangwani
melvin-bot[bot] commented 5 days ago

Triggered auto assignment to @greg-schroeder (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.

melvin-bot[bot] commented 5 days ago

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

melvin-bot[bot] commented 5 days ago

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

melvin-bot[bot] commented 5 days ago

Current assignee @greg-schroeder is eligible for the Bug assigner, not assigning anyone new.

Shahidullah-Muffakir commented 5 days ago

Proposal

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

if user selected company size in the OD, we are still showing the company size selecting modal in the onboarding flow

What is the root cause of that problem?

improvement

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

change this: https://github.com/Expensify/App/blob/084b1047e8f090a63eb4eb99ab89d13f267bbe8b/src/libs/actions/Welcome/OnboardingFlow.ts#L58C4-L61C6 to this:

  if (isVsb) {
        Onyx.set(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
        Welcome.setOnboardingCompanySize(onboardingCompanySize.MICRO);

        return `/${ONBOARDING_ACCOUNTING.route}`;
    }
nkdengineer commented 5 days ago

Proposal

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

Skip onboarding screen with company size if signupQualifier is VSB

What is the root cause of that problem?

This is an improvement

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

If it's vsb, we should return the onboarding accounting route and set the companySizeas 1-10 and we also need to create a new WS if the onboardingPolicyID doesn't exist

if (isVsb) {
    Onyx.set(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
    Onyx.set(ONYXKEYS.ONBOARDING_COMPANY_SIZE, CONST.ONBOARDING_COMPANY_SIZE.MICRO);
    if (!onboardingPolicyID) {
          const {adminsChatReportID, policyID} = Policy.createWorkspace(undefined, true, '', Policy.generatePolicyID(), CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
          Welcome.setOnboardingAdminsChatReportID(adminsChatReportID);
          Welcome.setOnboardingPolicyID(policyID);
      }
    return `/${ROUTES.ONBOARDING_ACCOUNTING.route}`;
}

https://github.com/Expensify/App/blob/1adb6c661cfd71f0d7bac082c4a372793083c704/src/libs/actions/Welcome/OnboardingFlow.ts#L58

OPTIONAL: We can move the logic creating the WS to the accounting page if onboardingPolicyID doesn't exist.

What alternative solutions did you explore? (Optional)

twilight2294 commented 5 days ago

Edited by proposal-police: This proposal was edited at 2024-10-30 18:22:10 UTC.

Proposal

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

Skip onboarding screen with company size if signupQualifier is VSB

What is the root cause of that problem?

Feature request

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

We need to update the code below here to:

    if (isVsb) {
        Onyx.set(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
        Onyx.set(ONYXKEYS.ONBOARDING_COMPANY_SIZE, CONST.ONBOARDING_COMPANY_SIZE.MICRO);
            if (!onboardingPolicyID) {
          const {adminsChatReportID, policyID} = Policy.createWorkspace(undefined, true, '', Policy.generatePolicyID(), CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
          Welcome.setOnboardingAdminsChatReportID(adminsChatReportID);
          Welcome.setOnboardingPolicyID(policyID);
      }
        return `/${ROUTES.ONBOARDING_ACCOUNTING.route}`;
    }

This will set the company size and also create the workspace.

Note that this change is not enough, we should also hide the back button on the accounting page if we have already selected this as the user shouldn't be able to change the employee count if she is the VSB, so here:


// we can improve this condition during PR phase as well
    const isVsbOnboarding = Array.isArray(onboardingValues) ? false : onboardingValues?.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.VSB;

            <HeaderWithBackButton
                shouldShowBackButton={isVsbOnboarding}

What alternative solutions did you explore? (Optional)

Note that we cannot use Welcome.setOnboardingAdminsChatReportID or Welcome.setOnboardingPolicyID because it will cause a cyclic dependency error with our CI check, so we need to use Onyx directly here:

    if (isVsb) {
        Onyx.set(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
        Onyx.set(ONYXKEYS.ONBOARDING_COMPANY_SIZE, CONST.ONBOARDING_COMPANY_SIZE.MICRO);
            if (!onboardingPolicyID) {
          const {adminsChatReportID, policyID} = Policy.createWorkspace(undefined, true, '', Policy.generatePolicyID(), CONST.ONBOARDING_CHOICES.MANAGE_TEAM);

    Onyx.set(ONYXKEYS.ONBOARDING_ADMINS_CHAT_REPORT_ID, adminsChatReportID ?? null);    
    Onyx.set(ONYXKEYS.ONBOARDING_POLICY_ID, policyID ?? null);
      }
        return `/${ROUTES.ONBOARDING_ACCOUNTING.route}`;
    }

onboardingPolicyID will be fetched using Onyx.connect

mzdev0 commented 5 days ago

Proposal

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

Skip onboarding screen with company size if signupQualifier is VSB

What is the root cause of that problem?

improvement

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

we need to change the code here: https://github.com/Expensify/App/blob/1adb6c661cfd71f0d7bac082c4a372793083c704/src/libs/actions/Welcome/OnboardingFlow.ts#L54-L61

if (isVsb) {
    Onyx.set(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
    Onyx.set(ONYXKEYS.ONBOARDING_COMPANY_SIZE, CONST.ONBOARDING_COMPANY_SIZE.MICRO);
    if (!onboardingPolicyID) {
          const {adminsChatReportID, policyID} = Policy.createWorkspace(undefined, true, '', Policy.generatePolicyID(), CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
          Welcome.setOnboardingAdminsChatReportID(adminsChatReportID);
          Welcome.setOnboardingPolicyID(policyID);
      }
    return `/${ROUTES.ONBOARDING_ACCOUNTING.route}`;
}

and then remove the employee selection from here: https://github.com/Expensify/App/blob/47b8525756602b794e88d1e9fc5e3aef04689c1d/src/libs/Navigation/AppNavigator/Navigators/OnboardingModalNavigator.tsx#L55-L58

What alternative solutions did you explore? (Optional)

melvin-bot[bot] commented 5 days ago

📣 @mzdev0! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
mzdev0 commented 5 days ago

Contributor details Your Expensify account email: muazsync@gmail.com Upwork Profile Link: https://www.upwork.com/freelancers/~01e4f874aa627a77c4

melvin-bot[bot] commented 5 days ago

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

D-01576 commented 4 days ago

Proposal

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

The current onboarding flow for users with signupQualifier set to VSB includes a screen to select company size, which we want to skip.

What is the root cause of that problem?

The onboarding flow does not bypass the company size selection screen for VSB users, which creates an unnecessary step.

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

If isVsb is true, we should:

  1. Set the OnboardingPurposeSelected to Manage Team.
  2. Set the OnboardingCompanySize to Micro.
  3. Create a new Workspace if onboardingPolicyID is not set.

The updated code block from lines 58 to 61 should look like this:

if (isVsb) {
    Onyx.set(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
    Welcome.setOnboardingCompanySize(CONST.ONBOARDING_COMPANY_SIZE.MICRO);
    if (!onboardingPolicyID) {
        const {adminsChatReportID, policyID} = Policy.createWorkspace(
            undefined,
            true,
            '',
            Policy.generatePolicyID(),
            CONST.ONBOARDING_CHOICES.MANAGE_TEAM
        );
        Welcome.setOnboardingAdminsChatReportID(adminsChatReportID);
        Welcome.setOnboardingPolicyID(policyID);
    }
    return `/${ROUTES.ONBOARDING_ACCOUNTING.route}`;
}

What alternative solutions did you explore? (Optional)

jayeshmangwani commented 4 days ago

@carlosmiceli 'Help Wanted' label was removed here—I assume this was a mistake and that we want this issue fixed by an external contributor?

jayeshmangwani commented 4 days ago

@D-01576 How does your proposal differ from the ones above https://github.com/Expensify/App/issues/51750#issuecomment-2447954731 and https://github.com/Expensify/App/issues/51750#issuecomment-2447974007?

jayeshmangwani commented 4 days ago

We cannot remove the page entirely, as we still need it for users who aren’t coming from OD

@mzdev0 We cannot remove the page entirely, as we still need it for users who aren’t coming from OD

jayeshmangwani commented 4 days ago

@Shahidullah-Muffakir Thanks for the proposal! You’ve suggested to update the company size here, but you should have also included the workspace creation aspect as well.

jayeshmangwani commented 4 days ago

Note that this change is not enough, we should also hide the back button on the accounting page if we have already selected this as the user shouldn't be able to change the employee count if she is the VSB

@twilight2294 I feel that this is a thing that can be done in the PR and would have been caught when testing, so I feel that @nkdengineer Proposal is sufficient here

jayeshmangwani commented 4 days ago

We can go with @nkdengineer’s proposal here.

🎀 👀 🎀 C+ reviewed

melvin-bot[bot] commented 4 days ago

Current assignee @carlosmiceli is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

twilight2294 commented 4 days ago

I don’t think so, in the rush of writing proposals and posting them first these important points are missed!

and also he missed the point to hide the back button which is important!

On Thu, Oct 31, 2024 at 2:54 PM Jayesh Mangwani @.***> wrote:

Note that this change is not enough, we should also hide the back button on the accounting page if we have already selected this as the user shouldn't be able to change the employee count if she is the VSB

@twilight2294 https://github.com/twilight2294 I feel that this is a thing that can be done in the PR and would have been caught when testing, so I feel that @nkdengineer https://github.com/nkdengineer Proposal is sufficient here

— Reply to this email directly, view it on GitHub https://github.com/Expensify/App/issues/51750#issuecomment-2449402279, or unsubscribe https://github.com/notifications/unsubscribe-auth/BLXFUO6MEOWGG3I2XRWO6O3Z6HZMNAVCNFSM6AAAAABQ4QQEDKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBZGQYDEMRXHE . You are receiving this because you were mentioned.Message ID: @.***>

jayeshmangwani commented 4 days ago

Whatever! I don’t think this needs to be in the proposal

nkdengineer commented 4 days ago

Currently, as expected by the OP and the current behavior, the back button still displays and it isn't the main problem of this issue.

Screenshot 2024-10-31 at 17 13 54 Screenshot 2024-10-31 at 17 13 44
melvin-bot[bot] commented 4 days ago

📣 @nkdengineer 🎉 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 📖

carlosmiceli commented 4 days ago

@mallenexpensify I'd like your input here, because while @twilight2294's proposal wasn't selected, he did help us realize that the Back button should be hidden (and I brought it up to the team in Slack thanks to his suggestion here). I'm thinking that there should be either some compensation for helping us pick that up, or once I create an issue for it (waiting for confirmation that I should), maybe we can give prioritize his proposal for that issue (assuming it works)?

carlosmiceli commented 4 days ago

Ok, scratch that Matt, we've decided not to hide the back button so there won't be any extra work/value there.

anmurali commented 2 hours ago

@nkdengineer @carlosmiceli - I want to confirm that we're actually auto selecting 1-10 in the How many employees do you have step and going directly to the accounting step. In other words, we're still storing introSelected.companySize : "1-10" right?

carlosmiceli commented 1 hour ago

Yup! We're setting that value as well.