Repository navigation
Conversation
1b51562 to
1275772
Compare
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.
|
1275772 to
c5a0f20
Compare
commented
Jun 17, 2026
|
@abzokhattab 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] |
commented
Jun 17, 2026
|
|
||
| if (isUserReimburserForPolicy(policy, userEmail)) { | ||
| return translate('common.leaveWorkspaceReimburser'); | ||
| } |
There was a problem hiding this comment.
❌ CONSISTENCY-3 (docs)
The confirmModalPrompt function added here duplicates the same branching logic that already exists in src/pages/workspace/WorkspaceOverviewPage.tsx (confirmModalPrompt, ~line 494). Both build the leave-workspace confirmation prompt with the identical reimburser / technical-contact / exporter / approver / admin / auditor cascade. Maintaining two copies means any change to the prompt rules (or translation keys) must be made in two places and risks them drifting apart.
Extract this into a single shared helper (e.g. getLeaveWorkspaceConfirmationPrompt(policy, userEmail, ownerDisplayName, translate) in PolicyUtils/WorkspacesSettingsUtils) and call it from both LeaveWorkspaceAction and WorkspaceOverviewPage:
// libs/WorkspacesSettingsUtils.ts
function getLeaveWorkspaceConfirmationPrompt(policy: OnyxEntry<Policy>, userEmail: string, ownerDisplayName: string, translate: LocaleContextProps['translate']) {
if (isUserReimburserForPolicy(policy, userEmail)) {
return translate('common.leaveWorkspaceReimburser');
}
// ...remaining cascade...
return translate('common.leaveWorkspaceConfirmation');
}Reviewed at: c5a0f20 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
commented
Jun 17, 2026
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ 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". |
commented
Jun 17, 2026
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
commented
Jun 17, 2026
|
The tests coverage looks to be low lets add test cases to increase them |
This comment has been minimized.
This comment has been minimized.
commented
Jun 17, 2026
|
@MelvinBot review the PR |
commented
Jun 17, 2026
done! |
| hasStartedRef.current = true; | ||
|
|
||
| clearWorkspaceOwnerChangeFlow(policyID); | ||
| requestWorkspaceOwnerChange(policy, session?.accountID ?? CONST.DEFAULT_NUMBER_ID, session?.email ?? ''); |
There was a problem hiding this comment.
This passes session?.email as the user's login, but the three other call sites of requestWorkspaceOwnerChange (including the original code this was extracted from, and the sibling WorkspaceOverviewPage.tsx:480) all pass currentUserPersonalDetails.login:
WorkspaceOwnerChangeCheck.tsx:71WorkspaceOwnerChangeWrapperPage.tsx:46WorkspaceOverviewPage.tsx:480
That third argument is written optimistically to policy.owner (Member.ts:766). For accounts where session.email differs from the canonical personalDetails.login (e.g. SMS/phone logins, secondary logins, casing), the optimistic owner string will differ from what the rest of the app writes. Recommend using currentUserPersonalDetails.login here for consistency. The accountID argument is equivalent either way.
commented
Jun 17, 2026
🤖 Code reviewReviewed the refactor that extracts 1 finding (low impact): Things I checked and cleared
I did not run the app or the test suite — this is a static review only. Reply with |
0c5127c to
64aa0be
Compare
commented
Jun 17, 2026
|
@abzokhattab all comments have been resolved :) |
commented
Jun 17, 2026
|
No product review needed |
commented
Jun 18, 2026
|
Bug on ios:
Screen.Recording.2026-06-18.at.12.21.28.mov |
@abzokhattab Nice catch! Thanks for noticing that :) Screen.Recording.2026-06-18.at.14.24.35.mov |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-06-18.at.12.20.16.movScreen.Recording.2026-06-18.at.16.49.43.moviOS: mWeb SafariScreen.Recording.2026-06-18.at.17.21.47.movMacOS: Chrome / SafariScreen.Recording.2026-06-18.at.11.17.31.movScreen.Recording.2026-06-18.at.11.18.43.mov |
commented
Jun 18, 2026
|
@abzokhattab whats the latest? |
…aceAction and TransferOwnershipAction
531fe87 to
c51eb26
Compare
commented
Jun 19, 2026
|
@mountiny comments resolved! |
commented
Jun 19, 2026
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
commented
Jun 19, 2026
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
commented
Jun 19, 2026
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
commented
Jun 19, 2026
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.16-1 🚀
Bundle Size Analysis (Sentry): |
commented
Jun 19, 2026
|
🤖 I reviewed the changes in this PR against the help site files under No help site changes are required. This PR is a pure internal refactor / performance optimization:
There is no user-facing behavior change: the three-dot menu actions (Go to workspace, Leave, Duplicate, Copy settings, Set as default, Delete, Transfer owner) and all confirmation copy are unchanged — every I did not create a draft docs PR since there's nothing to document. @WojtekBoman, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
| "../../tests/unit/PaymentUtilsTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 7 | ||
| "../../tests/unit/PersistedRequests.ts" "@typescript-eslint/no-unsafe-type-assertion" 7 | ||
| "../../tests/unit/PersonalDetailsSelectorTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 3 | ||
| "../../tests/unit/PersonalDetailsSelectorTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 5 |
There was a problem hiding this comment.
Please don't add instances of this. Use partial types instead of as-casts.
| "../../tests/unit/PersonalDetailsSelectorTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 5 | ||
| "../../tests/unit/PolicyChangeLogContentTest.tsx" "@typescript-eslint/no-unsafe-type-assertion" 4 | ||
| "../../tests/unit/PolicySelectorTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 21 | ||
| "../../tests/unit/PolicySelectorTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 22 |
| "../../tests/unit/WorkflowUtilsTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 8 | ||
| "../../tests/unit/WorkspaceReportFieldUtilsTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 2 | ||
| "../../tests/unit/WorkspacesSettingsUtilsTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 15 | ||
| "../../tests/unit/WorkspacesSettingsUtilsTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 23 |
commented
Jun 22, 2026
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.4.16-5 🚀
|
Explanation of Change
Extracts
WorkspaceRowThreeDotsMenufromWorkspacesListPageinto its own component. Leave and transfer-ownership flows are further extracted intoLeaveWorkspaceActionandTransferOwnershipAction, each mounted on demand. This keeps heavy per-policy Onyx subscriptions scoped to the lifetime of the flow instead of keeping them alive while the workspaces list is idle. Two focused selectors (createDisplayDetailsByAccountIDsSelector,createCopySettingsEligibleTargetsSelector) are added so the page re-renders only on the subset of data it actually reads.Fixed Issues
$ #91175
PROPOSAL:
Tests
Settings > Workspaces).Offline tests
QA Steps
Same as tests.
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