Skip to content

[Payment due @abzokhattab] Add the join-workspace onboarding intent and Concierge follow up tasks - #103652

Open
carlosmiceli wants to merge 8 commits into
mainfrom
restore-join-workspace-onboarding
Open

carlosmiceli wants to merge 8 commits into
mainfrom
restore-join-workspace-onboarding

Conversation

@carlosmiceli

Copy link
Copy Markdown
Contributor

Explanation of Change

Adds a Join my company workspace onboarding intent. Public-email accounts add a work email, unvalidated private-domain accounts validate their email, and validated private-domain accounts see joinable workspaces.

When a user skips a step, Concierge creates the matching Add your work email, Validate your email, or Join your company's workspace task. Opening and completing a task resumes the sequence. When no workspace is available, Concierge posts an explanation instead of another task.

Depends on:

Fixed Issues

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

PROPOSAL:

Tests

Test 1 - Complete joining a workspace during onboarding

  1. Sign up with a private-domain account with a joinable workspace.
  2. Start onboarding and select Join my company workspace.
  3. Verify the joinable-workspaces list opens directly.
  4. Tap Join now and verify onboarding completes.
  5. Verify the account becomes a workspace member.
  6. Verify there are no Concierge tasks created.
Screen.Recording.2026-09-17.at.10.43.36.AM.mov

Test 2 - Start from the Add your work email Concierge task

  1. Sign up with a public email.
  2. Select Join my company workspace.
  3. On What's your work email?, tap Skip and complete onboarding.
  4. Open Concierge and verify exactly one Add your work email task appears.
  5. Open the task, then select the Add work email link in its description.
  6. Enter a new private-domain email, and tap Add work email.
  7. Enter the validation code sent to that address.
  8. Verify the task completes, the workspace list opens, and you can successfully join a workspace.
Screen.Recording.2026-09-17.at.10.45.07.AM.mov

Test 3 - Start from the Validate your email Concierge task

  1. Sign up with a public email.
  2. Select Join my company workspace.
  3. Verify the email-validation screen opens without another work-email prompt.
  4. Tap Skip and complete onboarding.
  5. Open Concierge and verify exactly one Validate your email task appears.
  6. Open the task, then select Validate your account in its description.
  7. Validate the account.
  8. Verify the task completes and the workspace list opens.
Screen.Recording.2026-09-17.at.10.46.26.AM.mov

Test 4 - Start from the Join your company's workspace Concierge task

  1. Sign up with a public email.
  2. Select Join my company workspace and verify the workspace list opens directly.
  3. Tap Skip and verify onboarding completes.
  4. Open Concierge and verify exactly one Join your company's workspace task appears.
  5. Open the task, then select Join a workspace in its description.
  6. Verify the workspace list opens with a close button.
  7. Close the list and verify the App returns to the task thread without restarting onboarding.
Screen.Recording.2026-09-17.at.11.24.22.AM.mov

Test 5 - Validated public-email account takeover protection

  1. Validate a public-email account, select Join my company workspace, and skip the work-email step.
  2. Verify an Add your work email task is created.
  3. Enter a private-domain email and tap Add work email.
  4. Verify error message appears.
  5. Tap Confirm and verify the App returns to the task thread.
Screen.Recording.2026-09-17.at.11.25.36.AM.mov
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

Same as Tests.

  • 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 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 that was added to the app is grammatically correct in English.
  • 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
  • If a new CSS style is added I verified that a similar style does not already exist and existing StyleUtils cannot create it
  • If new assets were added or existing ones were modified, I verified that they are optimized and load correctly across all supported platforms
  • If the PR modifies code that runs when editing or sending messages, I tested all supported markdown
  • If the PR modifies a generic component, I verified its other usages
  • If the PR modifies a component related to existing Storybook stories, I verified all related stories
  • If the PR modifies a directly accessible component or page, I verified logged-in and logged-out deeplinks
  • If the PR modifies UI or form styles, I verified form alignment and added the Design label and/or tagged @Expensify/design
  • I added unit tests for the new behavior
  • If main was merged after review, I tested again according to the Test steps

Screenshots/Videos

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

@carlosmiceli
carlosmiceli requested a review from a team October 9, 2026 20:21
@carlosmiceli carlosmiceli added the InternalQA This pull request required internal QA label Oct 9, 2026
@OSBotify

This comment has been minimized.

@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/CONST/index.ts 95.90% <ø> (ø)
src/ROUTES.ts 32.14% <100.00%> (+0.32%) ⬆️
src/components/Icon/chunks/illustrations.chunk.ts 0.00% <ø> (ø)
src/components/OnboardingHeader.tsx 100.00% <100.00%> (ø)
...components/OnboardingMergingAccountBlockedView.tsx 100.00% <100.00%> (ø)
src/components/ReportActionItem/TaskView.tsx 84.50% <100.00%> (+0.22%) ⬆️
...idateCodeActionModal/ValidateCodeActionContent.tsx 100.00% <100.00%> (ø)
src/hooks/useOnboardingIntent.ts 100.00% <100.00%> (ø)
src/libs/API/types.ts 100.00% <ø> (ø)
src/libs/Navigation/AppNavigator/AuthScreens.tsx 83.50% <100.00%> (ø)
... and 29 more
... and 54 files with indirect coverage changes

Keep the onboarding route registered during fresh sign-in and gate only the redirect while Validate Login is focused. Allow the initial onboarding reset before the guard's onboarding NVP subscription has loaded, instead of treating missing data as completed and redirecting to Home.
@carlosmiceli
carlosmiceli marked this pull request as ready for review October 12, 2026 00:06
@carlosmiceli
carlosmiceli requested review from a team as code owners October 12, 2026 00:06
@melvin-bot
melvin-bot Bot requested review from ChavdaSachin and removed request for a team October 12, 2026 00:06
@melvin-bot

melvin-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown

@ChavdaSachin 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 October 12, 2026 00:06
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T00:20:14.715410Z 8cd85af Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@carlosmiceli
carlosmiceli removed the request for review from ChavdaSachin October 12, 2026 00:07
@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

(Sidenote: I'm kinda surprised we're adding this as an intent cause A) we should know this already right? and B) does this give us any useful information to act upon? @dylanexpensify . cc @Expensify/design )

Videos look good though 👍

Comment thread src/libs/Navigation/helpers/isJoinWorkspaceTaskPath.ts
Comment thread src/languages/en.ts
Comment thread src/types/onyx/IntroSelected.ts
@carlosmiceli

Copy link
Copy Markdown
Contributor Author

(Sidenote: I'm kinda surprised we're adding this as an intent cause A) we should know this already right? and B) does this give us any useful information to act upon? @dylanexpensify . cc @Expensify/design )

Videos look good though 👍

I think @garrettmknight can explain it best.

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

Copy link
Copy Markdown

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: 8cd85afd32

ℹ️ 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 on lines 338 to +343
useEffect(() => {
if (isLoadingJoinablePolicies || joinablePoliciesLoading !== false || joinablePoliciesLength > 0 || !defaultPolicy?.id) {
if (joinablePoliciesLoading !== false || joinablePoliciesLength > 0 || !defaultPolicy?.id) {
return;
}

finishOnboarding({
finishOnboardingFromEffect({

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Skip the onboarding fallback for Concierge task flows

When a completed user with an existing default group policy follows a marked Join Workspace task and the lookup returns no joinable policies, this effect still calls finishOnboardingFromEffect. It races the empty-result effect above, which is trying to post the Concierge follow-up and dismiss the modal, and can instead navigate to Personal Details or run completeOnboarding again. Gate this fallback out for isConciergeTaskFlow so it remains limited to unfinished onboarding.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks valid however, i couldnt test it since it needs an empty joinable list .. The domain I have contains many workspaces so I couldn't test it

Comment on lines +243 to +246
// AddWorkEmail already made this the account's login, and resending it would merge the account into itself.
if (sessionEmail && submittedWorkEmail.toLowerCase() === sessionEmail.toLowerCase()) {
setOnboardingShouldValidate(false);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Mark same-email submissions as submitted

In the regular Join Workspace flow, going back from private-domain validation leaves the added work email as the current session login and clears shouldValidate. Resubmitting that prefilled email reaches this branch, but it never sets hasSubmittedWorkEmail; consequently the Join Workspace effect returns at its !hasSubmittedWorkEmail guard even after shouldValidate becomes false, leaving the form stuck. Set the submission flag or navigate directly as the Concierge resume branch does.

Useful? React with 👍 / 👎.

@carlosmiceli
carlosmiceli requested a review from a team as a code owner October 12, 2026 00:21
@melvin-bot
melvin-bot Bot requested a review from ikevin127 October 12, 2026 00:21
@melvin-bot

melvin-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown

@ikevin127 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 October 12, 2026 00:21
@OSBotify

Copy link
Copy Markdown
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

The diff is too large to include in this comment (79KB), so I've created a gist for you:

📋 View the translation diff here 📋

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply, or directly by running gh gist view --raw 51e21b0416c716d20d6ec96b6df22336 | git apply 😉

View workflow run

@hungvu193
hungvu193 removed the request for review from ikevin127 October 12, 2026 02:38
@hungvu193

Copy link
Copy Markdown
Contributor

@carlosmiceli Is it expected we will return to company email steps when clicking "Join my company workspace"? In the video below I'm using a brand new account (normal gmail account).

Screen.Recording.2026-10-12.at.10.02.17.mov

@hungvu193

Copy link
Copy Markdown
Contributor

I can confirm it fixed all the previous blocker btw 👍

@carlosmiceli

Copy link
Copy Markdown
Contributor Author

@carlosmiceli Is it expected we will return to company email steps when clicking "Join my company workspace"? In the video below I'm using a brand new account (normal gmail account).

Screen.Recording.2026-10-12.at.10.02.17.mov

Yes, if no work email was added in the first screen.

@abzokhattab

Copy link
Copy Markdown
Contributor

reviewing

@abzokhattab

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified any copy / text that was added to the app 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)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • 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 the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
665293203-5b4654ee-7c3f-4f89-95b4-b13f8475e48d.mov
665293177-558fe3d2-866f-4697-8eb3-ccf75149a4ce.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-10-12.at.16.50.06.mov
Screen.Recording.2026-10-12.at.17.06.59.mov
Screen.Recording.2026-10-12.at.17.09.46.mov
Screen.Recording.2026-10-12.at.17.12.06.mov

@abzokhattab abzokhattab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM the mentioned blockers were fixed ... i retested and couldnt find other issues

@melvin-bot melvin-bot Bot changed the title Add the join-workspace onboarding intent and Concierge follow up tasks [Payment due @abzokhattab] Add the join-workspace onboarding intent and Concierge follow up tasks Oct 12, 2026
@melvin-bot

melvin-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown

🎯 @abzokhattab, thanks for reviewing and testing this PR! 🎉

A payment issue will be created for your review once this PR is deployed to production.
E/E issue linked to the PR - https://www.github.com/Expensify/Expensify/issues/672346.

If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created.

@carlosmiceli

Copy link
Copy Markdown
Contributor Author

@iwiznia all yours again

This branch has not been deployed

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

Labels

InternalQA This pull request required internal QA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants