feat: Replace vacation delegate policy diff warning with RHP invite step - #99460
Conversation
|
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 bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
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.
|
|
@codex review |
|
@MelvinBot review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7316a47f7e
ℹ️ 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".
Review — replace vacation delegate policy diff warning with an RHP invite stepOverall this is a clean, well-tested change. The refactor of 1. Confirm the "Skip" behavior in the mixed case (member of some + admin of some)In the mixed diff, the copy
So the admins of the workspaces you don't manage are supposed to be emailed regardless of the Invite/Skip choice — that choice is only about the workspaces you do administer. But the "Skip" button calls Could you confirm the backend semantics of 2. Minor robustness nits
What I checked
I did not exercise the flow in a live session: reaching the new RHP step requires a 305 policy-diff response, which needs a delegate who is missing from a specific mix of admin/non-admin workspaces — not reproducible against the test account. The mixed-case Invite/Skip path (item 1) is the key scenario to cover in manual QA. |
- Debounce rapid delegate-row taps so overlapping SET_VACATION_DELEGATE requests can't race and navigate on a stale response - Keep the missing-workspaces screen rendering from the submitted input instead of Onyx once submit clears the flow state, so it no longer flashes NotFoundPage/the previous delegate while the RHP is closing - Only roll back the delegate on unmount if this screen ever saw an active policy-diff flow, so a stray visit after the flow ended can't wipe out an unrelated, already-saved delegate - Fall back to a placeholder name for a workspace missing from Onyx
|
@MelvinBot could you check backend/OldDot parity with the current implementation in this PR? For the "Admin of some" (mixed) case, does Classic send an email to the owners of the workspaces you don't administer when skipping, or does it match this PR's current behavior of sending no email at all? |
|
Classic sends the email. In the "admin of some" (mixed) case, Classic emails the owner (with the other admins in cc) of every missing workspace you don't administer, whether you invite now or do it later. It has no way to suppress that — "do it later" issues the same plain One more signal that Skip is over-reaching: the backend only ever emails workspaces where you are not an admin. In the "admin of all" case Suggested change: use Caveat before you change it: the FE issue's own spec table says Skip → emails "none", so the divergence may be intentional. How I verified this
I could not read the Auth/PHP implementations directly in this run (no access to those repos), so the "not scoped to admin workspaces" claim rests on the written backend spec rather than on the merged code. If you want that nailed down, ask |
…tic delegate when request rejects, disable invite until every admin policy that is missing is loaded, foramt sms delegate logins as phone numbers, add selectors to onyx subscriptions, switch setDomainVacationDelegate to API.write
…selecting a delegate
…ff-warning-rhp-vacation-delegate
|
@MelvinBot could you re-review it? |
Re-review at
|
| Step | Status | Observation |
|---|---|---|
| Navigate to Settings > Profile > Status > Vacation delegate, no console errors | fail | Render tree empty (0 nodes), screenshot pure white; dev server returned 200 with valid HTML and a clean webpack build, so the blockage was client/session-side |
| List offers a selectable person, or shows the cannot-set message | fail | Settings/Status never reachable |
| Selecting a delegate doesn't flash a not-found page and saves | fail | Not reachable |
| No JS console errors throughout | fail | Not obtainable — log access unsupported for this web session |
…isting selector instead of newly created policyExpenseChatReportsSelector, build the policy expense chat report actions at invite time instead of in a per render useOnyx selector, remove no-op guard from delete branch, skip setVacationDelegate response navigation when the screen has lost focus, show loading indicator while vacation delegate is still hydrating
…-warning-rhp-vacation-delegate
…r clearing up the selected delegate
…ff-warning-rhp-vacation-delegate
…PI and align the styling
|
@MelvinBot are those regressions caused by this PR, not happening on |
|
Yes — all four are PR-caused. I re-checked each one by diffing base One correction first: the screenshot I attached to #1 was not proof. 1. Display name → raw login
The strongest evidence is the test this PR deleted, which asserted exactly this: await selectRowAndFlush(EMAIL_DELEGATE, 'Jane Doe');
expect(mockShowConfirmModal).toHaveBeenCalledWith(expect.objectContaining({prompt: 'statusPage.vacationDelegateWarning(Jane Doe)'}));So on 2. Selection blocked behind the write queue
Confirmed by code only — I didn't build an offline backlog and reproduce the visible stall. 3. 305 without
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35cac1ff22
ℹ️ 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".
|
@mkhutornyi can you please complete the review? |
|
Waiting for #99460 (comment) and bot comments to be addressed |
|
Codex Review: Didn't find any major issues. Chef's kiss. 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". |
|
Reviewed the current head ( Four things left worth deciding on, all minor. Only the first is one I'd actually fix. 1. The pick shows no feedback while it waits on the write queueThis is the one open Codex comment I'd still act on. So during that await there's no Offline is safe — SequentialQueue.ts:673 resolves 2.
|
|
@mkhutornyi could you take a look? thanks! |
|
|
||
| WorkspaceSection.displayName = 'WorkspaceSection'; |
There was a problem hiding this comment.
Not needed
| WorkspaceSection.displayName = 'WorkspaceSection'; |
There was a problem hiding this comment.
Btw I noticed many new feature PRs keep adding displayName in new components despite the rule already exists in guideline:
https://github.com/Expensify/App/blob/main/contributingGuides/STYLE.md#function-component-style
Should we add lint rule to automatically prevent this further?
mountiny
left a comment
There was a problem hiding this comment.
Thanks for addressing those
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.82-0 🚀
|
|
🤖 Yes, help site changes are required. Draft PR: Docs updates for E/A#99460 vacation delegate missing workspaces invite step docs/articles/new-expensify/settings/Delegate-when-out-of-office.md only documented the old behavior. Its FAQ said that when a delegate isn't part of your workspace, "Workspace Admins will be notified by email and prompted to add them" — with no mention that you can now invite the delegate yourself from the new RHP step. What the article now covers:
Verification and guideline complianceEvery UI label was verified against a live dev NewDot web session rather than read from the source strings alone: the Account > Profile > Status path, the Vacation delegate row, the Name, email, or phone number field, the You are an admin of these workspaces: heading, and the Invite / Skip buttons. The missing-workspaces step was reproduced by inviting a test account to one workspace and creating a second one it wasn't a member of. The absence of a confirmation prompt on removal was also confirmed live. Per No other article needed changes. The Expensify Classic delegate article documents Classic, which this PR doesn't touch, and the cross-link from @war-in, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
Deploy Blocker #101498 was identified to be related to this PR. |



Explanation of Change
Replaces the vacation delegate's blocking "policy diff" warning with an RHP step (
VacationDelegateMissingWorkspacesPage). When the delegate isn't a member of every affected workspace, it lets the user invite them straight into the workspaces they admin - any workspace they don't admin still gets its real admins emailed, or skip entirely and just save the delegate, with no invites or emails sent to admin policies.Fixed Issues
$ #99078
PROPOSAL:
Tests
"member of" section and a single "Confirm" button > tap Confirm > verify the delegate is saved.
of" section with Invite/Skip buttons > tap Invite > verify the delegate is saved and the user is
added as a member to each listed workspace.
buttons > tap Skip > verify the delegate is saved without adding the user to any workspace.
delegate reverts to what it was before.
Offline tests
N/A
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
MacOS: Chrome / Safari
Screen.Recording.2026-09-04.at.08.36.53.mov