Skip to content

Add Approve account merge requests task to Home - #108297

Open
dukenv0307 wants to merge 7 commits into
Expensify:mainfrom
dukenv0307:approve-account-merge-requests-home-task
Open

dukenv0307 wants to merge 7 commits into
Expensify:mainfrom
dukenv0307:approve-account-merge-requests-home-task

Conversation

@dukenv0307

Copy link
Copy Markdown
Contributor

Explanation of Change

Add Approve account merge requests task to Home

Fixed Issues

$ #106168
PROPOSAL:

Tests

Precondition: Have 2 domain accounts (different domains) that share a tech contact. Have at least 1 merge request

  1. Login as a tech contact
  2. Go to the Home page
  3. Verify that the task Approve x account merge requests is shown
Screen.Recording.2026-11-26.at.18.03.05.mov
  • Verify that no errors appear in the JS console

Offline tests

Same as above

QA Steps

Same as above

  • 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 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 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)
  • 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.
  • 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

@expensify-chore-bot

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx bun ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx bun ./scripts/generateTranslations.ts --compare-ref main

@dukenv0307

Copy link
Copy Markdown
Contributor Author

@MelvinBot how to fix these failing tests

@MelvinBot

Copy link
Copy Markdown
Contributor

There are four PR-related fixes, plus one unrelated lint failure:

  1. Jest job 11 + typecheck: update the selector fixtures.
    The new tests still pass pendingApprovalCountByDomainAccountID with numeric counts. The selector now expects:

    {
        [`${ONYXKEYS.COLLECTION.DOMAIN_ACCOUNT_MERGE_REQUESTS_TO_REVIEW}1`]: {
            request1: request,
            request2: {...request, requestID: 'request2'},
        },
    }

    Here, request must contain the required request fields. This fixture should return {count: 2, domainAccountIDs: [1]}. Replace the “ignores non-positive counts” test with coverage for empty/missing domain entries.

  2. Jest job 10: classify the new Onyx key.
    Add ONYXKEYS.COLLECTION.DOMAIN_ACCOUNT_MERGE_REQUESTS_TO_REVIEW to onyxKeysToMaskFragileData, alongside DOMAIN_ACCOUNT_MERGE_REQUEST. The export-coverage test requires every Onyx key to be classified.

  3. Typecheck: finish the translations.
    The new translation is missing from de, el, fr, it, ja, nl, pl, pt-BR, and zh-hans. Generate the missing translations while preserving the plural/count structure. For this fork, follow the translation bot’s instructions.

  4. verify: remove unintended generated-action changes.
    The PR changes two generated bundles without corresponding action-source changes: isDeployChecklistLocked and proposalPoliceComment. Restore those files to their target-base versions. With dependencies matching the lockfile, run npm run gh-actions-build and confirm rebuilding introduces no changes.

Unrelated Oxlint failure: useSearchBulkActions.ts has 4,001 lines against a 4,000-line limit. The failing version is identical to the CI base branch, so this PR did not introduce it. Pick up the upstream correction rather than changing unrelated code.

After fixing the PR-related issues, rerun:

npm test -- --runInBand --runTestsByPath tests/unit/DomainSelectorsTest.ts tests/unit/ExportOnyxStateTest.ts
npm run typecheck
npm run gh-actions-build

I inspected the CI logs and code; I haven’t changed files or rerun the tests.

⚠️ I can't push changes to this PR because I didn't open it and I'm not listed as an assignee. To have me make this fix, add me to the PR assignees and then retry your request.


view run

@dukenv0307 dukenv0307 changed the title [Hold BE] Add Approve account merge requests task to Home Add Approve account merge requests task to Home Dec 1, 2026
@dukenv0307
dukenv0307 marked this pull request as ready for review December 1, 2026 03:57
@dukenv0307
dukenv0307 requested review from a team as code owners December 1, 2026 03:57
@expensify-chore-bot
expensify-chore-bot Bot requested review from nkdengineer and removed request for a team December 1, 2026 03:58
@expensify-chore-bot

Copy link
Copy Markdown

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

@expensify-chore-bot
expensify-chore-bot Bot requested review from twisterdotcom and removed request for a team December 1, 2026 03:58
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T04:19:37.735669Z 3be126e 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.

@codecov

codecov Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Coverage Δ
src/CONST/SENTRY_LABEL.ts 100.00% <ø> (ø)
src/ONYXKEYS.ts 100.00% <ø> (ø)
src/libs/ExportOnyxState/masking.ts 93.92% <ø> (ø)
src/pages/home/ForYouSection/index.tsx 98.63% <100.00%> (+0.05%) ⬆️
src/selectors/Domain.ts 97.76% <100.00%> (+0.28%) ⬆️
...me/ForYouSection/useApproveAccountMergeRequests.ts 75.00% <75.00%> (ø)
... and 7444 files with indirect coverage changes

@dukenv0307
dukenv0307 requested review from trjExpensify and removed request for twisterdotcom December 1, 2026 04:06

@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: 3be126e02b

ℹ️ 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 tests/unit/DomainSelectorsTest.ts Resolved
Comment thread src/selectors/Domain.ts Resolved
@nkdengineer

Copy link
Copy Markdown
Contributor

@dukenv0307 Just have a minor comment. Please check my comment and codex review.

@OSBotify

OSBotify commented Dec 1, 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 f8339b34..bb383abf 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -1170,8 +1170,8 @@ const translations: TranslationDeepObject<typeof en> = {
                 other: `Prüfen Sie ${count} Domain-Admin-Anfragen`,
             }),
             approveAccountMergeRequests: ({count}: {count: number}) => ({
-                one: 'Genehmigen Sie 1 Kontozusammenführungsanfrage',
-                other: `Genehmigen Sie ${count} Kontozusammenführungsanfragen`,
+                one: '1 Kontozusammenführungsanfrage genehmigen',
+                other: `${count} Kontozusammenführungsanfragen genehmigen`,
             }),
         },
         upcomingTravel: 'Bevorstehende Reisen',
diff --git a/src/languages/el.ts b/src/languages/el.ts
index 0e48ace8..92dcc294 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -1183,8 +1183,8 @@ const translations: TranslationDeepObject<typeof en> = {
                 other: `Ελέγξτε ${count} αιτήματα διαχειριστή τομέα`,
             }),
             approveAccountMergeRequests: ({count}: {count: number}) => ({
-                one: 'Εγκρίνετε 1 αίτημα συγχώνευσης λογαριασμού',
-                other: `Εγκρίνετε ${count} αιτήματα συγχώνευσης λογαριασμού`,
+                one: 'Έγκριση 1 αιτήματος συγχώνευσης λογαριασμού',
+                other: `Εγκρίνετε ${count} αιτήματα συγχώνευσης λογαριασμών`,
             }),
             submit: ({count}: {count: number}) => ({
                 one: 'Υποβολή 1 αναφοράς',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 2703a029..1ae3e022 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -1182,8 +1182,8 @@ const translations: TranslationDeepObject<typeof en> = {
                 other: `Revisa ${count} solicitudes de administrador de dominio`,
             }),
             approveAccountMergeRequests: ({count}: {count: number}) => ({
-                one: 'Aprueba 1 solicitud de fusión de cuenta',
-                other: `Aprueba ${count} solicitudes de fusión de cuenta`,
+                one: 'Aprobar 1 solicitud de fusión de cuenta',
+                other: `Aprobar ${count} solicitudes de fusión de cuentas`,
             }),
         },
         gettingStartedSection: {
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index f46b1ebd..677a8569 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -1174,8 +1174,8 @@ const translations: TranslationDeepObject<typeof en> = {
                 other: `Examiner ${count} demandes d'administrateur de domaine`,
             }),
             approveAccountMergeRequests: ({count}: {count: number}) => ({
-                one: `Approuver ${count} demande de fusion de compte`,
-                other: `Approuver ${count} demandes de fusion de compte`,
+                one: 'Approuver 1 demande de fusion de compte',
+                other: `Approuver ${count} demandes de fusion de comptes`,
             }),
         },
         upcomingTravel: 'Voyages à venir',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index a0958c7f..c005a161 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -1174,7 +1174,7 @@ const translations: TranslationDeepObject<typeof en> = {
             }),
             approveAccountMergeRequests: ({count}: {count: number}) => ({
                 one: 'Approva 1 richiesta di unione account',
-                other: `Approva ${count} richieste di unione account`,
+                other: `Approva ${count} richieste di unione dell’account`,
             }),
         },
         upcomingTravel: 'Prossimi viaggi',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index ee5093f9..c428e6c1 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -1158,8 +1158,8 @@ const translations: TranslationDeepObject<typeof en> = {
                 other: `${count} 件のドメイン管理者リクエストを確認`,
             }),
             approveAccountMergeRequests: ({count}: {count: number}) => ({
-                one: `${count} 件のアカウント統合リクエストを承認`,
-                other: `${count} 件のアカウント統合リクエストを承認`,
+                one: '1件のアカウント統合リクエストを承認',
+                other: `${count} 件のアカウント統合リクエストを承認します`,
             }),
         },
         upcomingTravel: '今後の出張',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index ec964ce8..1431b8e3 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -1169,8 +1169,8 @@ const translations: TranslationDeepObject<typeof en> = {
                 other: `Beoordeel ${count} domeinbeheerdersverzoeken`,
             }),
             approveAccountMergeRequests: ({count}: {count: number}) => ({
-                one: 'Keur 1 accountsamenvoegingsverzoek goed',
-                other: `Keur ${count} accountsamenvoegingsverzoeken goed`,
+                one: '1 verzoek tot samenvoegen van accounts goedkeuren',
+                other: `Keur ${count} verzoeken tot samenvoegen van accounts goed`,
             }),
         },
         upcomingTravel: 'Aankomende reizen',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index a7520c6d..c28c2462 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -1199,10 +1199,8 @@ const translations: TranslationDeepObject<typeof en> = {
                 other: `Przejrzyj ${count} prośby administratora domeny`,
             }),
             approveAccountMergeRequests: ({count}: {count: number}) => ({
-                one: 'Zatwierdź 1 prośbę o scalenie konta',
-                few: `Zatwierdź ${count} prośby o scalenie konta`,
-                many: `Zatwierdź ${count} próśb o scalenie konta`,
-                other: `Zatwierdź ${count} prośby o scalenie konta`,
+                one: 'Zatwierdź 1 prośbę o scalenie kont',
+                other: `Zatwierdź ${count} prośby o połączenie konta`,
             }),
         },
         upcomingTravel: 'Nadchodząca podróż',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 26d83e82..8b6fb4f0 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -1172,7 +1172,7 @@ const translations: TranslationDeepObject<typeof en> = {
                 other: `Revisar ${count} solicitações de administrador de domínio`,
             }),
             approveAccountMergeRequests: ({count}: {count: number}) => ({
-                one: `Aprovar ${count} solicitação de mesclagem de conta`,
+                one: 'Aprovar 1 solicitação de mesclagem de conta',
                 other: `Aprovar ${count} solicitações de mesclagem de conta`,
             }),
         },
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index db9837a6..70ee5a14 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -1137,7 +1137,7 @@ const translations: TranslationDeepObject<typeof en> = {
                 other: `审核 ${count} 个域管理员请求`,
             }),
             approveAccountMergeRequests: ({count}: {count: number}) => ({
-                one: `批准 ${count} 个账户合并请求`,
+                one: '批准 1 个账户合并请求',
                 other: `批准 ${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

@nkdengineer

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.
  • 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 Screenshot 2026-12-01 at 17 07 29
Android: mWeb Chrome
Screen.Recording.2026-12-01.at.17.08.41.mov
iOS: HybridApp
Screen.Recording.2026-12-01.at.17.07.42.mov
iOS: mWeb Safari
Screen.Recording.2026-12-01.at.17.08.28.mov
MacOS: Chrome / Safari
Screen.Recording.2026-12-01.at.17.05.53.mov

@nkdengineer

Copy link
Copy Markdown
Contributor

@dukenv0307 please also update the translation.

@trjExpensify

Copy link
Copy Markdown
Contributor

To confirm...

  1. This is behind a beta?
  2. It doesn't take you to see the actual requests in the list right now in this PR, just navigates to the page?

@dukenv0307

Copy link
Copy Markdown
Contributor Author

This is behind a beta?
It doesn't take you to see the actual requests in the list right now in this PR, just navigates to the page?

Yes and yes

This branch has not been deployed

No deployments
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.

5 participants