Hide Edit expense context menu on settled/approved/closed reports#87650
Conversation
canEditReportAction delegates to canEditMoneyRequest which has an intentional admin/manager bypass for field-level coding edits. But this bypass also incorrectly enables the Edit expense context menu action on finalized expense reports. Add a settled/approved/closed check in canEditReportAction for money request actions so the context menu correctly hides the Edit button on finalized reports.
…xpense-context-menu-settled
…845-edit-expense-context-menu-settled
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp87650_android_native.movAndroid: mWeb Chromed 87650_android_web.moviOS: HybridApp87650_ios_native.moviOS: mWeb Safari87650_ios_web.movMacOS: Chrome / Safari87650_web_chrome.mov |
|
🚧 @Valforte 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/Valforte in version: 9.3.60-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This is a bug fix that hides the "Edit expense" context menu on settled/approved/closed expense reports. The existing help site articles already correctly document this behavior:
The PR aligns the UI with the already-documented expected behavior — no doc updates needed. |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.60-22 🚀
|
Explanation of Change
canEditMoneyRequestincludes an admin/manager bypass (viacanEditFieldOfMoneyRequest) that allows field-level edits on settled/approved/closed reports. However, this bypass also causescanEditReportActionto return true, which shows the "Edit expense" context menu option on finalized reports. This change adds an early return incanEditReportActionto block the context menu for money request actions when the parent expense report is settled, approved, or closed — before reaching thecanEditMoneyRequestcheck.Fixed Issues
$ #86845
PROPOSAL: #86845 (comment)
Tests
Offline tests
N/A — this change only affects whether the "Edit expense" context menu option is shown, which is a UI visibility check. No network calls are involved.
QA Steps
Same as Tests above.
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
Kapture.2026-04-11.at.14.13.34.mp4
Android: mWeb Chrome
Kapture.2026-04-11.at.14.27.30.mp4
iOS: Native
Kapture.2026-04-11.at.14.29.57.mp4
iOS: mWeb Safari
Kapture.2026-04-11.at.14.32.19.mp4
MacOS: Chrome / Safari
Kapture.2026-04-11.at.13.51.48.mp4