App icon indicating copy to clipboard operation
App copied to clipboard

[Due for payment 2026-12-08] [$175] Show the Account educational tooltip only to existing users on mobile

Open melvin-bot[bot] opened this issue 1 week ago • 19 comments

Problem

The Account tooltip (“Access your account and personal settings”) explains the recent navigation change, but it isn’t relevant to new users.

Expected behavior

  • Show the tooltip only to existing users on mobile, where Account moved to the top navigation.
  • Don’t show it to new users or on web.
  • Retain it for eligible existing users, including those who sign in only every 1–2 months.

Slack discussion

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @rojiphil

melvin-bot[bot] avatar Nov 18 '26 19:11 melvin-bot[bot]

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

Job added to Upwork: https://www.upwork.com/jobs/~022123143508372152775

@MelvinBot please make a proposal for this change.

flaviadefaria avatar Nov 18 '26 19:11 flaviadefaria

Proposal

What is the root cause of that problem?

The Account educational tooltip has no platform or existing-user eligibility check. Its condition always returns true; the Account button’s narrow-layout restriction also includes small browser windows. Consequently, newly onboarded users and web users can see it.

Code evidence

What changes do you think we should make in order to solve the problem?

  1. Restrict this educational tooltip to native iOS and Android. Keep the Account button, navigation, and ordinary Account hover tooltip unchanged.
  2. Restrict eligibility to accounts created before the navigation change, using a fixed rollout cutoff—not a moving account-age threshold.
  3. Use the personal policy’s creation date as the proposed signup-date proxy, following the existing App pattern. Hide the tooltip while that date is loading or unavailable.
  4. Preserve the existing dismissal identifier and behavior. Do not add an expiration date: eligible users returning after 1–2 months should still see it if they have not dismissed it.
  5. Apply eligibility before tooltip-priority selection so an ineligible Account tooltip cannot block another tooltip.

Before implementation: confirm the navigation rollout timestamp and that personal-policy creation dates reliably cover historical and migrated accounts. The issue does not establish either; missing dates must not silently exclude eligible existing users.

Implementation references and regression coverage

The product-training provider already subscribes to policies. Pass the personal-policy creation date into its eligibility conditions. The existing signup-date proxy provides precedent, but does not prove historical coverage.

Add tests covering:

  • Native existing users qualify; post-cutoff signups do not, including cutoff boundaries.
  • Desktop and mobile web never show the educational tooltip, including narrow layouts.
  • Loading or invalid dates do not cause a tooltip flash.
  • Undismissed existing users remain eligible after 60+ days; new users never age into eligibility.
  • Existing dismissals remain respected, and Account navigation still works.

What alternative solutions did you explore? (Optional)

A temporary display window would miss infrequent users. A narrow-screen check would still include web. Neither meets the requested behavior.


Next Steps for Contributor+ team: To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/107301) to create a draft PR. To refine: @MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.


view run

MelvinBot avatar Nov 18 '26 20:11 MelvinBot

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Nov 18 '26 20:11 melvin-bot[bot]

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~013b564a690d9bcdab

Proposal

Please re-state the problem that we are trying to solve in this issue.

The "Account moved to the top bar" educational tooltip shows to everyone on mobile, including brand-new users who never saw the old layout, and it also shows on web and mobile web, where the Account button never moved. Only existing users on native mobile should see it: they are the ones who knew the old layout and need to be told where the button went.

What is the root cause of that problem?

The tooltip has no eligibility check at all. It shows whenever the Account button renders and is focused, to any user, on any platform.

  1. ACCOUNT_MOVED_TO_TOP_BAR in src/components/ProductTrainingContext/TOOLTIPS.ts has shouldShow: () => true and priority 1700. It is the only tooltip in the file with an unconditional shouldShow.
  2. ProductTrainingContextProvider (src/components/ProductTrainingContext/index.tsx) passes only layout and role props into shouldShow (shouldUseNarrowLayout, isUserPolicyEmployee, isUserPolicyAdmin, hasBeenAddedToNudgeMigration, isUserInPaidPolicy). Nothing about platform or account age reaches the check.
  3. AccountAvatarButton (src/components/Navigation/AccountAvatarButton.tsx) returns null outside narrow layout, and registers the tooltip when the button is focused and the user is not anonymous (useProductTrainingContext(ACCOUNT_MOVED_TO_TOP_BAR, isFocused && !isAnonymousUser)). Narrow layout includes narrow browser windows on web, and the tooltip also renders on mobile web (commit 52cc69fc fixed its broken rendering there), so the unconditional shouldShow leaks onto web too.
  4. No existing-user signal is consulted anywhere in the tooltip path. I enumerated every consumer of this tooltip: TOOLTIPS.ts, CONST.PRODUCT_TRAINING_TOOLTIP_NAMES, the DismissedProductTraining type, AccountAvatarButton, and the provider. The fix belongs in the tooltip system itself, not in the button, so the tooltip never registers and never enters priority selection when the user is not eligible.

What changes do you think we should make in order to solve the problem?

Gate the tooltip on two things: native mobile, and an account that existed before the button moved.

  • New constant CONST.ACCOUNT_MOVED_TO_TOP_BAR_CUTOFF_DATE: '2026-09-09'. The date is anchored on the merge of the PR that moved the Account button to the top bar (commit d7e1a8ed, "[Insights] Move the Account button to the top bar", merged 2026-09-09). If the actual rollout to users happened on a different date, the constant is one line to adjust.
  • TOOLTIPS.ts: ACCOUNT_MOVED_TO_TOP_BAR.shouldShow takes two new props, isNativeApp and firstPolicyCreatedDate, and returns false when the app is not native, true when no start date is recorded or it cannot be parsed (fail-open, so an eligible existing user is never silently excluded), and otherwise true only when the account started before the cutoff. Policy dates are UTC DB timestamps without a timezone suffix, so the comparison parses them as UTC with fromZonedTime(date, 'UTC'), the same parsing isWithinGettingStartedPeriod and TooltipUtils.hasDismissalExpired already use.
  • ProductTrainingContext/index.tsx: the provider subscribes to NVP_PRIVATE_FIRST_POLICY_CREATED_DATE with useOnyx (a single server-written value, the same NVP useHasTeam2025Pricing already gates account age on) and computes isNativeApp from getPlatform() against CONST.PLATFORM.IOS / CONST.PLATFORM.ANDROID, the same comparison GetStateForActionHandlers.ts already uses. It passes both values into shouldShow.
  • The dismissal identifier and behavior are unchanged, and there is no expiry: an eligible user who opens the app rarely still sees the tooltip. Eligibility is evaluated at registration time (registerTooltip checks shouldTooltipBeVisible), so an ineligible Account tooltip never enters priority selection and cannot block another tooltip.

Tests. New tests/ui/components/ProductTrainingContextAccountTooltipTest.tsx, 16 tests, all passing with the fix. On the unfixed tree, 8 of them failed: every "should not show" case (new user on native, account created on the cutoff day, web, mobile web, and the priority-blocking case), while the 9 "should show" cases passed. The 16 tests cover:

  • Unit tests on TOOLTIPS[ACCOUNT_MOVED_TO_TOP_BAR].shouldShow: existing user on iOS and Android shows; new user on native does not show; account created on the cutoff day itself does not show (the cutoff is exclusive) while the day before shows; web does not show even to an existing user; missing or invalid start date shows (fail-open).
  • Provider tests with renderHook: existing user on native iOS shows; new user on native iOS does not show; web and mobile web do not show even to an existing user; missing start date shows; a dismissed tooltip stays dismissed; an ineligible Account tooltip does not block the GPS tooltip (highest-priority first still works); an existing user returning after 60+ days still sees the tooltip (no expiry).

One test was removed during development: a "does not show while the start date is still loading" case. The repo lint forbids isLoadingOnyxValue (no-onyx-loading-status, with a seatbelt that allows only the 4 grandfathered uses), because Onyx is dropping per-key loading status. Loading and missing are therefore the same undefined state, treated as eligible, and the app-level IS_LOADING_APP gate already hides every tooltip while the app itself is loading.

Related suites still green: ProductTrainingContextProvider (9/9), TooltipUtilsTest, useConnectionsMovedTooltip, plus the new file: 41/41 across 4 suites. lint-changed is clean, cspell reports 0 issues on the changed files, and the React Compiler compliance check passes. The full typecheck could not run on the prep VM (it OOMs at 6 GB, a machine limit, not a type error report); the change is a string constant, two new props on an existing type, and a useOnyx subscription following the existing pattern in the same file.

Lifecycle notes. Eligibility is derived fresh on every render from Onyx and getPlatform() (static per bundle); it is never cached in useState, so a re-render with a new object identity cannot strand a stale value. There are no list rows here (a single anchored tooltip, no FlatList recycling), so there is no recycling case. A remount re-reads Onyx, and the dismissal persists in NVP_DISMISSED_PRODUCT_TRAINING, so a dismissed tooltip stays dismissed across remounts. The cutoff is a constant, not a moving threshold, so the gate does not drift as the account ages.

What alternative solutions did you explore? (Optional)

  • Use the personal policy's created date as the signup-date proxy. Rejected: it needs a lookup over allPolicies to find which policy is "personal" and whether every account has one with a populated created date. The NVP_PRIVATE_FIRST_POLICY_CREATED_DATE NVP is a single server-written value with an established account-age gating precedent (useHasTeam2025Pricing gates on exactly this NVP against a cutoff date), so it answers the same question with less uncertainty.
  • Use a moving age threshold (for example, accounts older than 30 days) instead of a fixed cutoff. Rejected: a moving threshold would eventually hide the tooltip from users who still need it (infrequent users) and would show it to users who signed up after the move once they age past the threshold. A fixed cutoff tied to the date the button moved is the correct boundary.
  • Gate in AccountAvatarButton instead of the tooltip system. Rejected: the tooltip system is the source. Putting eligibility in shouldShow means the tooltip never registers and never enters priority selection when the user is not eligible; gating at the button would leave an eligible-looking tooltip registered in the system.
  • Use firstDayFreeTrial, the precedent from CONNECTIONS_MOVED. Rejected: free users have no trial date, so !firstDayFreeTrial would treat all new free users as existing. That precedent was also reverted in commit e3395a82. The first-policy NVP covers free and paid accounts alike.
  • Fail closed when the start date is missing or invalid. Rejected: it would silently exclude eligible existing users whose date was never recorded. Fail-open matches useHasTeam2025Pricing, which defaults a missing date to eligible.

dankezo avatar Nov 21 '26 15:11 dankezo

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Nov 21 '26 15:11 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

The "Account moved to the top bar" educational tooltip (ACCOUNT_MOVED_TO_TOP_BAR) currently displays to all signed-in users whenever the top-bar AccountAvatarButton renders in a narrow layout — including brand-new users who never saw the previous bottom-tab layout, desktop web users with narrow windows, and mobile web (mWeb) users.

It should only be shown to existing users on native mobile (iOS and Android), never to new users or on web/mWeb, while remaining available indefinitely (until dismissed) for eligible existing users who only sign in every 1–2 months.

What is the root cause of that problem?

  1. Unconditional tooltip eligibility: In src/components/ProductTrainingContext/TOOLTIPS.ts (ACCOUNT_MOVED_TO_TOP_BAR, priority 1700), shouldShow unconditionally returns true.
  2. Narrow layout does not equal native mobile: src/components/Navigation/AccountAvatarButton.tsx gates rendering on shouldUseNarrowLayout and registers the tooltip whenever isFocused && !isAnonymousUser. Because shouldUseNarrowLayout is also true on narrow desktop web windows and mobile web, the tooltip leaks onto web platforms.
  3. No account-age / existing-user signal reaches ProductTrainingContext: src/components/ProductTrainingContext/index.tsx only passes layout and workspace-role booleans (shouldUseNarrowLayout, isUserPolicyEmployee, isUserPolicyAdmin, hasBeenAddedToNudgeMigration, isUserInPaidPolicy) into tooltipConfig.shouldShow(...).

Why NVP_PRIVATE_FIRST_POLICY_CREATED_DATE with fail-open (proposed above) is unsafe here:

  • ONYXKEYS.NVP_PRIVATE_FIRST_POLICY_CREATED_DATE is a workspace-billing NVP (useHasTeam2025Pricing) that records when a user created a group/paid workspace — not when their account was created.
  • Brand-new personal/individual accounts and newly invited employees who never create a workspace have NVP_PRIVATE_FIRST_POLICY_CREATED_DATE === undefined. Failing open when missing would still show the tooltip to every new personal user and invited employee, violating "Don't show it to new users".
  • The codebase already documents and uses the user's personal policy created timestamp as the canonical client-side account signup proxy in src/pages/home/GettingStartedSection/hooks/useInviteeGettingStartedItems.ts ("The client has no account creation date, but every account gets its personal policy at signup"), because every Expensify account receives a CONST.POLICY.TYPE.PERSONAL policy at signup.
  • In addition, 2026-09-09 (d7e1a8ed) only introduced AccountAvatarButton behind the Insights beta gate; general removal of the beta gates occurred later (1238ef4f / c4a9a855, Oct 21–27), so anchoring strictly to the earlier beta merge date could exclude users who signed up before GA rollout.

What changes do you think we should make in order to solve the problem?

  1. Expose personalPolicyCreated through the existing policy selector (zero new Onyx subscriptions, zero new isLoadingOnyxValue lint violations):

    • In src/selectors/Policy.ts, extend ProductTrainingPolicyFlags and productTrainingPolicyFlagsSelector to also return personalPolicyCreated, extracted from the user's personal policy (policy?.type === CONST.POLICY.TYPE.PERSONAL) created field (matching useInviteeGettingStartedItems.ts).
    • Because ProductTrainingContextProvider (src/components/ProductTrainingContext/index.tsx) already subscribes to ONYXKEYS.COLLECTION.POLICY with productTrainingPolicyFlagsSelector and already guards hydration with isPolicyDataReady, no additional Onyx subscription or disallowed loading-status check is introduced.
  2. Pass native-platform and signup-date eligibility into TOOLTIPS[ACCOUNT_MOVED_TO_TOP_BAR].shouldShow:

    • In src/CONST/index.ts, add a single fixed UTC rollout cutoff constant for the Account top-bar move (defaulting to the GA rollout date confirmed by @flaviadefaria / @rojiphil before merge — easily updated in one line if an exact production deploy timestamp is preferred over Oct 21–27).
    • In src/components/ProductTrainingContext/index.tsx, compute isNativeMobile using getPlatform() (platform === CONST.PLATFORM.IOS || platform === CONST.PLATFORM.ANDROID, which cleanly excludes both desktop web and mWeb) and pass isNativeMobile and personalPolicyCreated: isPolicyDataReady ? policyFlags.personalPolicyCreated : undefined into tooltipConfig.shouldShow(...).
    • In src/components/ProductTrainingContext/TOOLTIPS.ts, update ShouldShowConditionProps and ACCOUNT_MOVED_TO_TOP_BAR.shouldShow to:
      • Return false if !isNativeMobile.
      • Fail closed (return false) when personalPolicyCreated is missing, still loading (undefined), or fails UTC parsing via fromZonedTime(personalPolicyCreated, 'UTC').getTime() (matching isWithinGettingStartedPeriod.ts), ensuring brand-new accounts and cold-start hydration never flash the tooltip.
      • Return true only when the parsed UTC signup timestamp is strictly earlier than the fixed rollout cutoff timestamp.
    • Keep reappearsAfterMs omitted and preserve the existing NVP_DISMISSED_PRODUCT_TRAINING dismissal behavior with no expiration window, so eligible existing users returning after 1–2+ months still see the tooltip until dismissed.
    • Because getVisibleTooltipName(activeTooltips, shouldTooltipBeVisible) in ProductTrainingContext/index.tsx checks !isEligible(tooltipName) before updating highestPriority, an ineligible ACCOUNT_MOVED_TO_TOP_BAR (priority: 1700) will never block lower-priority tooltips (such as CONNECTIONS_MOVED or ACCOUNT_SWITCHER).
    • Leave AccountAvatarButton, navigation, and its standard hover Tooltip unchanged.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

Add unit and provider-level tests (in tests/unit/ / tests/ui/components/) verifying:

  1. Existing user (personalPolicy.created before cutoff) on native iOS and Android → tooltip shows.
  2. Existing user on web (narrow viewport) and mobile web (mWeb) → tooltip does not show.
  3. New user (personalPolicy.created on or after cutoff) on native iOS and Android — including personal-only accounts and invited employees with no NVP_PRIVATE_FIRST_POLICY_CREATED_DATE → tooltip does not show.
  4. Missing, still-loading (undefined), or malformed personalPolicy.created → tooltip does not show (fail-closed, no cold-start flash).
  5. Eligible existing user returning 60+ days after the cutoff without dismissing → tooltip still shows; once dismissed, it stays dismissed.
  6. Priority non-blocking: when ACCOUNT_MOVED_TO_TOP_BAR is ineligible (e.g. new user or web) and a lower-priority tooltip is also registered, the lower-priority tooltip renders normally.

What alternative solutions did you explore? (Optional)

  • Gating on NVP_PRIVATE_FIRST_POLICY_CREATED_DATE with fail-open: Rejected because personal accounts and invited employees who never created a workspace do not have this NVP populated, so failing open would show the tooltip to new users.
  • Using a rolling account-age window (e.g. >30 days old): Rejected because newly created accounts would eventually become eligible after 30 days even though they never experienced the old navigation layout.
  • Gating inside AccountAvatarButton.tsx instead of ProductTrainingContext: Rejected because keeping all product-training eligibility inside TOOLTIPS.ts + ProductTrainingContextProvider matches existing tooltips (OUTSTANDING_FILTER) and centralizes priority arbitration.

danlopes18-ctrl avatar Nov 23 '26 17:11 danlopes18-ctrl

@rojiphil, @flaviadefaria Eep! 4 days overdue now. Issues have feelings too...

@rojiphil what do you think about the proposals above?

flaviadefaria avatar Nov 23 '26 23:11 flaviadefaria

@flaviadefaria @MelvinBot's proposal LGTM. The approach is right, and these implementation details were left open. 🎀👀🎀 C+ reviewed

@MelvinBot implement https://github.com/Expensify/App/issues/107301 with these details:

  • Gate ACCOUNT_MOVED_TO_TOP_BAR in shouldShow. Leave AccountAvatarButton, Account navigation, and the ordinary "Account" hover tooltip unchanged.
  • Show it only when getPlatform() is CONST.PLATFORM.IOS or CONST.PLATFORM.ANDROID. Call getPlatform() with no argument, so desktop web and mobile web both stay excluded.
  • Use the personal policy created value from the policy collection ProductTrainingContextProvider already subscribes to. That is the signup proxy in useInviteeGettingStartedItems. Do not add a useOnyx subscription or an isLoadingOnyxValue check.
  • Add CONST.ACCOUNT_MOVED_TO_TOP_BAR_CUTOFF_DATE as 2026-10-29 15:43:41, the merge time of https://github.com/Expensify/App/pull/104595 (when the button left the Insights beta). Parse created with fromZonedTime(created, 'UTC') and require it to be strictly earlier than that cutoff.
  • Return false while allPolicies is undefined, and when created is missing or cannot be parsed. If you find that older personal policies have no created, stop and report that instead of showing the tooltip with no date.
  • Keep the dismissal key accountMovedToTopBar and do not set reappearsAfterMs. An ineligible tooltip must not block a lower-priority one.

Cover native existing users, post-cutoff native signups, the cutoff boundary, narrow desktop web, mobile web, a missing or unparseable date, a user who returns after 60+ days without dismissing, and dismissal itself.

rojiphil avatar Nov 25 '26 03:11 rojiphil

Triggered auto assignment to @Julesssss, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

🤖 Android test steps verification results: ❌ fail

Implemented in draft PR: Limit Account educational tooltip to existing native users, assigned to rojiphil; 148 automated tests, lint, typecheck, formatting, spelling, and Storybook passed. Android device verification was blocked—not a confirmed behavior failure.

Step Status
Existing native users see the tooltipBlocked: emulator unavailable and no pre-cutoff account fixture available.
❌
Post-cutoff signups do not see the tooltipBlocked: emulator unavailable after retry; automated coverage passed.
❌
Dismissal persists and Account navigation worksDevice verification blocked. Automated permanent-dismissal coverage passed; Account navigation was unchanged.
❌

view run · no recording available

MelvinBot avatar Nov 25 '26 03:11 MelvinBot

Sorry to come into this late, though what do we think about removing the tooltip altogether at this point? We've had the new layout live for about a month now, so I question that we need it anymore.

@flaviadefaria wdyt?

JmillsExpensify avatar Nov 26 '26 08:11 JmillsExpensify

I think Flavia is out, so @rojiphil let's move forward with just removing the tooltip altogether.

JmillsExpensify avatar Nov 27 '26 12:11 JmillsExpensify

let's move forward with just removing the tooltip altogether.

Sure @JmillsExpensify. Moving forward as mentioned in the PR

rojiphil avatar Nov 27 '26 13:11 rojiphil

Thanks!

JmillsExpensify avatar Nov 27 '26 13:11 JmillsExpensify

I think Flavia is out, so @rojiphil let's move forward with just removing the tooltip altogether.

This was my initial proposal, I like it!

flaviadefaria avatar Nov 30 '26 10:11 flaviadefaria

@rojiphil

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.5.56-2 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/107920

If no regressions arise, payment will be issued on 2026-12-08. :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 Dec 01 '26 23:12 melvin-bot[bot]