Add the ability to create a workspace for a client #81008
Add the ability to create a workspace for a client #81008blimpich merged 48 commits intoExpensify:mainfrom
Conversation
|
@QichenZhu 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5a2049726
ℹ️ 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".
| onSubmit({ | ||
| name: val[INPUT_IDS.NAME], | ||
| currency: val[INPUT_IDS.CURRENCY], | ||
| planType: val[INPUT_IDS.PLAN_TYPE], |
There was a problem hiding this comment.
Propagate selected plan type into workspace creation
The form now captures planType, but none of the submit handlers downstream use it (e.g., createWorkspaceWithPolicyDraftAndNavigateToIt/Policy.createWorkspace still default the policy type to TEAM unless shouldCreateControlPolicy is set). That means a user can pick “Control” here and still end up with a Team workspace, so the new selector has no effect. Consider threading this value through the submit handlers and into the draft/creation helpers so the chosen plan type actually drives the policy type.
Useful? React with 👍 / 👎.
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.
|
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
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 --helpTypically, you'd want to translate only what you changed by running |
@trjExpensify @QichenZhu Because we added the Plan type selector and Owner selection with the “Keep me as an admin” option, the screen is no longer tall enough to show the Save button.
Could we enable scrolling (or auto-scroll to the bottom) on the workspace confirmation page so the Save button is visible? |
Screen.Recording.2026-02-02.at.11.29.55.mov@trjExpensify @QichenZhu We have a case where the user selects a non-existing account as the Owner. Do we show an error for this case? |
| const {inputCallbackRef} = useAutoFocusInput(); | ||
| const scrollViewRef = useRef<RNScrollView>(null); | ||
| const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true}); | ||
| const isApprovedAccountant = !!account?.isApprovedAccountant || true; |
There was a problem hiding this comment.
❌ CONSISTENCY-2 (docs)
The expression \!\!account?.isApprovedAccountant || true will always evaluate to true due to the || true condition. This is a logic bug that defeats the purpose of checking the account status.
Suggested fix:
const isApprovedAccountant = \!\!account?.isApprovedAccountant;If you need to test this feature while it's in development, consider using a feature flag or environment variable instead of hardcoding true.
Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
src/libs/actions/Policy/Policy.ts
Outdated
| const isCorporateIntegration = userReportedIntegration && (CONST.POLICY.CONNECTIONS.CORPORATE as readonly string[]).includes(userReportedIntegration); | ||
| const workspaceType = isCorporateFeature || isCorporateIntegration || shouldCreateControlPolicy ? CONST.POLICY.TYPE.CORPORATE : CONST.POLICY.TYPE.TEAM; | ||
|
|
||
| const determineWorkspaceType = (): typeof CONST.POLICY.TYPE.TEAM | typeof CONST.POLICY.TYPE.CORPORATE => { |
There was a problem hiding this comment.
❌ PERF-6 (docs)
The determineWorkspaceType helper function is unnecessary. This value can be computed directly without creating a separate function.
Suggested fix:
const workspaceType = type ?? (isCorporateFeature || isCorporateIntegration || shouldCreateControlPolicy ? CONST.POLICY.TYPE.CORPORATE : CONST.POLICY.TYPE.TEAM);This approach:
- Eliminates the helper function
- Uses the nullish coalescing operator for cleaner logic
- Computes the value directly during rendering
- Improves readability
Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
|
@trjExpensify, sure, on it! |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45e1b5ac9f
ℹ️ 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".
|
@huult @QichenZhu can you look at the above codex comments? |
|
@QichenZhu I’ve updated this. Could you please review and re-test? Thanks! |
There was a problem hiding this comment.
Replied in the comment threads (#81008 (comment), #81008 (comment)). @huult
|
@QichenZhu Thanks, I’ll update it today. |
…r options" This reverts commit 3ec9dd2.
|
@QichenZhu Addressed your feedback, thanks. |
|
@QichenZhu how's it looking. Can we complete the review today? |
|
Look good on my end. @blimpich, can you take a second look? |
blimpich
left a comment
There was a problem hiding this comment.
LGTM! Nice job with this!
|
🚧 @blimpich 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/blimpich in version: 9.3.28-0 🚀
|
|
Deploy Blocker #83995 was identified to be related to this PR. |
|
🚀 Deployed to staging by https://github.com/blimpich in version: 9.3.30-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.3.30-3 🚀
|


Explanation of Change
Fixed Issues
$ #80057
PROPOSAL: #80057 (comment)
Tests
Same QA step
Offline tests
QA Steps
Precondition: Set an account as an approved accountant (isApprovedAccountant: true).
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
Screen.Recording.2026-02-02.at.11.01.16.mp4
Android: mWeb Chrome
Screen.Recording.2026-02-02.at.11.02.33.mp4
iOS: Native
Screen.Recording.2026-02-02.at.11.07.21.mp4
iOS: mWeb Safari
Screen.Recording.2026-02-02.at.11.08.25.mp4
MacOS: Chrome / Safari
Screen.Recording.2026-02-02.at.10.29.46.mp4