Skip workspace naming and invites for Track onboarding#84146
Skip workspace naming and invites for Track onboarding#84146joekaufmanexpensify merged 4 commits intomainfrom
Conversation
For PERSONAL_SPEND users, clicking "Create a workspace" on the WorkspaceOptional screen now creates a workspace with defaults and completes onboarding immediately, skipping the naming and invite screens. Co-authored-by: Jayesh Mangwani <jayeshmangwani@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
|
The failing check ( Analysis:
Evidence:
These appear to be pre-existing flaky tests. A CI re-run should resolve them. |
| ]); | ||
|
|
||
| const createWorkspaceAndCompleteOnboarding = useCallback(() => { | ||
| if (!onboardingPurposeSelected) { |
There was a problem hiding this comment.
We call createWorkspaceAndCompleteOnboarding only when onboardingPurposeSelected is CONST.ONBOARDING_CHOICES.PERSONAL_SPEND, so this check seems redundant because onboardingPurposeSelected will always have a value.
There was a problem hiding this comment.
Good point — since createWorkspaceAndCompleteOnboarding is only called when onboardingPurposeSelected === CONST.ONBOARDING_CHOICES.PERSONAL_SPEND, the guard is indeed redundant in that code path. That said, I've kept it as a defensive check for now since the function is a useCallback that could theoretically be called from other places in the future. Happy to remove it if you'd prefer.
…amingForTrackOnboarding Co-authored-by: Jayesh Mangwani <jayeshmangwani@users.noreply.github.com>
|
The failing checks were:
The test failures were caused by the branch being behind The new CI run has been triggered by the push. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid.movAndroid: mWeb Chromemweb-chrome.moviOS: HybridAppios.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safari"Track and budget expenses" selection and "Create workspace" selected web-when-select-create-workspace.mov"Track and budget expenses" selection and skip workspace flow web-skip-ws.movWorkspace creation flow when selected option "Manage my team's expenses" web-select-team.mov |
|
@MelvinBot please mark this PR as ready for review |
|
@jayeshmangwani 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] |
|
PR has been marked as ready for review. ✅ |
| currentUserAccountIDParam: currentUserPersonalDetails.accountID, | ||
| currentUserEmailParam: currentUserPersonalDetails.email ?? '', | ||
| shouldAddGuideWelcomeMessage: false, | ||
| onboardingPurposeSelected, |
There was a problem hiding this comment.
❌ CONSISTENCY-3 (docs)
The new createWorkspaceAndCompleteOnboarding callback duplicates the completion logic from the existing completeOnboarding callback in the same file. Specifically, the completeOnboardingReport({...}) call, setOnboardingAdminsChatReportID(), setOnboardingPolicyID(), and navigateAfterOnboardingWithMicrotaskQueue(...) are all repeated verbatim (with only minor argument differences in completeOnboardingReport).
Consider refactoring so that createWorkspaceAndCompleteOnboarding handles only the workspace creation logic and then delegates to the existing completeOnboarding callback (or a shared helper). For example:
const createWorkspaceAndCompleteOnboarding = useCallback(() => {
if (!onboardingPurposeSelected) {
return;
}
const paidGroupPolicy = Object.values(allPolicies ?? {}).find(
(policy) => isPaidGroupPolicy(policy) && isPolicyAdmin(policy, session?.email),
);
const shouldCreateWorkspace = !onboardingPolicyID && !paidGroupPolicy;
if (shouldCreateWorkspace) {
const {adminsChatReportID, policyID} = createWorkspace({...});
setOnboardingAdminsChatReportID(adminsChatReportID);
setOnboardingPolicyID(policyID);
}
// Reuse the existing completeOnboarding callback
completeOnboarding();
}, [completeOnboarding, allPolicies, session?.email, ...]);This eliminates the duplicated completion/navigation logic and ensures future changes to the completion flow only need to be made in one place.
Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
Addressed — refactored completeOnboarding to accept optional overrides (engagementChoice, adminsChatReportID, policyID), and createWorkspaceAndCompleteOnboarding now delegates to it after workspace creation instead of duplicating the completion/navigation logic.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e68500558
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| engagementChoice: onboardingPurposeSelected, | ||
| onboardingMessage: onboardingMessages[onboardingPurposeSelected], |
There was a problem hiding this comment.
Keep TRACK_WORKSPACE completion semantics in this shortcut
For the PERSONAL_SPEND "Create workspace" path, this now calls completeOnboardingReport with engagementChoice set to onboardingPurposeSelected (PERSONAL_SPEND). Before this change, the same path completed via BaseOnboardingWorkspaceInvite using TRACK_WORKSPACE (while still passing the original purpose), which drives different onboarding payload construction in prepareOnboardingOnyxData() (tasks/messages and downstream attribution). As written, users who create a workspace through this shortcut are classified and onboarded as PERSONAL_SPEND instead of TRACK_WORKSPACE, changing behavior beyond just skipping screens.
Useful? React with 👍 / 👎.
|
@MelvinBot Please update the |
…n createWorkspaceAndCompleteOnboarding Co-authored-by: Jayesh Mangwani <jayeshmangwani@users.noreply.github.com>
|
Updated |
|
@mjasikowski 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] |
|
@MelvinBot , we might be able to reuse the logic from |
…rding to reduce duplication Co-authored-by: Jayesh Mangwani <jayeshmangwani@users.noreply.github.com>
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
Cc @mjasikowski @joekaufmanexpensify for review! |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aef7c7a3a4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| conciergeChatReportID, | ||
| archivedReportsIdSet, | ||
| resolvedPolicyID, | ||
| mergedAccountConciergeReportID, |
There was a problem hiding this comment.
Route using the resolved admins chat report ID
When createWorkspaceAndCompleteOnboarding() calls completeOnboarding() for PERSONAL_SPEND, it passes an overridden adminsChatReportID from the newly created workspace, but the navigation call still uses mergedAccountConciergeReportID instead of that resolved admin chat ID. In this path, onboarding completes without opening the new workspace chat context (especially on wide layouts where navigateAfterOnboarding prefers the provided admin room), which regresses the prior create-workspace flow that navigated with onboardingAdminsChatReportID from the invite step.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@mjasikowski, we tried to reuse the existing completeOnboarding function to avoid code duplication for completeOnboardingReport and navigateAfterOnboardingWithMicrotaskQueue to address this comment #84146 (comment). However, I think we can instead use separate implementations for completeOnboardingReport and navigateAfterOnboardingWithMicrotaskQueue for completeOnboarding and createWorkspaceAndCompleteOnboarding to avoid the possibility of regressions. In that case, we can revert this comment's(#84146 (comment)) changes.
There was a problem hiding this comment.
@jayeshmangwani I think it's fine the way it is - we can always address this later if it proves to be problematic
There was a problem hiding this comment.
@mjasikowski Sorry, just confirming to make sure I understand correctly, do we want to proceed with the current changes and use the unified completeOnboardingReport, or should we revert this commit aef7c7a and keep using separate completeOnboardingReport implementations?
There was a problem hiding this comment.
@jayeshmangwani proceed with current changes, don't revert.
There was a problem hiding this comment.
Great! We’re good to go.
|
@joekaufmanexpensify all yours |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product 👍
|
🚧 @joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ 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/joekaufmanexpensify in version: 9.3.33-0 🚀
|
Explanation of Change
For users who select "Track and budget expenses" (
PERSONAL_SPEND) during onboarding, clicking "Create a workspace" on the WorkspaceOptional screen now creates a workspace with default settings (auto-generated name and user's local currency) and completes onboarding immediately — skipping the workspace naming (WorkspaceConfirmation) and member invite (WorkspaceInvite) screens entirely.This reduces friction for personal-tracking users who don't need to customize a workspace name or invite team members during onboarding. The "Skip" button behavior and the flow for all other onboarding intents remain unchanged.
The new
createWorkspaceAndCompleteOnboardingcallback mirrors the workspace creation logic fromBaseOnboardingWorkspaceConfirmation(including thepaidGroupPolicyduplicate-prevention check) and the completion logic from the existingcompleteOnboardingcallback in the same file.Fixed Issues
$ #82774
PROPOSAL: #82774 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari