App icon indicating copy to clipboard operation
App copied to clipboard

[Due for payment 2026-11-18] [Insights][R4][App] Show the Compliance upsell

Open aldo-expensify opened this issue 2 months ago • 16 comments

Implement this section of the design doc: Show the Compliance upsell.

Description

Show a Control-plan upgrade state when none of the scoped workspaces are on Control.

  • Implement InsightsUpsellState using GenericEmptyStateComponent.
  • Add requiresControlPlan to the Compliance dashboard spec, and have InsightsDashboard evaluate the scoped workspaces using PolicyUtils.isControlPolicy.
  • Render the upsell in place of the charts when no scoped workspace is on Control.
  • Connect the CTA to ROUTES.WORKSPACE_UPGRADE, passing CONST.UPGRADE_FEATURE_INTRO_MAPPING.rules.alias as the feature name.
  • Pass the eligible owned workspace when exactly one scoped workspace can be upgraded; otherwise leave workspace selection open.

Acceptance criteria

  • [ ] The upsell appears when none of the scoped workspaces are on Control.
  • [ ] The upsell does not replace the charts when at least one scoped workspace is on Control.
  • [ ] The CTA opens the existing upgrade flow with the rules feature and the appropriate workspace selection.
  • [ ] Cover Control, non-Control, and mixed workspace scopes, plus zero, one, and multiple upgradeable owned workspaces.
  • [ ] Include relevant eligibility tests and manual upsell/upgrade-navigation regression steps.

Dependencies

  • https://github.com/Expensify/App/issues/102807
Issue OwnerCurrent Issue Owner: @mallenexpensify

aldo-expensify avatar Oct 01 '26 20:10 aldo-expensify

👋 you can assign me

adamgrzybowski avatar Oct 28 '26 15:10 adamgrzybowski

Assigning myself to review all [R4] issues, as discussed with truph

daledah avatar Oct 28 '26 15:10 daledah

The doc says to pre-select the workspace the user "owns". The upgrade page gates on admin, not owner, so an owner who isn't admin 404s.

@luacmartins OK to use the admin check instead?

adamgrzybowski avatar Oct 30 '26 13:10 adamgrzybowski

One more question @luacmartins

Should a Control workspace the user can't see data for (plain member, or archived) count as Control and show the charts? They'd be empty, since Compliance only reads data the user can see. I suggest ignoring those workspaces and showing the upsell.

adamgrzybowski avatar Oct 30 '26 14:10 adamgrzybowski

The doc says to pre-select the workspace the user "owns". The upgrade page gates on admin, not owner, so an owner who isn't admin 404s.

@luacmartins OK to use the admin check instead?

This sounds good to me. Maybe we can reuse the logic in canModifyPlan? @trjExpensify @JmillsExpensify

Should a Control workspace the user can't see data for (plain member, or archived) count as Control and show the charts? They'd be empty, since Compliance only reads data the user can see. I suggest ignoring those workspaces and showing the upsell.

Same as above, I think we can use that logic for any workspace the user can modify and show the upsell.

luacmartins avatar Oct 30 '26 19:10 luacmartins

Yeah, those work for me. Sounds good!

JmillsExpensify avatar Nov 01 '26 09:11 JmillsExpensify

Maybe we can reuse the logic in canModifyPlan?

Makes sense to me. I know we let any workspace admin upgrade the workspace with that project a while back. When they do, a message is posted in #admins for visibility and audit of who dun' it. 👍

trjExpensify avatar Nov 02 '26 22:11 trjExpensify

Deploy Blocker https://github.com/Expensify/App/issues/106513 was identified to be related to the PR https://github.com/Expensify/App/pull/105505 that attempted to fix this issue.

Chandkia24 avatar Nov 10 '26 16:11 Chandkia24

@daledah

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.5.35-3 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/105505

If no regressions arise, payment will be issued on 2026-11-18. :confetti_ball:

The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]. If no checklist is needed for this issue, you can click: [no checklist button]

melvin-bot[bot] avatar Nov 11 '26 00:11 melvin-bot[bot]

Contributor+ Checklist:

  • [x] [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: N/A

  • [x] [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:

  • [x] [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.

Regression Test Proposal

Precondition:

Test:

  1. As an admin of a Collect workspace (Compliance insights beta enabled), open Insights and select the Compliance tab.
  2. Verify the "Upgrade to Control for more insights" upsell is shown instead of charts.
  3. Press "Upgrade to Control" and verify the upgrade page opens for that workspace on the Rules feature. With several upgradeable workspaces in scope, verify the generic upgrade page opens instead.
  4. Add a Control workspace to the workspace filter and verify the charts replace the upsell.

Do we agree 👍 or 👎

daledah avatar Nov 11 '26 03:11 daledah

Triggered auto assignment to @mallenexpensify (Awaiting Payment)

Payment Summary

Resolving PRs:

  • https://github.com/Expensify/App/pull/105505

  • Contributor: @mhawryluk does not require payment (Contractor)

  • Reviewer: @daledah owed $175 via NewDot

BugZero Checklist (@mallenexpensify)

  • [ ] I have confirmed assignees, roles, and Upwork contracts look correct
  • [ ] I have paid out Upwork contracts / manual NewDot requests
  • [ ] [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon

Claude posting on behalf of Matt:

Ready. Job price: $250 (Insights project, bernhardoj assigned 2026-09-10).

  • daledah (C+): 50%, via NewDot

50%: deploy blocker 106513, from 105505, which daledah reviewed. It is still open.

daledah's only reply is "behind beta", posted on the sibling issue. RUBRIC: a beta is not a defence.

Next: press Caps+Y, then pay.

Evidence
  • C+ checklist, 5 steps: comment. It says N/A for the offending PR.
  • PR 105505: by adamgrzybowski (agency), merged 2026-11-09, production 2026-11-11, approved by daledah and luacmartins.
  • Test videos: C+ 1/1. TestRail case: none.

PAYPREP v1

mallenexpensify avatar Nov 19 '26 23:11 mallenexpensify

Payment Summary

Contributor+: @daledah due $125 via NewDot

Paying 50% cuz of regression, comment and reopen if you disagree.

mallenexpensify avatar Nov 20 '26 00:11 mallenexpensify

@mallenexpensify I think the payment should be $125 instead of $100, Could you please update the Payment Summary? 🙏

daledah avatar Nov 20 '26 12:11 daledah

@daledah you're correct! (that's me sounding like AI). Updated price.

mallenexpensify avatar Nov 20 '26 23:11 mallenexpensify