Skip to content

migrate missing personal details - #95921

Merged
mjasikowski merged 2 commits into
Expensify:mainfrom
huult:95720-migrate-report-missing-personal
Jul 14, 2026
Merged

mjasikowski merged 2 commits into
Expensify:mainfrom
huult:95720-migrate-report-missing-personal

Conversation

@huult

@huult huult commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Fixed Issues

$ #95720
PROPOSAL:

Tests

Same QA step

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

Preconditions:

  • Admin issues physical card for himself
  1. Open the Expensify app.
  2. Go to staging.new.expensify.com.
  3. Go to a Workspace chat.
  4. Click Add shipping detail.
  5. Verify that clicking Add shipping detail does not change the background to the Wallet page and that it remains on the Inbox page.
  • 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 verified there are no new alerts related to the canBeMissing param for useOnyx
  • 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
Screen.Recording.2026-07-13.at.09.44.14.mov

@huult
huult requested review from a team as code owners July 13, 2026 02:44
@melvin-bot
melvin-bot Bot requested review from suneox and trjExpensify and removed request for a team July 13, 2026 02:44
@melvin-bot

melvin-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

@suneox 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 13, 2026 02:44
@codecov

codecov Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

@suneox

suneox commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Manual test cases

DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS — Add shipping / personal details RHP
Case 1.1 — P1/core: Workspace chat → Add shipping details → RHP opens with Inbox/report behind (not Wallet)

Target: src/components/ReportActionItem/IssueCardMessage.tsx:63 — createDynamicRoute(DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS.getRoute(...)). Button label: Add shipping details.

Precondition: current user is assignee; report has CARDMISSINGADDRESS; personal details missing or card STATE_NOT_ISSUED. Account must already have a physical card issued to self in a workspace chat (same as issue QA).

// Force missing personal details so Add shipping details is shown
Onyx.merge(ONYXKEYS.PRIVATE_PERSONAL_DETAILS, {
    legalFirstName: null,
    legalLastName: null,
    dob: null,
    phoneNumber: null,
    addresses: [],
});
// DERIVED: CARDMISSINGADDRESS + issued physical card for self — use real issue-card setup, not Onyx-only.

Steps:

  1. Open the app and sign in with the test account.
  2. Open Inbox → open the Workspace chat that shows the issue-card message with Add shipping details.
  3. Confirm the central pane is the report/Inbox (URL like /r/<R>).
  4. Tap Add shipping details.
  5. Verify the Missing personal details / Add shipping details RHP opens.
  6. Verify URL = /r/<R>/missing-personal-details/<C> (suffix on the report — not /settings/wallet/... as the base).
  7. Verify the background under the RHP stays Inbox/report — not Wallet (staging bug before this fix).
  8. Close / Back → return to the report; suffix stripped from the URL.

Expected: RHP opens on the report base; background remains Inbox/report. PASS when Wallet is no longer under the panel.

Case 1.2 — Entry from Home: Time-sensitive → Add virtual card personal details

Target: src/pages/home/TimeSensitiveSection/items/AddVirtualCardPersonalDetails.tsx:31.

Precondition: Home shows the virtual-card personal-details time-sensitive widget (virtualCardsNeedingPersonalDetails.length > 0).

Onyx.merge(ONYXKEYS.PRIVATE_PERSONAL_DETAILS, {legalFirstName: null, addresses: []});
// DERIVED: actionable virtual Expensify Card needing personal details on the account.

Steps:

  1. Open the app → Home.
  2. In the Time-sensitive section, tap the Add personal details CTA on the virtual card widget.
  3. Verify the RHP opens; URL = /home/missing-personal-details/<C> (or current home path + suffix).
  4. Verify background = Home.
  5. Back → Home; suffix stripped.

Expected: HOME entry works; background/stack correct.

Case 1.3 — Entry from Wallet list: PaymentMethodListItem CTA

Target: src/pages/settings/Wallet/PaymentMethodListItem.tsx:272 when shouldShowMissingPersonalDetailsAction.

Precondition: Wallet list shows a virtual card row with the missing-personal-details CTA.

Onyx.merge(ONYXKEYS.PRIVATE_PERSONAL_DETAILS, {legalFirstName: null, addresses: []});
// DERIVED: virtual card row with shouldShowMissingPersonalDetailsAction on Wallet.

Steps:

  1. Open the app → Settings → Wallet.
  2. Find the card row with the add-personal-details CTA → tap it.
  3. Verify the RHP opens; URL = /settings/wallet/missing-personal-details/<C>.
  4. Verify background = Wallet.
  5. Back → /settings/wallet.

Expected: WALLET.ROOT entry works; URL shape correct.

Case 1.4 — Entry from Expensify Card page: Reveal when address/personal details missing

Target: src/pages/settings/Wallet/ExpensifyCardPage/index.tsx:531 — areAddressAndPersonalDetailsMissing → navigate.

Precondition: on card detail (SETTINGS.WALLET.DOMAIN_CARD or DOMAIN_CARD.DOMAIN_CARD_DETAIL); address/personal details incomplete.

Onyx.merge(ONYXKEYS.PRIVATE_PERSONAL_DETAILS, {
    legalFirstName: 'Test',
    legalLastName: 'User',
    dob: '1990-01-01',
    phoneNumber: '+15555550100',
    addresses: [{street: '', city: '', state: '', zip: '', country: ''}],
});

Steps:

  1. Settings → Wallet → open Expensify Card detail.
  2. Tap Reveal.
  3. Verify navigation to the Missing personal details RHP (no immediate reveal).
  4. Verify URL = card base path + /missing-personal-details/<C>; background stays card/wallet context.
  5. Back → card page.

Expected: Reveal gate routes to the dynamic page; domain-card entryScreens OK.

Case 1.5 — Entry from Expensify Card page: Get physical card (STATE_NOT_ISSUED)

Target: src/pages/settings/Wallet/ExpensifyCardPage/index.tsx:699.

Precondition: physical card state === STATE_NOT_ISSUED so Get physical card is visible.

// DERIVED: physical card in NOT_ISSUED state — set up via admin issue flow, not Onyx-only.

Steps:

  1. Open the Expensify Card page that shows Get physical card.
  2. Tap it → Missing personal details RHP opens.
  3. Verify URL includes missing-personal-details/<C>; background stays on the card page.
  4. Back → suffix stripped.

Expected: Get physical card CTA opens the dynamic route correctly.

Case 1.6 — Sub-page forward/back uses shouldReplaceRoute (no stacked suffixes)

Target: MissingPersonalDetailsContent + useSubPage({ shouldReplaceRoute: true }) / forceReplace (PR).

Precondition: Missing personal details open from Case 1.1 (/r/<R>/missing-personal-details/<C>).

Steps:

  1. From the Case 1.1 RHP, walk the form steps (Legal name → Date of birth → Address…).
  2. After each Next, verify URL becomes .../missing-personal-details/<C>/<subPage> (e.g. legal-name, date-of-birth) — not stacked .../missing-personal-details/.../missing-personal-details/....
  3. Tap Back in the wizard → subPage updates via replace (stack stays a single dynamic screen).

Expected: One dynamic screen; only subPage changes; no duplicate suffixes.

Case 1.7 — Refresh / deeplink restore on the new report-based URL

Target: dynamic linkingConfig registration + full-screen restore via suffix strip.

Precondition: on /r/<R>/missing-personal-details/<C> after Case 1.1.

Steps:

  1. Reload the page (Web).
  2. Verify Missing personal details RHP restores with report background (not Wallet, not 404).
  3. New tab: paste the same URL → Enter → correct stack.
  4. Back → /r/<R>.

Expected: Refresh/deeplink restores REPORT entry correctly.

Case 1.8 — OldRoutes: legacy /missing-personal-details/<C> redirects to wallet base

Target: PR OldRoutes.ts: '/missing-personal-details/*': '/settings/wallet/missing-personal-details/$1'.

Precondition: signed in; valid <C>.

⚠️ Note (review P1): redirect exists in the PR; unit tests in getMatchingNewRouteTest are still missing. This case checks runtime redirect — PASS when redirect works. Author should still add the unit-test trio before merge.

Steps:

  1. Paste https://dev.new.expensify.com:8082/missing-personal-details/<C> → Enter.
  2. Verify rewrite to /settings/wallet/missing-personal-details/<C> and RHP opens.
  3. (Query) try /missing-personal-details/<C>?backTo=%2Fhome → query preserved after redirect.
  4. (No false-positive) paste the new URL /settings/wallet/missing-personal-details/<C> → page opens normally (no double rewrite).

Expected: Old absolute URL → wallet dynamic URL; query kept; new URL untouched.

DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS_CONFIRM_MAGIC_CODE — Confirm magic code after the form
Case 2.1 — Finish form → confirm-magic-code opens on the same basePath

Target: src/pages/MissingPersonalDetails/index.tsx:23 — createDynamicRoute(CONFIRM_MAGIC_CODE, basePath) + forceReplace.

