Skip to content

feat: Submit workspace creation + onboarding flow (Wave 2)#87283

Open
abzokhattab wants to merge 38 commits intoExpensify:mainfrom
abzokhattab:akhattab/87261-submit-workspace-onboarding
Open

feat: Submit workspace creation + onboarding flow (Wave 2)#87283
abzokhattab wants to merge 38 commits intoExpensify:mainfrom
abzokhattab:akhattab/87261-submit-workspace-onboarding

Conversation

@abzokhattab
Copy link
Copy Markdown
Contributor

@abzokhattab abzokhattab commented Apr 7, 2026

Explanation of Change

  • Create Submit workspace (submit2026 type) when user selects "Get paid back by my employer" during onboarding
  • Include Submit workspaces in the "join existing workspace" flow
  • Navigate to Workspace > Categories with #admins side panel after onboarding
  • Add isPolicyEditor() and canEditWorkspaceSettings() helpers so Submit/Editor users can access workspace pages
  • Update AccessOrNotFoundWrapper, WorkspacePageWithSections, sidebar, and Workflows pages to recognize Submit/Editor access
  • Fix infinite onboarding loop for unvalidated private-domain users

Fixed Issues

$ #87261

Tests

  1. Enable SUBMIT_2026 beta for your account
  2. Log out and go through onboarding
  3. Select "Get paid back by my employer"
  4. Enter first/last name, submit
  5. Verify you land on Workspace > Categories with the side panel open
  6. Verify sidebar shows Categories, Tags, Distance Rates, Workflows, Members
  7. Click into Workflows — verify it loads (not "page not found")
  • Verify that no errors appear in the JS console

Private domain path:

  1. Use a private domain email with accessible policies
  2. Select "Get paid back by my employer"
  3. Verify the joinable workspaces screen appears
  4. Click "Join Now" on a submit workspace→ verify navigation to that workspace's Categories page
  5. Click "Skip" → verify a new Submit workspace is created
  6. Repeat with an unvalidated private domain email — verify no infinite loop

Offline tests

same as tests

QA Steps

Same as Tests above.

  • 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
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • 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

Android: Native
Screen.Recording.2026-04-16.at.00.29.49.mov
Screen.Recording.2026-04-16.at.23.48.23.mov
Android: mWeb Chrome
Screen.Recording.2026-04-16.at.00.32.32.mov
Screen.Recording.2026-04-16.at.23.50.23.mov
iOS: Native
Screen.Recording.2026-04-16.at.00.29.49.mov
Screen.Recording.2026-04-16.at.17.43.36.mov
iOS: mWeb Safari
Screen.Recording.2026-04-16.at.00.32.32.mov
Screen.Recording.2026-04-16.at.23.51.54.mov
MacOS: Chrome / Safari
Screen.Recording.2026-04-19.at.00.52.28.mov
Screen.Recording.2026-04-18.at.20.48.26.mov

When a user selects "Get paid back by my employer" with the SUBMIT_2026
beta enabled, create a Submit workspace and complete onboarding, then
navigate to Workspace > Categories with the side panel open.
@abzokhattab abzokhattab requested review from a team as code owners April 7, 2026 20:25
@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented Apr 7, 2026

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx ts-node ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx ts-node ./scripts/generateTranslations.ts --compare-ref main

@melvin-bot melvin-bot Bot requested review from heyjennahay and hungvu193 and removed request for a team April 7, 2026 20:25
@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented Apr 7, 2026

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

@abzokhattab abzokhattab changed the title feat: Submit workspace creation + onboarding flow (Wave 2) WIP: feat: Submit workspace creation + onboarding flow (Wave 2) Apr 7, 2026
@abzokhattab abzokhattab marked this pull request as draft April 7, 2026 20:27
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: 7a5368cfe5

ℹ️ 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".

Comment thread src/libs/navigateAfterOnboarding.ts
Comment thread src/pages/OnboardingPurpose/BaseOnboardingPurpose.tsx
The useAutoCreateSubmitWorkspace hook runs a selector that calls
translate() for workspace name generation. The test needs IntlStore
loaded, matching the pattern in PersonalDetailsOnboarding test.
- PolicyTest: verify createWorkspace with SUBMIT type produces correct
  defaults (ADVANCED approval, workflows/tags/distance rates enabled,
  company cards disabled, harvesting disabled)
- OnboardingPurpose: verify EMPLOYER + Submit2026 beta navigates to
  personal details (public domain) or workspaces (private domain)
- OnboardingWorkspaces: verify skip with EMPLOYER + Submit2026 beta
  calls createWorkspace with SUBMIT type and completeOnboarding with
  EMPLOYER engagement choice
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 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 Δ
src/CONST/index.ts 92.30% <ø> (ø)
.../components/SidePanel/SidePanelContextProvider.tsx 84.37% <ø> (ø)
src/hooks/useAutoCreateSubmitWorkspace.ts 100.00% <100.00%> (ø)
src/libs/actions/Welcome/index.ts 52.45% <100.00%> (+8.39%) ⬆️
...gPersonalDetails/BaseOnboardingPersonalDetails.tsx 88.67% <100.00%> (+0.92%) ⬆️
.../pages/OnboardingPurpose/BaseOnboardingPurpose.tsx 94.73% <100.00%> (+1.18%) ⬆️
.../OnboardingWorkspaces/BaseOnboardingWorkspaces.tsx 95.00% <100.00%> (+11.66%) ⬆️
src/pages/workspace/AccessOrNotFoundWrapper.tsx 74.57% <100.00%> (+0.43%) ⬆️
src/pages/workspace/WorkspaceMembersPage.tsx 60.99% <100.00%> (-1.16%) ⬇️
src/pages/workspace/WorkspacePageWithSections.tsx 72.85% <100.00%> (ø)
... and 17 more
... and 132 files with indirect coverage changes

- WorkspaceOnboarding: stop mocking navigateAfterOnboarding, spy on
  Navigation primitives instead so the real navigation functions execute
  (covers navigateAfterOnboarding.ts)
- PersonalDetailsOnboarding: add EMPLOYER + Submit2026 tests for both
  private domain (navigate to workspaces) and public domain (creates
  Submit workspace) branches
The test user signs in as test@user.com but the login list had
fake@gmail.com, so isCurrentUserValidated returned false and routed
to PRIVATE_DOMAIN instead of WORKSPACES.
@hungvu193
Copy link
Copy Markdown
Contributor

@abzokhattab Is this ready for review?

@abzokhattab
Copy link
Copy Markdown
Contributor Author

@hungvu193 its still in progress i am testing the changes and seeing if we have any regressions today

@abzokhattab
Copy link
Copy Markdown
Contributor Author

didnt have time to look into it .. i am continuing to work on this today

@abzokhattab
Copy link
Copy Markdown
Contributor Author

@MelvinBot Review the PR

@abzokhattab
Copy link
Copy Markdown
Contributor Author

@codex review

@MelvinBot
Copy link
Copy Markdown
Contributor

PR Review

Overall this is a well-structured feature with good test coverage. A few issues to address:

Issues

1. CONST.POLICY.ROLE.EDITOR is unused
The EDITOR: 'editor' constant is added to CONST.POLICY.ROLE but never referenced anywhere in this PR. If it's not needed yet, remove it to avoid dead code — it can be added when actually used.

2. CONST.POLICY.TYPE.SUBMIT value 'submit2026' breaks naming convention
All other policy types use simple lowercase strings ('personal', 'team', 'corporate'). The value 'submit2026' embeds a year, which is inconsistent. If the backend requires this exact string, add a comment explaining why. Otherwise consider using 'submit' and keeping the year suffix only on the beta constant (CONST.BETAS.SUBMIT_2026), which already has it.

3. Missing onboardingPurposeSelected in useAutoCreateSubmitWorkspace
The parallel hook useAutoCreateTrackWorkspace passes onboardingPurposeSelected to createWorkspace(), but useAutoCreateSubmitWorkspace does not. Is this intentional? If the backend uses this field for analytics or routing, omitting it could cause data gaps.

4. navigateToSubmitWorkspaceAfterOnboardingSidePanelActions.openSidePanel(true) timing
In navigateAfterOnboarding.ts, openSidePanel(true) is called immediately after Navigation.navigate(). If the navigation is async and the target screen hasn't mounted yet, the side panel open could be a no-op or race. Consider whether this needs to be deferred (e.g., via InteractionManager.runAfterInteractions or a callback from the target screen).

5. BaseOnboardingWorkspacescompleteOnboarding uses EMPLOYER engagement but joins a different workspace
When isEmployerWithSubmit is true and the user clicks "Join Now" on an existing workspace, completeOnboarding is called with engagementChoice: CONST.ONBOARDING_CHOICES.EMPLOYER. But the user is joining someone else's workspace (not creating a Submit one). Is the EMPLOYER engagement choice correct here, or should it remain LOOKING_AROUND for the join-existing-workspace path?

Nits

  • In useAutoCreateSubmitWorkspace.ts, the paidGroupPolicySelector creates a new function reference on every render (the useMemo depends on session?.email which is stable, so this is fine — but the inner .some() could short-circuit more clearly with an early return).
  • The getApprovalModeForNewWorkspace helper in Policy.ts is clean and well-extracted.
  • Test coverage is solid — the three new test files cover the key flows (purpose selection, personal details submission, workspace skip).

Next Steps: Reply with @MelvinBot <your feedback> to discuss any of these points.

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: 98d9e67401

ℹ️ 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".

Comment thread src/pages/OnboardingPurpose/BaseOnboardingPurpose.tsx Outdated
Comment thread src/pages/workspace/DynamicWorkspaceOverviewPlanTypePage.tsx Outdated
…-workspace-onboarding

# Conflicts:
#	src/CONST/index.ts
…alidated

- Include SUBMIT in isPaidGroupPolicy so WorkspaceCategoriesPage (and
  other PAID-gated workspace pages) are accessible for Submit workspaces
- Add isValidated check in BaseOnboardingPurpose before routing
  EMPLOYER+Submit users with a saved firstName directly to Workspaces,
  preventing unvalidated users from bypassing domain verification
- Update OnboardingPurpose test to set validated login for the private
  domain shortcut test
@abzokhattab
Copy link
Copy Markdown
Contributor Author

@MelvinBot Review the PR again

@iwiznia
Copy link
Copy Markdown
Contributor

iwiznia commented Apr 20, 2026

@abzokhattab you have conflicts

WorkspaceUpgradePage gated on canModifyPlan (strict admin), so any
non-admin who was redirected to /upgrade hit NotFound. Submit editors
hit this any time they tap a Control-only toggle in "More features"
(e.g. Rules). Expensify#87262 will add isSubmitPolicy redirects from Roles,
Approvals, Payments, Accounting, Company Cards, Expensify Card,
Travel, and Invoicing to this same page — all of those would dead-end
on NotFound for editors without this fix.

- Gate the page with canEditWorkspaceSettings (admins on any policy,
  editors on Submit policies) so editors render the upgrade intro.
- Keep canPerformUpgrade (strict admin) controlling the upgrade
  button via buttonDisabled, so editors can't trigger an upgrade.
- onUpgradeToCorporate and confirmUpgrade already guard on
  canPerformUpgrade, so no new write paths are opened for editors.
…it-workspace-onboarding

# Conflicts:
#	src/pages/workspace/WorkspaceInitialPage.tsx
#	src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx
@abzokhattab
Copy link
Copy Markdown
Contributor Author

resolved and fixed the not found issue

Upstream main renamed newGenerateDefaultWorkspaceName back to
generateDefaultWorkspaceName. The Track hook picked up the new name
during the merge, but useAutoCreateSubmitWorkspace.ts was missed,
breaking CI's tsc typecheck.
@hungvu193
Copy link
Copy Markdown
Contributor

Will review again today

@hungvu193
Copy link
Copy Markdown
Contributor

hungvu193 commented Apr 20, 2026

Bug: Not found page appears ater joining a workspace with private domain:

  1. Register with private domain
  2. Enter your name > Skip
  3. Choose Get paid back by my employer
  4. On Join a workspace > Click Join
  5. Not found page appears

After that if you try to press back button, onboarding will appears again.

Screen.Recording.2026-04-20.at.23.32.52.mov

@hungvu193
Copy link
Copy Markdown
Contributor

Bug: Private domain - Nothing happens after clicking `Join now:

  1. Register with private domain
  2. Enter your name > Enter
  3. On Join Workspace screen > Join any workspace
Screen.Recording.2026-04-20.at.23.41.14.mov

Looks at Member pages, Custom field 1 and Custom field 2 are showing, that's not expected because we should only display these columns with Control Policy.

Screenshot 2026-04-20 at 23 46 27

@hungvu193
Copy link
Copy Markdown
Contributor

Bug: Editor is not able to edit workspace settings after:
According this docs:

Editor role - A new role in the workspace that allows users to edit workspace settings, but cannot see all expenses associated with the workspace

I think Editors are allowed to change workspace settings? But while testing the latest code, the Editor is now only able to see the Member and Overview page.

Screen.Recording.2026-04-20.at.23.49.05.mov

@abzokhattab
Copy link
Copy Markdown
Contributor Author

abzokhattab commented Apr 21, 2026

@hungvu193

Bug: Private domain - Nothing happens after clicking `Join now:
Register with private domain
Enter your name > Enter
On the Join Workspace screen > Join any workspace

For any workspace type other than 'submit', the behavior hasn't changed, meaning it won't navigate to the categories page. As per the documentation, I configured it to navigate to categories only when joining a 'submit' workspace. Let me know if you think it should behave differently

Looks at Member pages, Custom field 1 and Custom field 2 are showing, that's not expected because we should only display these columns with Control Policy.

also when joining a submit wokspace i see that the fields are editable ... no?

Bug: Not found page appears after joining a workspace with private domain:
Bug: Editor is not able to edit workspace settings after:

i am unabled to reproduce this one ... is there something i am missing

Screen.Recording.2026-04-21.at.12.15.12.mov

@hungvu193
Copy link
Copy Markdown
Contributor

hungvu193 commented Apr 21, 2026

@abzokhattab I'm still able to reproduce this one: Bug: Private domain - Nothing happens after clicking `Join now:

I already joined an actual Submit workspace:

  1. Register with private domain
  2. Don't skip validation code.
  3. Join workspace.

Just to clarify that it only works if you choose the option Get paid back by my employer, if user chooses to Join the submit workspace right after code validation, it won't work. Can you confirm if this is expected?

Screen.Recording.2026-04-22.at.00.27.33.mov

@hungvu193
Copy link
Copy Markdown
Contributor

hungvu193 commented Apr 21, 2026

Another thing I noticed that Editor is not able to edit some settings that is only allowed by the admin. For example: Change approver, enable payment, invite member....

Should we prevent Editor from these actions or should we update our BE to allow Editor to do that?

Screen.Recording.2026-04-22.at.00.45.38.mov

Add additional approver:

Screen.Recording.2026-04-22.at.00.46.41.mov

…it-workspace-onboarding

