Repository navigation
Description
Updated 2026-05-20: Corrected based on feedback from dylanexpensify.
Summary
Track-intent users who later enable approvals and/or payments under Workflows don't see the corresponding action menu items (submit, approve, pay, export) on the Reports/Search page, even though those features are now active in their workspace.
Root Cause
In src/libs/SearchUIUtils.ts (lines ~4325-4390), there's a hard if (!isTrackIntentUser) gate that unconditionally hides these menu items based on the user's original onboarding choice (NVP_INTRO_SELECTED.choice). This check is based on what was selected during initial onboarding and never changes afterward, even if the user later enables advanced features.
The policy-level visibility checks (e.g., approvalMode, isPolicyApprover, arePaymentsEnabled) are never reached because the isTrackIntentUser guard short-circuits them. Specifically, getSuggestedSearchesVisibility() already checks whether approvals and/or payments are enabled under Workflows for the user's policies, but those results are discarded by the outer guard.
Expected Behavior
When a track-intent user enables approvals and/or payments under Workflows, they should see the submit, approve, and pay menu items on the Reports page — the same as non-track-intent users with the same workspace configuration.
Current Behavior
Submit, approve, pay, and export menu items remain permanently hidden on the Reports page for track-intent users, regardless of whether approvals or payments are enabled under Workflows.
Affected Code
src/libs/SearchUIUtils.ts—isTrackIntentUserguard gatesrc/libs/OnboardingUtils.ts—isTrackOnboardingChoicefunction (only checks initial onboarding choice, not current workspace state)
Fix
Remove the isTrackIntentUser guards in SearchUIUtils.ts and let the existing policy-level checks in getSuggestedSearchesVisibility() drive visibility. That function already returns the correct result based on whether approvals and/or payments are enabled under Workflows — submit shows when the user has a paid policy, approve shows when approval mode is enabled and the user is an approver, pay shows when the user is a payer and payments are enabled, etc.
Reproduction Steps
- Sign up with Track intent
- Enable approvals and/or payments under Workflows
- Navigate to Reports/Search page
- Expected: See submit/approve/pay menu items
- Actual: Menu items remain hidden
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022057176681335999562
- Upwork Job ID: 2057176681335999562
- Last Price Increase: 2026-05-20
Activity
dylanexpensify commentedon May 20, 2026
@MelvinBot propose how you'd fix this
MelvinBot commentedon May 20, 2026
Updated 2026-05-20: Corrected based on feedback from
dylanexpensify.Proposal
What is the root cause of that problem?
In
SearchUIUtils.ts, theisTrackIntentUserboolean — derived from the immutableNVP_INTRO_SELECTEDonboarding choice viaisTrackOnboardingChoice()— unconditionally gates the submit, approve, pay, export, and top-spenders menu items. This value is set once during onboarding and never changes, even when the user later enables approvals and/or payments under Workflows.The policy-level visibility checks in
getSuggestedSearchesVisibility()already correctly evaluate whether approvals and/or payments are enabled under Workflows for the user's policies. Specifically:But these results are never used because the
isTrackIntentUserguard short-circuits them at three locations:What changes do you think we should make in order to solve the problem?
Remove the three
if (!isTrackIntentUser)guards at lines 4325, 4380, and 4458 inSearchUIUtils.ts. ThegetSuggestedSearchesVisibility()function already returnsfalsefor these search keys when the user has no approvals or payments enabled under Workflows — so the guards are redundant for users who haven't enabled these features, and harmful for those who have.Once the guards are removed, clean up the now-unused
isTrackIntentUserparameter fromcreateTypeMenuSections()and theTypeMenuSectionsParamstype, and remove theisTrackIntentUserSelectorOnyx subscription inuseSearchTypeMenuSections.ts.What alternative solutions did you explore? (Optional)
An alternative would be making the gate dynamic (e.g.,
isTrackIntentUser && !hasAdvancedPolicyFeatures), but this adds complexity for no benefit —getSuggestedSearchesVisibility()already encodes the exact same policy-level checks for approvals/payments and returnsfalsewhen those features aren't enabled.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.melvin-bot commentedon May 20, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @nyomanjyotisa (
External)[-]Track-intent users with approvals enabled don't see submit/approve/pay menu items on Reports page[/-][+][$250] Track-intent users with approvals enabled don't see submit/approve/pay menu items on Reports page[/+]melvin-bot commentedon May 20, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022057176681335999562
dylanexpensify commentedon May 20, 2026
@MelvinBot update the OP and solution to note that the logic for showing the submit/approve/pay menu items on the Reports page is based on having approvals and/or payments enabled under workflows
17 remaining items
melvin-bot commentedon May 28, 2026
@truph01 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
melvin-bot commentedon Jun 2, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jun 3, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
truph01 commentedon Jun 5, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR:
Link to the comment on the Issue:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-39ce-a2ac-ab76-bad272670624mallenexpensify commentedon Jun 5, 2026
Payment Summary
Contributor+: @truph01 due $250 via NewDot
^ Test case created. Thx
garrettmknight commentedon Aug 10, 2026
$250 approved for @truph01