feat: Add Vacation delegate view for the delegate#78432
feat: Add Vacation delegate view for the delegate#78432samranahm wants to merge 24 commits intoExpensify:mainfrom
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 ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
There was a problem hiding this comment.
Pull request overview
This PR adds a vacation delegate view for users who are currently acting as delegates for other members. When a user is set as a vacation delegate by others, they cannot set their own vacation delegate, and instead see a list of all members who have delegated to them.
Key Changes:
- Added
delegatorForfield toVacationDelegatetype to track users delegating to the current user - Implemented conditional rendering in StatusPage to show delegator list when user has active delegations
- Added translations for the "cannot set vacation delegate" message across all supported languages
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/types/onyx/VacationDelegate.ts | Added delegatorFor field to track array of delegator emails |
| src/pages/settings/Profile/CustomStatus/StatusPage.tsx | Added conditional UI to display delegators list or vacation delegate settings based on delegation status |
| src/languages/en.ts | Added English translation for "cannot set vacation delegate" message |
| src/languages/es.ts | Added Spanish translation |
| src/languages/de.ts | Added German translation |
| src/languages/fr.ts | Added French translation |
| src/languages/it.ts | Added Italian translation |
| src/languages/ja.ts | Added Japanese translation |
| src/languages/nl.ts | Added Dutch translation |
| src/languages/pl.ts | Added Polish translation |
| src/languages/pt-BR.ts | Added Portuguese (Brazil) translation |
| src/languages/zh-hans.ts | Added Chinese (Simplified) translation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Weird, Melvin bot added many reviewers |
@samranahm You missed the link to the Slack message in the checklist |
|
@samranahm Please fill in the QA steps as well |
|
@huult Please take a look. |
|
@Beamanator Will this API be ready this week? |
|
@huult All three errors have been fixed. Please take a look and let me know what you think. Kapture.2026-01-26.at.13.38.54.mp4 |
|
@huult Friendly bump. |
|
@samranahm I’ll check it today and update you. |
|
Got it, Thank you 🙌 |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-01-27.at.13.47.31.mp4Android: mWeb ChromeScreen.Recording.2026-01-27.at.13.49.24.mp4iOS: HybridAppScreen.Recording.2026-01-27.at.13.53.30.mp4iOS: mWeb SafariScreen.Recording.2026-01-27.at.13.54.47.mp4MacOS: Chrome / SafariScreen.Recording.2026-01-27.at.13.42.30.mp4 |
|
@Beamanator All yours. |
…gate-in-status-page
|
Resolved merge conflicts. |
|
@samranahm please resolve the conflict! |
…gate-in-status-page
|
Resolved merge conflicts. |
|
@Beamanator Friendly bump. |
|
Back to this today, sorry for the delay!! |
|
Let me merge main to fix failing check. |
|
darnnn still broken - rerunning.... |
|
Nothing in our PR seems to be causing this, not sure why it’s happening. |
|
Ah, it still doesn’t fix the issue. |
|
discussing a bit here - https://expensify.slack.com/archives/C01GTK53T8Q/p1770324127028209 |
|
@samranahm can you please pull main once more? I think a few eslint errors may have been fixed very very recently |
| @@ -1,14 +1,16 @@ | |||
| import React, {useCallback, useEffect, useMemo, useState} from 'react'; | |||
| import {View} from 'react-native'; | |||
| import {Text, View} from 'react-native'; | |||
There was a problem hiding this comment.
@samranahm this is causing the failure. 'Text' import from 'react-native' is restricted.
There was a problem hiding this comment.
Thanks a lot @Krishna2323. That was indeed causing the failure, and it’s fixed now.
|
All tests are passing 🎆. @Beamanator, please have a look. |
| success | ||
| large | ||
| style={styles.w100} | ||
| text={translate('statusPage.save')} | ||
| onPress={() => formRef.current?.submit()} | ||
| pressOnEnter | ||
| enterKeyEventListenerPriority={1} | ||
| /> | ||
| </FixedFooter> | ||
| </ScreenWrapper> | ||
| ); | ||
| } |
There was a problem hiding this comment.
@samranahm Two questions about moving the submit button out of FormProvider and into a standalone FixedFooter:
-
Loading/disabled state:
FormProvider's built-in submit button automatically shows a spinner and disables itself during form submission. This standaloneButtondoesn't have that behavior, so there's a potential double-submission risk if the user taps quickly. Was this considered, or is there something else preventing it? -
Button visibility when
hasActiveDelegationsis true: TheFixedFooteris rendered unconditionally outside the form, so when a delegate sees the "you can't set a vacation delegate" message, they still see a "Save" button at the bottom. I assume this is intentional since the status/emoji form fields above still need saving — just want to confirm the UX is correct in that state.
There was a problem hiding this comment.
@Beamanator Thank you for the review and for catching important points!
-
Loading/disabled state: You're absolutely right about the double-submission risk (Although we navigate back immediately on first submit, but we should handle any edge case). Let me implemented the same loading state logic that
FormProvider's built-in button uses. -
Button visibility when hasActiveDelegations is true: Yes, this is intentional! When a user is acting as a delegate, they can't set a vacation delegate themselves, but they can still update their status and clear it after settings.

Explanation of Change
We're adding the Vacation Delegate view for delegates on the Status page.
Fixed Issues
$ #78037
PROPOSAL: #78037 (comment)
Tests
Precondition: User A is not a delegate for anyone.
User B get the "You can't set a vacation delegate..." message along with users list
User A get the normal flow to update the Vacation delegate
Verify that no errors appear in the JS console
Offline tests
QA Steps
Same as test
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodhttps://expensify.slack.com/archives/C01GTK53T8Q/p1766623850302279?thread_ts=1766599753.847719&cid=C01GTK53T8Q
STYLE.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.Will add the Screenshots/Videos of remaining platforms once the BE update deployed.
Screenshots/Videos
Android: Native
Android.Native.1.mov
Android: mWeb Chrome
Android.mWeb.Chrome.1.mov
iOS: Native
IOS.Native.1.mov
iOS: mWeb Safari
IOS.mWeb.Safari.1.mov
MacOS: Chrome / Safari
macOS.chrome.mov