Fix: Approver page shows empty state when prevent self-approvals is enabled#85036
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@marufsharifi I know this is still in draft, but I gave this a quick test run and I noticed there's a brief flash of the empty screen after you deselect the approver. I think ideally it should only change once the animation is complete. |
@jjcoffee, thanks, checking. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a06e9fafff
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsApproverPage.tsx
Show resolved
Hide resolved
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product
|
@jjcoffee, I've addressed all the comments, please take another look. thanks. |
|
@jjcoffee, gentle bump. thanks. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid-app-2026-03-12_11.33.06.mp4Android: mWeb Chromeandroid-chrome-2026-03-12_11.35.49.mp4iOS: HybridAppios-app-2026-03-12_11.04.01.mp4iOS: mWeb Safariios-safari-2026-03-12_11.05.50.mp4MacOS: Chrome / Safaridesktop-chrome-2026-03-12_10.56.04.mp4 |
|
@marufsharifi Have you retested since you made the recent changes? I can't deselect the approver anymore. desktop-chrome-2026-03-16_10.36.39.mp4 |
|
@jjcoffee I tested it, and it seems to be working fine on my end. Could you please take another look? Thanks! web.mp4 |
|
@marufsharifi Was that with a fresh account? I wonder if it's because I reused the same test account. |
|
@jjcoffee, I used a fresh account, thanks |
jjcoffee
left a comment
There was a problem hiding this comment.
LGTM! Can't reproduce this issue anymore.
|
@codex review |
| const isInitialCreationFlow = approvalWorkflow?.action === CONST.APPROVAL_WORKFLOW.ACTION.CREATE && approvalWorkflow?.isInitialFlow; | ||
| const currentApprover = approvalWorkflow?.approvers[approverIndex]; | ||
| const selectedApproverEmail = currentApprover?.email; | ||
| const visibleSelectedApproverEmail = removingApproverEmail ?? selectedApproverEmail; |
There was a problem hiding this comment.
Do you mind explaining in code comment, "why" we need this additional state variable alongside selectedApproverEmail?
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@MonilBhavsar, I've addressed your comment, please take another look. thanks. |
|
🚧 @MonilBhavsar 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/MonilBhavsar in version: 9.3.40-0 🚀
|
|
🚀 Deployed to staging by https://github.com/MonilBhavsar in version: 9.3.40-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.3.41-4 🚀
|
Explanation of Change
When “Prevent self-approvals” is enabled, the Approver picker should still show the currently selected approver so admins can review and remove them if needed. After removal, that same person must stay blocked from being re‑added (because they are also in “Expenses from”), which can result in an empty list. This keeps the UI consistent: you can see and remove an invalid approver, but you can’t reselect them once the policy disallows it.
Fixed Issues
$ #77034
PROPOSAL: #77034 (comment)
Tests
Precondition:
Offline tests
Same as Tests.
QA Steps
Same as Tests.
// TODO: These must be filled out, or the issue title must include "[No QA]."
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
Screen.Recording.2026-03-12.at.12.10.38.PM.mov
Android: mWeb Chrome
Screen.Recording.2026-03-12.at.12.15.11.PM.mov
iOS: Native
Screen.Recording.2026-03-12.at.12.55.28.PM.mov
iOS: mWeb Safari
Screen.Recording.2026-03-12.at.12.58.29.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-03-12.at.12.12.28.PM.mov