Skip to content

Show employee size sub-selection (1-4, 5-10) for VSB qualifier users#91748

Open
MelvinBot wants to merge 22 commits into
mainfrom
claude-vsbEmployeeSizeSubselection
Open

Show employee size sub-selection (1-4, 5-10) for VSB qualifier users#91748
MelvinBot wants to merge 22 commits into
mainfrom
claude-vsbEmployeeSizeSubselection

Conversation

@MelvinBot
Copy link
Copy Markdown
Contributor

@MelvinBot MelvinBot commented May 26, 2026

Explanation of Change

When users select the "1-9 employees" option on the Web-Expensify landing page (which sets the vsb signup qualifier), the onboarding flow previously skipped the employee count step entirely and auto-assigned MICRO (1-10) as their company size. This meant we couldn't distinguish between 1-4 and 5-10 employee teams for guide assignment purposes.

This PR changes the VSB flow so that instead of skipping the employee count step, users are shown a filtered employee size selection page with only two options: 1-4 and 5-10. This gives us the granularity needed for proper guide assignment (1-4 → Concierge, 5-10 → human Guide) without requiring any changes to the Web-Expensify landing page.

Changes:

  • OnboardingFlow.ts: Stop auto-setting companySize to MICRO for VSB users; route them to the EMPLOYEES page instead of ACCOUNTING
  • BaseOnboardingEmployees.tsx: Filter company size options to only show 1-4 and 5-10 for VSB-qualified users
  • getOnboardingStepCounter.ts: Add EMPLOYEES to the VSB step counter sequence so progress bar is accurate
  • BaseOnboardingAccounting.tsx: Show back button on accounting page for VSB users (since they now go through EMPLOYEES first); remove unused isVsb variable

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/613539

Tests

  1. Ensure you are signed out of New and Classic Expensify
  2. Go to expensify.com.dev, enter a new email, and choose the 1-9 employees option on the landing page, then sign up
  3. Verify you are redirected to New Expensify
  4. Verify the onboarding modal appears
  5. Proceed until you reach the company size page
  6. Verify the only two options are 1-4 and 5-10
  7. Select one
  8. Verify the accounting page is shown next
2026-05-27_07-23-06.mp4
  • Verify that no errors appear in the JS console

Offline tests

No offline-specific behavior changes — signup qualifiers are written during online signup and read from the locally-cached onboarding NVP afterwards.

QA Steps

Same as tests but on staging

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

The changes are platform independent. Please see the testing video above.

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

When users select the 1-9 employee bracket on the Web-Expensify
landing page (VSB signup qualifier), instead of skipping the
employee count step, route them to a filtered employees page
showing only 1-4 and 5-10 options.

Changes:
- Stop auto-setting companySize to MICRO for VSB users
- Route VSB users to EMPLOYEES page instead of ACCOUNTING
- Filter company size options to only 1-4 and 5-10 for VSB
- Add EMPLOYEES to VSB step counter sequence
- Show back button on accounting page for VSB users
- Hide back button on employees page for VSB users (first step)

Co-authored-by: Neil Marcellini <neil-marcellini@users.noreply.github.com>
@MelvinBot MelvinBot requested a review from a team May 26, 2026 18:28
Co-authored-by: Neil Marcellini <neil-marcellini@users.noreply.github.com>
@MelvinBot
Copy link
Copy Markdown
Contributor Author

Fixed the failing checks. The tests in OnboardingFlowTest.ts and getOnboardingStepCounterTest.ts were still expecting the old VSB flow (without the EMPLOYEES step). Updated them to include EMPLOYEES in the VSB onboarding sequence, matching the implementation changes in this PR.

Both test files now pass locally (71 tests total).

Co-authored-by: Neil Marcellini <neil-marcellini@users.noreply.github.com>
@MelvinBot
Copy link
Copy Markdown
Contributor Author

Fixed the failing ESLint check: removed the unused onboarding variable from BaseOnboardingAccounting.tsx (it was left behind after isVsb was removed).

@MelvinBot
Copy link
Copy Markdown
Contributor Author

The two failing checks (ESLint + Jest) were already fixed in the latest commits:

  • e2bb0d8: Updated test expectations to include the EMPLOYEES step in VSB onboarding flows (fixes 5 Jest failures)
  • c160a67: Removed unused onboarding variable from BaseOnboardingAccounting.tsx (fixes ESLint error)

ESLint is already passing on the latest run. Jest tests are still in progress and should pass with the updated expectations.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
...Navigation/helpers/getOnboardingRouteFromScreen.ts 100.00% <100.00%> (ø)
src/libs/actions/Welcome/OnboardingFlow.ts 76.19% <100.00%> (-0.23%) ⬇️
.../OnboardingAccounting/BaseOnboardingAccounting.tsx 1.81% <ø> (+0.09%) ⬆️
...es/OnboardingWorkEmail/BaseOnboardingWorkEmail.tsx 79.16% <100.00%> (+0.78%) ⬆️
...ilValidation/BaseOnboardingWorkEmailValidation.tsx 95.23% <100.00%> (+2.05%) ⬆️
.../OnboardingWorkspaces/BaseOnboardingWorkspaces.tsx 97.36% <100.00%> (-0.07%) ⬇️
src/libs/getOnboardingStepCounter.ts 96.72% <83.33%> (-3.28%) ⬇️
...rdingPrivateDomain/BaseOnboardingPrivateDomain.tsx 0.00% <0.00%> (ø)
...es/OnboardingEmployees/BaseOnboardingEmployees.tsx 90.74% <86.36%> (-3.20%) ⬇️
... and 21 files with indirect coverage changes

neil-marcellini and others added 6 commits May 27, 2026 06:58
Force VSB/SMB users back to the employees step when they resume without
a valid company size, and surface an error on More Features instead of
silently ignoring Continue.

Co-authored-by: Cursor <cursoragent@cursor.com>
Private domain and workspaces flows still sent VSB users directly to
accounting after the name step, skipping the new 1-4 / 5-10 selection.

Co-authored-by: Cursor <cursoragent@cursor.com>
Navigation fixes in upstream onboarding pages already route VSB/SMB
users through the employees step, so page-level redirects and error UI
are unnecessary.

Co-authored-by: Cursor <cursoragent@cursor.com>
Only redirect to the employees step when resuming at accounting or
interested-features without a valid company size, or on a fresh start
without accessible domain policies.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Neil Marcellini <neil-marcellini@users.noreply.github.com>
@MelvinBot
Copy link
Copy Markdown
Contributor Author

The TypeScript and ESLint failures were already fixed by commits after 78d3ddd6. CI just didn't re-run those checks. I pushed an empty commit to retrigger all CI checks.

The iOS build failure was unrelated (CocoaPods CDN rate limiting — 429 Too Many Requests).

neil-marcellini and others added 6 commits May 27, 2026 07:28
Replace nested redirect helpers with small named checks for company size
need, fresh start, and steps past employees.

Co-authored-by: Cursor <cursoragent@cursor.com>
Revert to main's simple initial path logic; VSB now routes to employees
instead of accounting since company size is no longer auto-assigned.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Neil Marcellini <neil-marcellini@users.noreply.github.com>
Use the onboarding step counter instead of the VSB signup qualifier so
users with a domain prefix still see the back button.

Co-authored-by: Cursor <cursoragent@cursor.com>
…B users

The test expected VSB skip to navigate to onboarding/accounting, but the
PR intentionally changed this flow to navigate to onboarding/employees
(matching the SMB behavior) for employee size sub-selection.

Co-authored-by: Neil Marcellini <neil-marcellini@users.noreply.github.com>
…om/Expensify/App into claude-vsbEmployeeSizeSubselection

Co-authored-by: Neil Marcellini <neil-marcellini@users.noreply.github.com>
@MelvinBot
Copy link
Copy Markdown
Contributor Author

⏱️ Ran out of time before I could finish. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in #melvinbot-ai.

Run details

neil-marcellini and others added 2 commits May 27, 2026 08:11
Cover the VSB-only company size options and back button visibility when
employees is or is not the first step in the onboarding flow.

Co-authored-by: Cursor <cursoragent@cursor.com>
@neil-marcellini neil-marcellini marked this pull request as ready for review May 27, 2026 15:25
@neil-marcellini neil-marcellini requested a review from a team as a code owner May 27, 2026 15:25
@melvin-bot melvin-bot Bot requested review from jjcoffee and trjExpensify and removed request for a team May 27, 2026 15:25
@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented May 27, 2026

@jjcoffee 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]

@melvin-bot melvin-bot Bot removed the request for review from a team May 27, 2026 15:25
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 88333a01dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/pages/OnboardingEmployees/BaseOnboardingEmployees.tsx
trjExpensify
trjExpensify previously approved these changes May 27, 2026
Copy link
Copy Markdown
Contributor

@trjExpensify trjExpensify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recall this one coming up in slack! 👍

Use getPreviousOnboardingRoute so VSB/SMB flows navigate to workspaces,
work email, or purpose instead of always going to the purpose screen.

Co-authored-by: Cursor <cursoragent@cursor.com>
@neil-marcellini neil-marcellini requested a review from a team as a code owner May 27, 2026 15:37
@melvin-bot melvin-bot Bot requested review from Eskalifer1 and removed request for a team May 27, 2026 15:37
@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented May 27, 2026

@Eskalifer1 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]

@Eskalifer1
Copy link
Copy Markdown
Contributor

It seems like I'm the second C+ assigned here. Please unassign me. Thank you!

Co-authored-by: Neil Marcellini <neil-marcellini@users.noreply.github.com>
@MelvinBot
Copy link
Copy Markdown
Contributor Author

Fixed the failing typecheck: getPreviousOnboardingRoute was returning string but Navigation.navigate() expects a Route. Updated the return type of getPreviousOnboardingRoute and the onboardingScreenRoutes record to use Route instead of string.

neil-marcellini and others added 3 commits May 27, 2026 08:50
Use normalizedConfigs paths so back navigation stays in sync with the navigation system.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The function returns paths from the linking config which are valid
routes, so cast them to Route to satisfy Navigation.navigate's type
requirement.

Co-authored-by: Neil Marcellini <neil-marcellini@users.noreply.github.com>
@MelvinBot
Copy link
Copy Markdown
Contributor Author

Fixed the failing typecheck: getOnboardingRouteFromScreen and getPreviousOnboardingRoute were returning string | undefined instead of Route | undefined, which caused a TS2345 error when passing the result to Navigation.navigate(). Updated both return types to Route with appropriate casts since the paths come from the linking config.

@MelvinBot
Copy link
Copy Markdown
Contributor Author

All checks are now passing. The previous typecheck failure was resolved by the latest commit on this branch which properly types the getOnboardingRouteFromScreen return value as Route.

@neil-marcellini neil-marcellini removed the request for review from Eskalifer1 May 27, 2026 16:28
@jjcoffee
Copy link
Copy Markdown
Contributor

Go to expensify.com.dev, enter a new email, and choose the 1-9 employees option on the landing page, then sign up

@neil-marcellini Is there any way for me to test this step? As far as I know C+s can't run Web-Expensify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants