Repository navigation
Remove isTrackIntentUser guards from search menu sections - #91252
Conversation
Track-intent users who later enable approvals and/or payments under Workflows don't see submit/approve/pay/export menu items on Reports page because the isTrackIntentUser guard unconditionally hides them. The policy-level checks in getSuggestedSearchesVisibility() already correctly evaluate whether these features are enabled. Removing the static onboarding-based guard lets those checks drive visibility. Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot can you please update tests appropriately to maintain proper coverage |
Add reimbursementChoice and reimburser to the mock policy so isPolicyPayer returns true, and restore the PAY assertion that was dropped when removing the isTrackIntentUser guard. Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
|
@hoangzinh @dangrous One of you needs to 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] |
|
Updated the test to properly cover all four menu keys (submit, approve, pay, export):
The existing test at line 6580 ("should not show todo section when user has no appropriate permissions") already covers the negative case — it uses a personal policy without approvals and verifies that none of the TODO keys (submit/approve/pay/export) appear. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-05-25.at.13.49.19.movAndroid: mWeb ChromeScreen.Recording.2026-05-25.at.10.52.19.moviOS: HybridAppScreen.Recording.2026-05-25.at.14.17.16.moviOS: mWeb SafariScreen.Recording.2026-05-25.at.13.52.02.movMacOS: Chrome / SafariScreen.Recording.2026-05-25.at.10.49.27.mov |
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ 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". |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Makes sense 👍
|
@MelvinBot In the test case's step 3:
But when testing, the Drafts option is still visible. Could you investigate? |
|
Good catch. "Drafts" is still visible because the SUBMIT visibility check doesn't depend on approval settings — it only requires the policy to be a TEAM or CORPORATE type. Why it happens: When a track-intent user onboards, a TEAM policy is created ( Additionally, the track-intent workspace is created with The core issue: This PR assumed the policy-level checks in The fix likely needs to either:
|
|
@dangrous Could you take a look into this #91252 (comment)? |
|
@MelvinBot to be safe, let's update that one to check if they're |
…flows disabled Instead of completely removing the isTrackIntentUser guard, update it to check !(isTrackIntentUser && !hasAnyPolicyWithWorkflowsEnabled). This hides SUBMIT, APPROVE, PAY, EXPORT, and TOP_SPENDERS only when the user is a track-intent user AND none of their policies have workflows enabled. Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
|
lol, was trying to get an internal reviewer. That did not work, sigh. Maybe @truph01 if you approve again it'll ask someone else? |
|
@dangrous I approved again |
This comment was marked as duplicate.
This comment was marked as duplicate.
|
@arosiclair 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] |
|
@arosiclair looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
Everything was passing |
|
🚧 @arosiclair 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/arosiclair in version: 9.3.84-0 🚀
Bundle Size Analysis (Sentry): |
|
I reviewed the changes in this PR against the help site files under No help site changes are required. This PR removes
The docs are already aligned with the post-fix behavior (feature/role checks drive visibility). No updates needed. @dangrous, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to staging by https://github.com/arosiclair in version: 9.3.86-0 🚀
Bundle Size Analysis (Sentry): |
|
I reviewed the changes in this PR against all help site articles under Why: This PR fixes a bug where track-intent users couldn't see Submit, Approve, Pay, Export, and Top Spenders search items after enabling Workflows. The existing help docs already describe visibility based on role (submitter, approver, admin) — not onboarding intent — so they already reflect the correct post-fix behavior:
No article referenced the previous buggy behavior, so no updates are needed. @dangrous, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to staging by https://github.com/arosiclair in version: 9.3.88-0 🚀
Bundle Size Analysis (Sentry): |
|
👋 I reviewed the changes in this PR against the help site articles under No help site changes are required. This PR fixes a bug where track-intent users who later enable Workflows couldn't see the submit, approve, pay, export, and top spenders menu items on the Spend page. The fix changes an unconditional The relevant help site articles already describe the correct (post-fix) behavior:
Since the articles already describe the intended behavior and none of them reference the track-intent user limitation that this PR removes, no documentation updates are needed. @dangrous, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.88-2 🚀
|
Explanation of Change
Track-intent users who later enable approvals and/or payments under Workflows don't see the submit, approve, pay, or export menu items on the Reports/Search page. This is because
isTrackIntentUser— based on the immutableNVP_INTRO_SELECTEDonboarding choice — unconditionally gates these items increateTypeMenuSections().The policy-level checks in
getSuggestedSearchesVisibility()already correctly evaluate whether approvals and payments are enabled for the user's policies. This PR removes the threeisTrackIntentUserguards and lets the existing policy checks drive visibility. It also cleans up the now-unusedisTrackIntentUserparameter, selector, and Onyx subscription.Fixed Issues
$ #91237
PROPOSAL: #91237 (comment)
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.
Offline tests
QA Steps
// 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari