Skip to content

[Due for payment 2026-06-04] [$250] Track-intent users with approvals enabled don't see submit/approve/pay menu items on Reports page #91237

Closed

Description

@melvin-bot

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 — isTrackIntentUser guard gate
  • src/libs/OnboardingUtils.ts — isTrackOnboardingChoice function (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

  1. Sign up with Track intent
  2. Enable approvals and/or payments under Workflows
  3. Navigate to Reports/Search page
  4. Expected: See submit/approve/pay menu items
  5. 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
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 20, 2026
  2. dylanexpensify commented on May 20, 2026

    @dylanexpensify
    Contributor

    @MelvinBot propose how you'd fix this

  3. MelvinBot commented on May 20, 2026

    @MelvinBot
    Contributor

    Updated 2026-05-20: Corrected based on feedback from dylanexpensify.

    Proposal

    What is the root cause of that problem?

    In SearchUIUtils.ts, the isTrackIntentUser boolean — derived from the immutable NVP_INTRO_SELECTED onboarding choice via isTrackOnboardingChoice() — 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:

    • Submit shows when the user has a paid group policy
    • Approve shows when approval mode is enabled (not OPTIONAL) and the user is an approver
    • Pay shows when the user is a payer and payments are enabled under Workflows

    But these results are never used because the isTrackIntentUser guard short-circuits them at three locations:

    1. Line 4325 — hides submit, approve, and pay
    2. Line 4380 — hides export
    3. Line 4458 — hides top-spenders

    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 in SearchUIUtils.ts. The getSuggestedSearchesVisibility() function already returns false for 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 isTrackIntentUser parameter from createTypeMenuSections() and the TypeMenuSectionsParams type, and remove the isTrackIntentUserSelector Onyx subscription in useSearchTypeMenuSections.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 returns false when those features aren't enabled.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 20, 2026
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 20, 2026
  6. melvin-bot commented on May 20, 2026

    @melvin-bot
    Author

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @nyomanjyotisa (External)

  7. changed the title [-]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[/+] on May 20, 2026
  8. melvin-bot commented on May 20, 2026

    @melvin-bot
    Author
  9. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 20, 2026
  10. dylanexpensify commented on May 20, 2026

    @dylanexpensify
    Contributor

    @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

  11. 17 remaining items

  12. melvin-bot commented on May 28, 2026

    @melvin-bot
    Author

    @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]

  13. melvin-bot commented on Jun 2, 2026

    @melvin-bot
    Author

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  14. melvin-bot commented on Jun 3, 2026

    @melvin-bot
    Author

    Payment Summary

    Upwork Job

    • Reviewer: @truph01 owed $250 via NewDot

    BugZero Checklist (@mallenexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/2057176681335999562/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  15. truph01 commented on Jun 5, 2026

    @truph01
    Contributor

    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:

    1. Create a new user and select "Track expense for my business" in onboarding
    2. Go to "Spend"
    3. Confirm there is no "Drafts" or "Needs Approval" in the LHN for search
    4. Turn on Workflows and Approvals
    5. Return to "Spend"
    6. Confirm "Drafts" and "Needs Approval" ARE in the LHN for search

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-39ce-a2ac-ab76-bad272670624
  16. mallenexpensify commented on Jun 5, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @truph01 due $250 via NewDot

    ^ Test case created. Thx

  17. garrettmknight commented on Aug 10, 2026

    @garrettmknight
    Contributor

    $250 approved for @truph01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions