Skip to content

Suppress promo/training/onboarding modals during supportal sessions - #96284

Merged
cristipaval merged 20 commits into
mainfrom
vit/suppress-promo-modals-supportal
Jul 25, 2026
Merged

Suppress promo/training/onboarding modals during supportal sessions#96284
cristipaval merged 20 commits into
mainfrom
vit/suppress-promo-modals-supportal

Conversation

@mountiny

@mountiny mountiny commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Promotional, training, and onboarding UI is disruptive during ND Supportal sessions (Expensify staff logged into a customer account). It blocks navigation, slows initial load, and is embarrassing during customer demos. Supportal agents also can't act on these modals — e.g. the proactive app review modal returns a 411 and re-appears in a loop.

#96231 already gated the proactive app review modal on supportal/copilot. This PR reuses that same check across every promo/training/onboarding entry point, so all of this UI is suppressed for supportal (and copilot) sessions.

How it is shared:

  • isSupportalSessionSelector in src/selectors/Session.ts is the single supportal predicate (also reused by the existing isSupportalSession() action accessor).
  • useShouldSuppressPromotionalUI (supportal OR copilot) is used by React entry points. It reads SESSION/ACCOUNT via useOnyx selectors and fails closed — it returns true (suppress) while those keys are still loading, so a supportal/copilot session is never briefly treated as normal.
  • Navigation guards (non-React) read supportal state from GuardContext.isSupportalSession, computed once in src/libs/Navigation/guards/index.ts. OnboardingGuard additionally suppresses copilot via its existing ACCOUNT subscription; the migrated-user and submit-plan welcome guards are supportal-only by design (see PR discussion).
  • The change-policy educational modal is gated from DynamicReportChangeWorkspacePage (React), which passes the suppression flag into the action rather than reading Onyx at module level.

Wired into: proactive app review, AI features promo, product-training tooltips, migrated-user welcome, submit-plan welcome, onboarding (guard + hook + navigator mount), track-training modal, change-policy educational modal, multi-scan educational modal, and hold/reject educational modals (the underlying hold/reject action still runs; only the educational modal is skipped).

SupportalPermissionDeniedModal (the 411 reactive modal) is intentionally unchanged.

Fixed Issues

$ #96282
PROPOSAL:

Tests

  1. Support-login to a customer ND account (OldDot support login that transitions to NewDot with authTokenType=support).
  2. Confirm the "Enjoying New Expensify?" app review modal does not appear.
  3. Confirm the AI Features Promo modal does not appear on load.
  4. Using an account eligible for the migrated-user or submit-plan welcome modal, confirm neither modal appears.
  5. Using an account with incomplete onboarding, confirm the onboarding flow does not launch and the agent lands on the normal app view.
  6. Trigger flows that normally show training UI (start a track expense, change a report's workspace, hold/reject an expense, start a multi-scan) and confirm no training modals or tooltips appear.
  7. Confirm the hold/reject action still completes even though its educational modal is skipped.
  8. Sign in normally (non-supportal, non-copilot) and confirm all of the above modals still appear when eligible.
  9. As a supportal user, trigger an unauthorized write command and confirm SupportalPermissionDeniedModal still appears (411 behavior unchanged).
  • Verify that no errors appear in the JS console

Offline tests

Same as tests. This change only gates modal/UI visibility based on session and delegate state; it does not alter any network-dependent behavior for normal users.

QA Steps

  1. Support-login to a customer ND account.
  2. Confirm the "Enjoying New Expensify?" app review modal does not appear.
  3. Confirm the AI Features Promo modal does not appear on load.
  4. Using an account eligible for the migrated-user or submit-plan welcome modal, confirm neither modal appears.
  5. Using an account with incomplete onboarding, confirm the onboarding flow does not launch.
  6. Trigger flows that normally show training UI (track expense, change workspace, hold/reject, multi-scan) and confirm no training modals or tooltips appear.
  7. Sign in normally (non-supportal, non-copilot) and confirm all of the above modals still appear when eligible.
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Extend the app-review supportal/copilot gate from #96231 into a single
shared guard (shouldSuppressPromotionalUI) and reuse it across all promo,
training, and onboarding entry points so this UI is hidden for supportal
and copilot sessions.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mountiny
mountiny requested review from a team as code owners July 16, 2026 10:49
@melvin-bot
melvin-bot Bot requested review from heyjennahay and linhvovan29546 and removed request for a team July 16, 2026 10:50
@melvin-bot

melvin-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

@linhvovan29546 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot removed the request for review from a team July 16, 2026 10:50
@github-actions
github-actions Bot requested review from luacmartins and tgolen July 16, 2026 10:50
@github-actions

Copy link
Copy Markdown
Contributor

This PR adds a new Onyx.connectWithoutView call, so I've requested a review from the Onyx performance reviewers (@tgolen, @mountiny, @luacmartins) — a review from any one of them is enough. Please add a link in your PR description to the Slack discussion where the @frontend-performance team approved using connectWithoutView here.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 020ab35c31

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

}, [hasCompletedOnboarding]);

const isAllOnyxLoaded = !isLoadingOnyxValue(isLoadingAppMetadata, accountMetadata, dismissedProductTrainingMetadata, tryNewDotMetadata, onboardingMetadata);
const isAllOnyxLoaded = !isLoadingOnyxValue(isLoadingAppMetadata, dismissedProductTrainingMetadata, tryNewDotMetadata, onboardingMetadata);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Wait for account Onyx before showing AI promo

In copilot sessions where ONYXKEYS.ACCOUNT is still loading, useShouldSuppressPromotionalUI() evaluates the missing account as false; because this readiness check no longer includes the account metadata, isEligible can become true and schedule the AI promo before delegatedAccess.delegate arrives. That regresses the previous guard, which waited for accountMetadata, so large/slow copilot accounts can still see the promo modal this change is meant to suppress.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — fixed in 75f3a59. Restored the account load-metadata gate in isAllOnyxLoaded so eligibility waits for ONYXKEYS.ACCOUNT to load before scheduling the promo; suppression itself still flows through useShouldSuppressPromotionalUI.

Comment thread src/hooks/useShouldSuppressPromotionalUI.ts Outdated
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/components/ProductTrainingContext/index.tsx 91.50% <100.00%> (ø)
src/hooks/useOnboardingFlow.ts 82.35% <100.00%> (ø)
src/hooks/useProactiveAppReview.ts 70.58% <100.00%> (ø)
src/hooks/useShouldSuppressPromotionalUI.ts 100.00% <100.00%> (ø)
src/libs/Navigation/AppNavigator/AuthScreens.tsx 83.15% <100.00%> (ø)
...Navigation/guards/MigratedUserWelcomeModalGuard.ts 100.00% <100.00%> (ø)
src/libs/Navigation/guards/OnboardingGuard.ts 100.00% <100.00%> (ø)
...s/Navigation/guards/SubmitPlanWelcomeModalGuard.ts 97.32% <100.00%> (ø)
src/libs/Navigation/guards/index.ts 100.00% <ø> (ø)
src/libs/actions/Session/index.ts 42.50% <100.00%> (ø)
... and 6 more

@mountiny
mountiny marked this pull request as draft July 16, 2026 11:06
@mountiny

Copy link
Copy Markdown
Contributor Author

Sorry, this should have been created as a draft, not ready for a review yet

mountiny and others added 9 commits July 16, 2026 11:12
- Use a default export for the shouldSuppressPromotionalUI selector to satisfy import/prefer-default-export
- Swap the two Onyx.connectWithoutView subscriptions in PromotionalUIUtils for Onyx.connect

Co-authored-by: Cursor <cursoragent@cursor.com>
Delete PromotionalUIUtils (which used Onyx.connect, forbidden by the
no-onyx-connect lint rule) and instead reuse existing subscriptions:
- Welcome guards read supportal state from their existing session var
- OnboardingGuard reads it from a new GuardContext.isSupportalSession
  computed in guards/index.ts from its existing session subscription
- Report reuses NetworkStore.isSupportAuthToken for the change-policy modal

Co-authored-by: Cursor <cursoragent@cursor.com>
Compute suppression in DynamicReportChangeWorkspacePage via
useShouldSuppressPromotionalUI (useOnyx) and pass it into changeReportPolicy,
removing the NetworkStore read from the Report action. Welcome guards now read
supportal state from GuardContext.isSupportalSession in evaluate().

Co-authored-by: Cursor <cursoragent@cursor.com>
useShouldSuppressPromotionalUI now subscribes with primitive-returning
selectors (isSupportalSessionSelector, isActingAsDelegateSelector) so
consumers only re-render when the derived boolean can change (PERF-11).
Removes the now-unused combined selector and its test.

Co-authored-by: Cursor <cursoragent@cursor.com>
Covers regular sessions, support auth token, mid-transition
isSupportAuthTokenUsed, and copilot (delegate) sessions.

Co-authored-by: Cursor <cursoragent@cursor.com>
The guard's evaluate() reads context.isSupportalSession, so the test must
pass the flag via the guard context rather than the module-level session.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Covers support auth token, mid-transition isSupportAuthTokenUsed, and
non-supportal/empty/undefined sessions.

Co-authored-by: Cursor <cursoragent@cursor.com>
Restore the account load-metadata gate in useAIFeaturesPromoModal so the
promo isn't scheduled before ACCOUNT loads (which would miss the
copilot/delegate signal in slow sessions). Suppression still flows through
useShouldSuppressPromotionalUI.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mountiny
mountiny requested a review from Copilot July 16, 2026 14:21
@mountiny

Copy link
Copy Markdown
Contributor Author

@codex review
@MelvinBot review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 512bc6a7c0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const isInvitedOrGroupMember = (hasNonPersonalPolicy || wasInvitedToNewDot) ?? false;
if (isMigratedUser || isInvitedOrGroupMember) {
if (isMigratedUser || isInvitedOrGroupMember || shouldSuppressPromotionalUI) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fail closed until suppression state loads

In copilot sessions where ONYXKEYS.ACCOUNT is still loading, useShouldSuppressPromotionalUI() reports false because the delegate selector treats missing account data as non-delegate, and this effect does not wait for that key before it can call startOnboardingFlow() directly. Since the comment below notes this bypasses OnboardingGuard, a slow delegate account with incomplete onboarding can still be reset into onboarding before delegatedAccess.delegate arrives; please gate this decision on the suppression key metadata or make the suppression hook fail closed while loading.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mountiny Could you please take a look at this comment?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f81c7b5 by making the suppression hook fail closed: useShouldSuppressPromotionalUI() now returns true (suppress) while SESSION/ACCOUNT are still loading (via isLoadingOnyxValue on their metadata). So a copilot/supportal session is never briefly treated as normal, and this effect won't startOnboardingFlow() before delegatedAccess.delegate arrives. Added unit tests for both loading cases.

@linhvovan29546

Copy link
Copy Markdown
Contributor

I don't have access to a real Supportal session to test this directly, so I verified the behavior by mocking Supportal (and Copilot) state locally to exercise the exact code paths this PR changes. The suppression logic behaved as expected in every case I tested.

@linhvovan29546

linhvovan29546 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
telegram-cloud-document-5-6278098973831994522.1.mp4
Android: mWeb Chrome
telegram-cloud-document-5-6278098973831994521.1.mp4
iOS: HybridApp
Screen.Recording.2026-07-23.at.18.47.58.mov
Screen.Recording.2026-07-23.at.23.06.19.mov
iOS: mWeb Safari
Screen.Recording.2026-07-23.at.23.06.19.mov
MacOS: Chrome / Safari
Screen.Recording.2026-07-23.at.22.43.07.mov
Screen.Recording.2026-07-23.at.22.44.59.mov

@mountiny

Copy link
Copy Markdown
Contributor Author

I will test the supportal on the adhoc

@mountiny

Copy link
Copy Markdown
Contributor Author

Supportalled to a fresh account that should have onboarding modal - not shown ✅
image

Return true (suppress) while SESSION/ACCOUNT are still loading so a
supportal/copilot session is never briefly treated as normal - e.g. a
copilot on an un-onboarded account could otherwise be reset into
onboarding before delegatedAccess.delegate loads.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mountiny

Copy link
Copy Markdown
Contributor Author

@linhvovan29546 can you take a final look please?

Comment thread src/hooks/useAIFeaturesPromoModal.ts Outdated
const [isActingAsDelegate, accountMetadata] = useOnyx(ONYXKEYS.ACCOUNT, {selector: isActingAsDelegateSelector});
const shouldSuppressPromotionalUI = useShouldSuppressPromotionalUI();
// Only used for its load metadata: the promo must wait for ACCOUNT to load so a copilot/delegate session is detected before eligibility is decided
const [, accountMetadata] = useOnyx(ONYXKEYS.ACCOUNT, {selector: isActingAsDelegateSelector});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that useShouldSuppressPromotionalUI already handles the metadata. I think this code is now dead weight and can probably be removed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MelvinBot can you address this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call — done in 206ddeb.

Since useShouldSuppressPromotionalUI() now fails closed (returns true while SESSION/ACCOUNT are still loading), the !shouldSuppressPromotionalUI term in isEligible already blocks the promo until ACCOUNT has loaded. That made the separate ACCOUNT read — kept only for its load metadata in isAllOnyxLoaded — redundant, so I removed it along with the now-unused isActingAsDelegateSelector import, and updated the comment on the suppression hook line.

fmt and lint-changed pass; the remaining typecheck-tsgo errors are pre-existing and unrelated to this file.

@mountiny

Copy link
Copy Markdown
Contributor Author

@linhvovan29546 ready for final tests

@linhvovan29546

Copy link
Copy Markdown
Contributor

@mountiny EsLint failed

@mountiny

Copy link
Copy Markdown
Contributor Author

@MelvinBot please fix the failing eslint ci

… test

Co-authored-by: Vit Horacek <mountiny@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor

Fixed the failing ESLint check in bd82470.

The error was @typescript-eslint/no-unsafe-type-assertion at tests/unit/hooks/useShouldSuppressPromotionalUI.test.ts:17, from casting the mock implementation with as typeof useOnyx. I removed the assertion by typing MockedResult as UseOnyxResult<boolean> and letting mockImplementation((key) => ...) infer — matching the existing useOnyx mock convention used in other tests (e.g. ApproveActionButtonTest.tsx). No assertion remains, so the rule no longer fires.

Verified locally with lint-changed (passes) and fmt.

@melvin-bot
melvin-bot Bot requested a review from stitesExpensify July 25, 2026 16:22
@melvin-bot

melvin-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown

@stitesExpensify Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@cristipaval
cristipaval merged commit 49ce089 into main Jul 25, 2026
35 checks passed
@cristipaval
cristipaval deleted the vit/suppress-promo-modals-supportal branch July 25, 2026 19:18
@github-actions

Copy link
Copy Markdown
Contributor

🚧 cristipaval has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/cristipaval in version: 9.4.45-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

Help site review — no changes required

I reviewed the changes in this PR against Expensify's help site content under App/docs/articles and no help site updates are required.

Why: This PR suppresses promotional, training, and onboarding UI (proactive app review, AI Features Promo, product-training tooltips, migrated-user/submit-plan welcome, onboarding flow, track-training, change-policy/multi-scan/hold-reject educational modals) specifically during supportal (Expensify staff support-login) and copilot sessions. It's a session-scoped UX refinement for internal/agent sessions — it doesn't add, remove, or change any customer-facing feature, workflow, setting, pricing, or documented behavior.

Details
  • Supportal is an internal staff tool and is not documented anywhere in App/docs/articles (a search for "supportal" returns no matches), so there's nothing to update.
  • The only copilot matches in the docs (e.g. Manage-Copilot-Access.md, Delegate-when-out-of-office.md) describe the customer-facing Copilot (delegate access) feature. This PR does not change what a copilot can do or how delegate access works — it only skips promo/onboarding modals during a copilot session — so those articles remain accurate.
  • All eligible modals still appear for normal (non-supportal, non-copilot) users, per the PR's tests, so the documented product experience for customers is unchanged.

Since no documentation changes are needed, I did not create a draft help site PR.

@IuliiaHerets

Copy link
Copy Markdown

Hi @mountiny. What account should we use as a customer ND account?

cc @cristipaval @heyjennahay @stitesExpensify

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.45-14 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants