Only show "New role types for admins" window to returning Collect/Control admins - #98953
Only show "New role types for admins" window to returning Collect/Control admins#98953MelvinBot wants to merge 1 commit into
Conversation
…mins Co-authored-by: Carlos Miceli <carlosmiceli@users.noreply.github.com>
Android testing — "New role types for admins" windowI ran the PR on the Android emulator (branch ✅ Scenario 3 — Brand-new user does NOT see the window (verified)The test account had zero workspaces before this run. Onboarding created its first workspace (type: Collect, account is Owner/admin) today, 2026-08-19 — which is on/after the Observed: no "New role types for admins" window (or any product marketing popup) appeared on Home — checked immediately after onboarding and again after navigating away and back. This matches the expected behavior. ✅
(Screenshots posted in the follow-up comment.)
|
Web testing — "New role types for admins" windowI ran the PR on web (dev NewDot, branch ✅ Negative case — no admin workspace → no window (verified)This web test account had zero workspaces ("No workspaces yet" in Settings → Workspaces), so it has no Collect/Control admin role and doesn't qualify for the window. As expected, no "New role types for admins" popup (or any product marketing modal) appeared on Home. ✅
(Screenshots posted in the follow-up comment.) Note: the "Discover" feed on Home does contain a normal card item ("Scoped admin roles, plus HR & AI updates") — that's the standard in-feed content, not the gated product marketing modal this PR governs.
|
Explanation of Change
The "New role types for admins" product marketing window was shown to any user who is an admin on any active workspace, with no check for the user's plan tier or how new they are. As a result it appeared for Submit admins and for brand-new users, neither of which should see it.
This PR adds two gates so the window is only shown to returning Collect/Control admins:
ProductMarketingWindowManagernow filters the admin workspaces used to pick the target policy down to Collect (team) and Control (corporate) types. Submit (submit2026) admins no longer resolve a target admin policy, so they fall through to the (absent) member variant and see nothing.returningUserCutoffDate, and a new pure helperisBrandNewUsercompares it againstnvp_private_firstPolicyCreatedDate(mirroring the existinguseHasTeam2025Pricingpattern). Users whose first workspace was created on or after the cutoff are treated as brand-new and skip the window. When the creation date is unknown, the user is treated as returning so established admins are never wrongly excluded.Note for reviewers: the cutoff date is set to
2026-07-01to match theproductUpdateJuly2026update key — please confirm the exact launch date for the role-types feature. If a backend-provided eligibility signal is preferred over the client-side date check, that can be swapped in behind the same helper.🤖 Generated with MelvinBot. AI checks run locally and passing:
typecheck-tsgo,lint-changed,react-compiler-compliance-check,oxfmt, and theProductMarketingWindowUtilsunit suite (15 tests). A web smoke test could not complete because the dev server wasn't serving in the CI environment (blank page, no network activity), so please validate the flows below manually before marking ready.Fixed Issues
$ #98951
PROPOSAL: #98951 (comment)
Tests
// TODO: The human co-author must fill out the tests they ran before marking this PR as "ready for review". Suggested coverage: (1) a returning admin of a Collect/Control workspace (first workspace created before the cutoff) sees the "New role types for admins" window on Home; (2) a Submit-only admin does NOT see it; (3) a brand-new user (first workspace created on/after the cutoff) does NOT see it.
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 stepssectionAvatar, 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.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