Skip to content

Migrate ExplanationModal to CenteredModalLayout#93292

Closed
jmusial wants to merge 8 commits into
Expensify:mainfrom
software-mansion-labs:chore/migrate-explanation-modal-to-centred-modal-layout
Closed

Migrate ExplanationModal to CenteredModalLayout#93292
jmusial wants to merge 8 commits into
Expensify:mainfrom
software-mansion-labs:chore/migrate-explanation-modal-to-centred-modal-layout

Conversation

@jmusial

@jmusial jmusial commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

This PR extracts FeatureTrainingContent so screens render content directly without a JS Modal wrapper. Then it migrates ExplanationModal.

Fixed Issues

$ #90475
PROPOSAL:

Tests

Pre requisite:

add in src/hooks/useOnboardingFlow.ts#69 to trigger modal

                if (true) {
                    Navigation.navigate(ROUTES.EXPLANATION_MODAL_ROOT);
                    return;
                }
  1. Verify that modal shows
  2. Dismiss modal

Offline tests

Same as tests

QA Steps

Pre requisite:

On web you can add /onboarding/explanation. On mobile it requires switching from OldDot to new w/o onboarding complete, then follow test steps.

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
    • 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
Screen.Recording.2026-06-11.at.18.25.49.mov
Android: mWeb Chrome
Screen.Recording.2026-06-12.at.12.19.48.mov
iOS: Native
Screen.Recording.2026-06-11.at.18.27.15.mov
iOS: mWeb Safari
Screen.Recording.2026-06-12.at.12.17.00.mov
MacOS: Chrome / Safari
Screen.Recording.2026-06-11.at.18.25.19.mov

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/libs/Navigation/AppNavigator/AuthScreens.tsx 82.97% <ø> (ø)
...Navigator/Navigators/ExplanationModalNavigator.tsx 33.33% <ø> (+16.66%) ⬆️
...tion/AppNavigator/useRootNavigatorScreenOptions.ts 93.93% <100.00%> (+1.34%) ⬆️
src/components/FeatureTrainingModal.tsx 86.66% <83.33%> (-4.81%) ⬇️
src/pages/TrackTrainingPage.tsx 12.50% <0.00%> (-1.79%) ⬇️
src/styles/index.ts 57.57% <0.00%> (-1.80%) ⬇️
src/components/FeatureTrainingContent.tsx 91.30% <91.30%> (ø)
src/components/CenteredModalLayout.tsx 0.00% <0.00%> (ø)
src/components/ExplanationModalScreen.tsx 0.00% <0.00%> (ø)
... and 10 files with indirect coverage changes

@jmusial

jmusial commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

@codex 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: 9c0368e9b9

ℹ️ 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".

Comment on lines +35 to +43
<CenteredModalLayout onBackdropPress={completeHybridAppOnboarding}>
<View style={contentStyle}>
<FeatureTrainingContent
title={translate('onboarding.explanationModal.title')}
description={translate('onboarding.explanationModal.description')}
secondaryDescription={translate('onboarding.explanationModal.secondaryDescription')}
confirmText={translate('footer.getStarted')}
videoURL={CONST.WELCOME_VIDEO_URL}
onClose={handleClose}

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 Complete onboarding when the route is dismissed

This only marks the hybrid onboarding as completed for the custom backdrop and CTA paths. Because the modal is now a transparent navigator screen instead of the Modal component, dismissing it via browser/Android back (or any navigator pop) bypasses both onBackdropPress and FeatureTrainingContent's onClose, leaving tryNewDot.isHybridAppOnboardingCompleted false and never notifying OldDot; the user can close the explanation without the completion side effect. Add a before-remove/unmount handler for this screen or otherwise route all dismissals through completeHybridAppOnboarding().

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.

addressed

@jmusial

jmusial commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

@Expensify/design I think I found a bug here (non transparent overlay on narrow screens) that I also fixed in this PR. Just wanted to confirm that it wasn't intentional.

2 changes:

  1. bg has opacity
  2. animation is now fade instead of swipe

Before / After vid:

Screen.Recording.2026-06-12.at.12.25.30.mov

@jmusial jmusial marked this pull request as ready for review June 12, 2026 10:58
@jmusial jmusial requested review from a team as code owners June 12, 2026 10:58
@melvin-bot melvin-bot Bot requested review from joekaufmanexpensify and parasharrajat and removed request for a team June 12, 2026 10:58
@melvin-bot

melvin-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

@parasharrajat 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 June 12, 2026 10:58
Comment thread src/components/FeatureTrainingContent.tsx Outdated
Comment thread src/components/FeatureTrainingContent.tsx Outdated
@shawnborton

Copy link
Copy Markdown
Contributor

Wow, I didn't even realize we still had that modal. I'm guessing the video is quite dated? cc @Expensify/marketing in case you have thoughts.

@jmusial

jmusial commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Wow, I didn't even realize we still had that modal. I'm guessing the video is quite dated? cc @Expensify/marketing in case you have thoughts.

The video I made today 😢 Also all training modals have the same issue.
Are you saying we can remove ExplanationModal ?

@jamesdeanexpensify

Copy link
Copy Markdown
Contributor

Yeah I had no idea we still had this:

image

When does it appear? Should we get rid of it entirely? For some reason I thought we were also using the web one on mobile (below)

image

cc @trjExpensify

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

No product review needed

@joekaufmanexpensify joekaufmanexpensify removed their request for review June 12, 2026 17:31
@trjExpensify

Copy link
Copy Markdown
Contributor

Is it a migration modal? I don't think I've seen it out in the wild either. 🤔

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

Yeah I had no idea we still had this:

Yeah that looks very old I vaguely remember us having the Intro to NewDot video in that one. I think it was used in the very first wave of the Onboarding project

@jmusial

jmusial commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

I haven't been able to get to this modal from the flow either. On web you can see it on https://staging.new.expensify.com/onboarding/explanation

As far as the code reads it should appear when user is transitioning from OldDot, and NOT when it's not a singular entry (like for travel)

// When user is transitioning from OldDot to NewDot, we usually show the explanation modal

@shawnborton

Copy link
Copy Markdown
Contributor

I think we should either get rid of that modal or update it. Right it shows a video where the leading frame is talking about starting rooms:
CleanShot 2026-06-15 at 10 49 10@2x

I like James's idea to just reuse this one:
image

@trjExpensify

Copy link
Copy Markdown
Contributor

I haven't been able to get to this modal from the flow either.

Has anyone confirmed how and when this modal shows in production? 🤔 I don't think it's related to the tryNewDot.nudgeMigration NVP is it?

Sounds like it might just be old, and needs to be killed - but would be good to confirm when it's actually expected to be shown to be sure.

@jmusial

jmusial commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@trjExpensify if the account has nvp_onboarding.hasCompletedGuidedSetupFlow not set (so I assume OldDot account that has never been to new dot) it looks like when switching:

Screen.Recording.2026-06-15.at.14.10.47.mov

I do not have access to such account, so triggered it by hardcoding nvp_onboarding.hasCompletedGuidedSetupFlow to false.

@trjExpensify

Copy link
Copy Markdown
Contributor

if the account has nvp_onboarding.hasCompletedGuidedSetupFlow not set (so I assume OldDot account that has never been to new dot)

That NVP is used for regular onboarding, so I don't think this has anything to do with migration or nudging. I would think we can probably just kill the mobile modal. CC: @Julesssss for a second opinion.

@parasharrajat

Copy link
Copy Markdown
Member

Is this ready for review, or are we still finalizing the modal?

@Julesssss

Copy link
Copy Markdown
Contributor

I would think we can probably just kill the mobile modal. CC: @Julesssss for a second opinion.

Yeah, it's old and I think better to just delete. Though we may need to keep checking for the NVP. Currently if we detect that NVP we SKIP showing the regular onboarding modal, so we should make sure we continue to skip that for existing users who switched for the first time.

  • Triggered here
  • Show regular onboarding logic

@jmusial

jmusial commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@parasharrajat a quick summary:

EDIT: Remove explanation modal PR is open

@jmusial jmusial mentioned this pull request Jun 17, 2026
49 tasks
@mountiny

Copy link
Copy Markdown
Contributor

This can be closed

@mountiny mountiny closed this Jun 17, 2026
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.

9 participants