Precondition: Case 1.1 — complete the wizard through Confirm / onComplete.

Steps:

  1. From Case 1.1, finish the personal-details steps through submit → magic code.
  2. Verify URL = /r/<R>/missing-personal-details/<C>/confirm-magic-code (strict suffix wins over optional subPage).
  3. Verify background is still report/Inbox (same basePath as Case 1.1).

Expected: Magic code dynamic route on the correct base; no jump to Wallet.

Case 2.2 — Close magic code → forceReplace back to Missing personal details

Target: src/pages/MissingPersonalDetails/MissingPersonalDetailsMagicCodePage.tsx:114.

Precondition: on Case 2.1.

Steps:

  1. On the magic code page, tap Close / dismiss.
  2. Verify return to Missing personal details (/r/<R>/missing-personal-details/<C>) with report background kept.
  3. URL no longer contains confirm-magic-code.

Expected: Close reconstructs the parent dynamic route on the same base.

@trjExpensify

Copy link
Copy Markdown
Contributor

PR doesn’t need product input as a migration PR. Unassigning and unsubscribing myself.

@trjExpensify
trjExpensify removed their request for review July 13, 2026 17:57
@suneox

suneox commented Jul 14, 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
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS — Add shipping / personal details RHP
Case 1.1 — P1/core: Workspace chat → Add shipping details → RHP opens with Inbox/report behind (not Wallet) 1 1-1-before-workspace-chat-add-shipping-button 1 1-2-entry-missing-personal-details-rhp-report-bg 1 1-3-after-rhp-closed-back-to-report
Case 1.2 — Entry from Home: Time-sensitive → Add virtual card personal details 1 2-1-before-home-virtual-card-widget 1 2-2-entry-home-dynamic-rhp
Case 1.3 — Entry from Wallet list: PaymentMethodListItem CTA 1 3-1-before-wallet-card-list 1 3-2-entry-wallet-dynamic-rhp
Case 1.4 — Entry from Expensify Card page: Reveal when address/personal details missing 1 4-1-before-card-page-reveal 1 4-2-entry-reveal-missing-personal-details
Case 1.5 — Entry from Expensify Card page: Get physical card (STATE_NOT_ISSUED)
Case 1.6 — Sub-page forward/back uses shouldReplaceRoute (no stacked suffixes) 1 6-1-before-wizard-legal-name 1 6-2-entry-wizard-date-of-birth-replace 1 6-3-after-wizard-back-step
Case 1.7 — Refresh / deeplink restore on the new report-based URL 1 7-1-before-report-source-before-deeplink 1 7-2-entry-refresh-restored-rhp-report-bg
Case 1.8 — OldRoutes: legacy /missing-personal-details/<C> redirects to wallet base 1 8-1-before-missing-personal-details-oldurl 1 8-2-entry-wallet-base-redirected
DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS_CONFIRM_MAGIC_CODE — Confirm magic code after the form
Case 2.1 — Finish form → confirm-magic-code opens on the same basePath 2 1-1-before-report-source-before-magic-code 2 1-2-entry-magic-code-page-report-base
Case 2.2 — Close magic code → forceReplace back to Missing personal details 2 2-1-before-magic-code-page-wizard 2 2-2-entry-close-strips-confirm-magic-code

@suneox suneox left a comment

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.

Changeset LGTM. Skipped test case 1.5 due to lack of a physical card.

@melvin-bot
melvin-bot Bot requested a review from mjasikowski July 14, 2026 10:42
@mjasikowski
mjasikowski merged commit 9bf4fff into Expensify:main Jul 14, 2026
34 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

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

@OSBotify OSBotify mentioned this pull request Jul 16, 2026
94 tasks done
@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/mjasikowski in version: 9.4.35-1 🚀

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 and no updates to Expensify's help site files under docs/articles are required, so I did not create a draft docs PR.

Why: This PR is a purely internal navigation/routing refactor. It migrates the "missing personal details" flow (reached via Add shipping details on an issued card) from a static route to a dynamic route so the correct screen (e.g. the Inbox page) stays underneath the right-hand modal instead of the background switching to the Wallet page. The change is limited to routing config, SCREENS/ROUTES definitions, and the useSubPage hook — there are no new features, settings, tabs, labels, or user-facing workflow steps that the help site documents.

I also searched docs/articles for "shipping detail" and "missing personal details" and found no existing article that describes this behavior, so there is nothing to update.

If you feel a help article does need to reflect something here, let me know which article and what behavior, and I'll draft the update.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.4.35-6 🚀

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

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.

6 participants