# Conflicts:
#	src/libs/actions/Policy/Policy.ts
Previously only users who picked "Get paid back by my employer" landed on
Workspace > Categories with #admins open after auto-joining a workspace
during onboarding. Private-domain signups that reach the Join Workspace
screen without selecting a Purpose would fall through to a HOME redirect,
which appears as "nothing happens" after clicking Join now (report by
@hungvu193 on Expensify#87283).

Use the SUBMIT_2026 beta as the gate instead so any auto-join during
onboarding by a Submit-era user follows the same Submit navigation as the
EMPLOYER flow. Non-beta users are unchanged.
@abzokhattab
Copy link
Copy Markdown
Contributor Author

abzokhattab commented Apr 22, 2026

Validated against the design doc + Wave issues. The only explicit editor restriction is from #87865:

Enforce editor permissions: can edit workspace settings, cannot change roles to admin.

Mapping the examples:

Action Design intent Recommendation
Invite member Editor-allowed — #87865 is explicitly about this ("Force editor role for new members on Submit workspaces in addMembersToWorkspace()", "Override default invite role in WorkspaceInviteMessageComponent.tsx and WorkspaceInviteMessageRolePage.tsx"). Update BE to accept editor. FE already opens the flow and filters ADMIN out of the role picker.
Change approver Editor-allowed. Approvals are a Submit-enabled feature, and all approval sub-pages were intentionally widened to canEditWorkspaceSettings in this PR. Update BE to accept editor.
Add additional approver Editor-allowed — same as above. Wave 3 (#87265) only adds an upgrade prompt for the advanced-approvals tier, not a blanket block on editors. Update BE to accept editor.
Enable payments / reimbursement bank account Admin-only by design — bank account ownership/liability is owner-scoped. Keep BE restriction. FE is already strict-admin here: disabled={isOffline || !isPolicyAdmin} in src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx:476,527. No FE change needed.

So three of the four are BE gaps (approvals + invite are editor-capable by design), and the reimbursement/bank-account one is correctly editor-blocked and should stay that way.

let me know what u think

@abzokhattab
Copy link
Copy Markdown
Contributor Author

I already joined an actual Submit workspace:

Alright i was able to reproduce it and pushed a fix

@hungvu193
Copy link
Copy Markdown
Contributor

Thanks for clarifying 🙏

Validated against the design doc + Wave issues. The only explicit editor restriction is from #87865:

@github-actions
Copy link
Copy Markdown
Contributor

🚧 @dylanexpensify has triggered a test Expensify/App build. You can view the workflow run here.

@hungvu193
Copy link
Copy Markdown
Contributor

hungvu193 commented Apr 22, 2026

@abzokhattab I can see the Reports feature is hidden from the sidebar 👍 . However, when joining a workspace, the loading state + sidebar items display incorrectly for a while. Looks like you still need to update the optimistic data when joining the submit workspace.

Screen.Recording.2026-04-22.at.23.13.10.mov

sentryLabel: CONST.SENTRY_LABEL.WORKSPACE.INITIAL.REPORTS,
});
if (isGroupPolicy(policy) && shouldShowProtectedItems) {
if (!isSubmitPolicy(policy)) {
Copy link
Copy Markdown
Contributor

@hungvu193 hungvu193 Apr 22, 2026

Choose a reason for hiding this comment

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

According to the docs, we will hide Reports feature when creating submit workspace:

Image

With this change here, there is no way to enable this feature for Submit workspace again, can you confirm if this is expected? @dylanexpensify

@hungvu193
Copy link
Copy Markdown
Contributor

@codex review

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: 5aaf16e97a

ℹ️ 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".

// is enabled, including private-domain users who reach this screen without selecting
// a Purpose. JoinablePolicy doesn't carry policy.type from the backend today, so the
// beta is our best local signal for Submit-era onboarding.
const shouldUseSubmitFlow = canUseSubmit2026;
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 Restrict Submit onboarding flow to employer purpose

shouldUseSubmitFlow is derived from canUseSubmit2026 alone, so any user with the beta (including users who selected non-EMPLOYER purposes like Manage team) is forced through the Submit path when joining a workspace. In this branch we pass true to joinAccessiblePolicy, overwrite engagementChoice to EMPLOYER, and navigate to Submit-specific post-onboarding behavior, which misclassifies onboarding state and sends users to the wrong destination/tasks for their selected purpose. This should be gated by onboarding purpose (or a narrowly defined fallback) rather than beta presence alone.

Useful? React with 👍 / 👎.

@hungvu193
Copy link
Copy Markdown
Contributor

hungvu193 commented Apr 24, 2026

@abzokhattab After recent changes, the Distance page can't be loaded with status code 666

Screen.Recording.2026-04-24.at.14.23.25.mov

Also Workflows page always shows loading after visiting it:

Screen.Recording.2026-04-24.at.14.35.39.mov

@abzokhattab
Copy link
Copy Markdown
Contributor Author

reviewing

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants