Skip to content

Replace ProcessMoneyReportHoldMenu with useHoldMenuModal in SelectionToolbar and report preview - #104532

Open
MelvinBot wants to merge 4 commits into
mainfrom
claude-replaceProcessMoneyReportHoldMenu
Open

MelvinBot wants to merge 4 commits into
mainfrom
claude-replaceProcessMoneyReportHoldMenu

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

ProcessMoneyReportHoldMenu was an older, pay-only copy of the global HoldMenuModalWrapper. This PR moves its last two callers to useHoldMenuModal().showHoldMenu, as the report header already does, and deletes the old component.

  • Selection mode (useSelectionModeReportActions): both onHoldMenuOpen handlers now call showHoldMenu. They pass requestType, paymentType, methodID (VBBA only), the amounts, and onConfirm. onConfirm now runs the lifecycle callback that was dropped before (_onConfirm, for example marking the report as paid elsewhere), the same way the header dropdown does, then clears the selection. The local hold-menu state, handleHoldMenuClose, and handleHoldMenuConfirm are removed, along with the hold-menu block in SelectionToolbar.
  • Report preview (PayActionButton.confirmPayment): calls showHoldMenu directly. It computes the amounts with getNonHeldAndFullAmount, passes the report IDs (the wrapper reads the reports from Onyx), and passes onConfirm: startAnimation. ReportPreviewHoldMenu, the provider's holdMenu state, onHoldMenuOpen/onHoldMenuClose, and ReportPreviewHoldMenuContext are removed.
  • ActionHandledType imports now point at @hooks/useHoldMenuSubmit.
  • Both callers wait one animation frame on iOS before opening, matching MoneyReportHeaderModals.

Expected differences:

  1. The amounts are a snapshot taken when the menu opens. The header and ExpenseReportListItem already work this way.
  2. Selection mode's transactionCount now excludes expenses pending deletion. The hook only receives those transactions, and the count is only used in the "all expenses on hold" prompt.
  3. Confirming clears the selection and unmounts the toolbar. This is safer now because the global modal survives the unmount.

Tests: deleted ReportPreviewHoldMenuTest.tsx. Removed the provider-level hold-menu test from MoneyRequestReportPreview.test.tsx; that wiring no longer exists. Updated PayActionButtonTest.tsx and useSelectionModeReportActions.test.ts to assert the showHoldMenu calls, including VBBA methodID forwarding and the forwarded lifecycle onConfirm.

AI checks run locally: npm run typecheck passed. ESLint on all changed files passed. react-compiler-compliance-check check <changed files> passed. oxfmt was applied. jest --findRelatedTests on the changed source files passed: 23 suites, 495 tests. spell-changed could not run because git merge-base failed in the shallow clone. An automated web run of the Tests steps passed the report preview and selection mode pay flows (screenshots under MacOS: Chrome / Safari). Other platforms are still untested.

Fixed Issues

$ #102977
PROPOSAL:

Tests

Setup (one workspace admin account is enough)

  1. Create a workspace. In Workflows, turn on Add approvals (you are the approver) and Make or track payments (pay outside Expensify / Mark as paid).
  2. In the workspace chat, create two manual expenses ($10 and $20) on the same report, then submit the report.
  3. Open the report, open the $20 expense, and hold it with any reason.
  4. Go back to Workflows and turn off Add approvals. The submitted report now shows Pay.

Report preview

  1. In the workspace chat, click Pay on the report preview and choose Mark as paid.
  2. Verify the hold menu opens with Pay only $10.00 and Pay $30.00.
  3. Click Pay only $10.00.
  4. Verify the modal closes, the report shows paid $10.00 elsewhere, and the held $20 expense moves to a new report.

Selection mode

  1. Repeat steps 2-4 to get a fresh report with a $10 expense and a held $20 expense.
  2. Open the report and select both expenses with the checkboxes (long-press on mobile).
  3. Click Pay in the selection toolbar and choose Mark as paid.
  4. Verify the hold menu opens.
  5. Click Pay $30.00.
  6. Verify the modal closes, the selection clears, and the report shows Paid with a $30.00 total.

Dismiss

  1. Repeat steps 9-11, then dismiss the hold menu without choosing an option.
  2. Verify nothing is paid and the report still shows Pay.
  • Verify that no errors appear in the JS console

Offline tests

  1. Complete Tests setup steps 1-4 while online.
  2. Go offline.
  3. Repeat Tests steps 5-8.
  4. Verify the hold menu opens and the report shows paid $10.00 right away, with the held $20 expense on a separate report.
  5. Go back online.
  6. Verify the report stays paid and no errors appear.

QA Steps

Same as Tests.

On iOS native, also verify the hold menu opens right after you tap Pay in both the report preview and selection mode, with no stuck or frozen screen.

  • 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

Tested on web (Chrome) by MelvinBot. Report preview: Pay → Mark as paid opens the hold menu; Pay only pays $10 and moves the held expense to a new report.

Hold menu from report preview with Pay only and Pay full options Paid 10 dollar report and split-off held report

Selection mode: Pay in the selection toolbar → Mark as paid opens the hold menu; Pay $30.00 pays the full report and clears the selection.

Hold menu from selection mode Report paid for full 30 dollars after selection mode

… the global modal

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team October 21, 2026 06:56
@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 Oct 21, 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-replaceProcessMoneyReportHoldMenu
git checkout -b claude-replaceProcessMoneyReportHoldMenu upstream/claude-replaceProcessMoneyReportHoldMenu
git push -u origin claude-replaceProcessMoneyReportHoldMenu

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

@codecov

codecov Bot commented Oct 21, 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 Δ
.../MoneyRequestReportView/SelectionToolbar/index.tsx 74.69% <ø> (+1.44%) ⬆️
...estReportPreview/MoneyRequestReportPreviewBody.tsx 93.87% <ø> (-0.13%) ⬇️
...tReportPreview/MoneyRequestReportPreviewContext.ts 95.45% <ø> (+2.59%) ⬆️
...eportPreview/MoneyRequestReportPreviewProvider.tsx 94.02% <100.00%> (-0.34%) ⬇️
src/hooks/useSelectionModePayment.ts 63.63% <ø> (ø)
src/hooks/useSelectionModeReportActions.ts 97.18% <100.00%> (+1.07%) ⬆️
src/libs/HoldMenuUtils.ts 100.00% <100.00%> (ø)
src/components/MoneyReportHeaderModals.tsx 0.00% <0.00%> (ø)
...Item/MoneyRequestReportPreview/PayActionButton.tsx 95.08% <83.33%> (-1.35%) ⬇️
... and 127 files with indirect coverage changes

@MelvinBot

MelvinBot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ❌ fail

None of the six test cases ran, so this result says nothing about the PR's code. The setup never produced a payable report that still had a held expense, and then the app froze on an unrelated "Create expense" action. A Metro restart did not fix the freeze.
System notification shade still opens, so the device stayed responsive

Step Status
Report preview: Pay on a report with held expenses opens the hold menu (pay only or pay full amount)Not reached. The tester held an expense while the report was Outstanding, and it stayed next to a non-held expense. Approving the full amount cleared the hold. "Approve only" moved the held expense to its own report. Holding while in Draft split it out on submit. With approvals off, the report closed on submit, and you can't hold expenses on a closed report.
Outstanding report with one non-held and one held expense
❌
Report preview: "Pay only" pays the non-held amount and leaves the held expense unpaidNot reached. No report met the setup conditions.
❌
Report preview or report view: "Pay full amount" pays the full amountNot reached. No report met the setup conditions.
❌
Selection mode: selecting expenses including a held one and tapping Pay opens the hold menuNot attempted. The app froze before this step.
❌
Selection mode: confirming closes the modal, pays as chosen, and clears the selectionNot attempted. The app froze before this step.
❌
No red-box errors or crashes during these flowsNo red box appeared. The app stopped responding to taps after the tester opened the chat "+" menu and chose "Create expense." This happened outside the pay and hold flows. The device itself stayed responsive. Metro logged no JS errors.
App frozen on the Create expense quick-action sheet
System notification shade still opens, so the device stayed responsive
❌

The PR's Tests section is still a placeholder, so I used the acceptance criteria from [Batch 3] Replace ProcessMoneyReportHoldMenu with useHoldMenuModal in SelectionToolbar and report preview (2 modals). To get a real result, add steps to the Tests section that produce a payable report with a held expense. For example, an IOU between two accounts where the payer holds one expense. Then ask me again.


view run · view recording

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⏱️ Ran out of time before I could finish. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in #melvinbot-ai.

Run details

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

@MelvinBot
Complete the author checklist and add test cases

@MelvinBot

MelvinBot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ⚠️ partial

The hold menu now opens from both the report preview and the selection toolbar, and both pay flows finish. In selection mode, "Pay only" showed $0.00 instead of $10.00, and console errors could not be captured on web.
Report paid for full 30 dollars after selection mode

Step Status
Report preview: Pay → Mark as paid opens the hold menu with Pay only $10.00 and Pay $30.00Both options appeared with the right amounts.
Report preview showing Pay buttonHold menu from report preview with Pay only and Pay full options
✅
Pay only closes the modal, pays $10.00, and moves the held $20 expense off the paid reportThe report shows "paid $10.00 elsewhere". The held expense moved to a new report.
Paid 10 dollar report and split-off held reportPaid report with only the non-held expense
✅
Selection mode: select both expenses, Pay → Mark as paid opens the hold menuThe hold menu opened. Both the toolbar button and the "Pay only" option showed $0.00 instead of $10.00. This PR moved the amount math without changing it, and the toolbar button amount comes from code this PR doesn't touch. So the $0.00 likely already happens on main. Please confirm.
Selection toolbar with Pay actionHold menu from selection mode
⚠️
Pay $30.00 closes the modal, clears the selection, and marks the report paidThe report shows Paid with a $30.00 total.
Report paid for full 30 dollars after selection mode
✅
No JS console errorsNo error toasts or crashes appeared. The web tester can't read console logs, so this isn't confirmed.
⚠️

PR body updated:

  • I added Tests (setup, report preview, selection mode, dismiss), Offline tests, and QA steps. A single workspace admin account can run them: submit with approvals on, hold an expense, then turn approvals off so Pay appears.
  • I checked the checklist items that are done (linked issue, test steps, unit tests, MacOS: Chrome) and the items that don't apply (no copy, assets, UI, markdown, or Storybook changes). I added the web screenshots under MacOS: Chrome / Safari.
  • You still need to test offline, with a High Traffic account, on Android and iOS, and with deeplinks. You also need to check the JS console and test the other affected components.

view run · view recording

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

@MelvinBot
Fix conflicts and open the PR

…MoneyReportHoldMenu

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>

# Conflicts:
#	src/components/MoneyRequestReportView/SelectionToolbar/index.tsx
@MelvinBot
MelvinBot marked this pull request as ready for review October 22, 2026 15:54
@MelvinBot
MelvinBot requested a review from a team as a code owner October 22, 2026 15:54
@melvin-bot
melvin-bot Bot requested review from ZhenjaHorbach and removed request for a team October 22, 2026 15:54
@melvin-bot

melvin-bot Bot commented Oct 22, 2026

Copy link
Copy Markdown

@ZhenjaHorbach 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 requested review from flaviadefaria and removed request for a team October 22, 2026 15:54
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 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-10-22T15:59:43.634739Z c8158a6 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

I merged main into this branch, resolved the conflict, and marked the PR ready for review. GitHub now shows it as mergeable. It still needs reviews and passing checks.

Conflict details

The only conflict was in SelectionToolbar/index.tsx. main replaced the inline HoldOrRejectEducationalModal with the useHoldRejectEducationalModal hook. This PR removed the inline ProcessMoneyReportHoldMenu. I removed both blocks.

Checks I ran after the merge:

  • npm run typecheck passed.
  • npm run lint passed on the changed files.
  • The React Compiler compliance check passed.
  • Jest passed: PayActionButtonTest, useSelectionModeReportActions.test, and MoneyRequestReportPreview.test (79 tests).

view run


const formattedAmount = getTotalAmountForIOUReportPreviewButton(iouReport, policy, reportPreviewAction, transactions, convertToDisplayString);

// Only the pay flow opens this menu; approve surfaces its partial/full choice in the approve dropdown instead.

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.

❌ CONSISTENCY-3 (docs)

This new openHoldMenu helper duplicates logic that now lives in three places: here, in useSelectionModeReportActions.ts, and in MoneyReportHeaderModals.tsx. All three compute hasOnlyHeldExpenses / getNonHeldAndFullAmount, assemble the same showHoldMenu({... nonHeldAmount, fullAmount, hasNonHeldExpenses, transactionCount ...}) payload, and then defer the open by one frame on iOS with the identical if (getPlatform() === CONST.PLATFORM.IOS) { requestAnimationFrame(...) } block. This is a DRY violation that will drift as the hold-menu payload evolves.

Extract the shared payload assembly and the iOS deferral into a single reusable helper (for example a small function or an addition to useHoldMenuModal) and call it from all three sites. At minimum, factor the verbatim iOS deferral block into a shared helper so the requestAnimationFrame timing logic exists in one place:

// e.g. src/libs/runAfterTouchFrame.ts
function openAfterTouchFrame(open: () => void) {
    if (getPlatform() === CONST.PLATFORM.IOS) {
        requestAnimationFrame(open);
        return;
    }
    open();
}

Reviewed at: c8158a6 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3265ee6. I added src/libs/HoldMenuUtils.ts with two helpers:

  • getHoldMenuAmounts builds nonHeldAmount, fullAmount, hasNonHeldExpenses, and transactionCount.
  • openAfterTouchFrame holds the iOS one-frame deferral. It returns a promise, so MoneyReportHeaderModals keeps its Promise<void> contract.

All three callers now use them: PayActionButton, useSelectionModeReportActions, and MoneyReportHeaderModals. Each caller passes only what differs: the IDs, the payment fields, and onConfirm. tests/unit/HoldMenuUtilsTest.ts covers both helpers.


view run

const {nonHeldAmount, fullAmount, hasValidNonHeldAmount} = getNonHeldAndFullAmount(report, shouldShowPayButton, transactions, convertToDisplayString);
const hasOnlyHeldExpenses = hasOnlyHeldExpensesReportUtils(transactions);

const openHoldMenu = (requestType: ActionHandledType, paymentType?: PaymentMethodType, methodID?: number, onConfirm?: () => void) => {

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.

❌ CONSISTENCY-3 (docs)

This openHoldMenu helper duplicates the one added to PayActionButton.tsx (and the equivalent already in MoneyReportHeaderModals.tsx): the same showHoldMenu({... nonHeldAmount, fullAmount, hasNonHeldExpenses, transactionCount ...}) payload assembly and the same if (getPlatform() === CONST.PLATFORM.IOS) { requestAnimationFrame(() => open()); return; } iOS deferral. Keeping three near-identical copies means any change to the hold-menu contract or the deferral timing must be applied in multiple files.

Consolidate the shared payload building and the iOS deferral into a single reusable helper (or fold it into useHoldMenuModal.showHoldMenu) and have each caller pass only the data that actually differs (e.g. the selection-mode onConfirm that clears the selection).


Reviewed at: c8158a6 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3265ee6. This hook now calls the shared getHoldMenuAmounts and openAfterTouchFrame helpers from src/libs/HoldMenuUtils.ts. PayActionButton and MoneyReportHeaderModals call them too. The hook passes only its own data: the VBBA-only methodID and the onConfirm that clears the selection.


view run

@@ -74,14 +85,45 @@ function PayActionButton() {

const formattedAmount = getTotalAmountForIOUReportPreviewButton(iouReport, policy, reportPreviewAction, transactions, convertToDisplayString);

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.

❌ CONSISTENCY-15 (docs)

This comment joins two independent sentences with a semicolon, which the plain-comment-style rule calls out. Split it into two sentences:

// Only the pay flow opens this menu. Approve surfaces its partial/full choice in the approve dropdown instead.

Reviewed at: c8158a6 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3265ee6. I split the comment into two sentences.


view run

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

@MelvinBot
Fix comments

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team as a code owner October 23, 2026 09:58
@melvin-bot
melvin-bot Bot requested a review from roryabraham October 23, 2026 09:58
@melvin-bot
melvin-bot Bot removed the request for review from a team October 23, 2026 09:58
@melvin-bot

melvin-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown

@roryabraham 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 fixed the three review comments and pushed 3265ee6. I also replied in each thread.

  • CONSISTENCY-3 (both comments): I added src/libs/HoldMenuUtils.ts with two helpers. getHoldMenuAmounts builds the hold-menu amounts. openAfterTouchFrame waits one frame on iOS before it opens the menu. PayActionButton, useSelectionModeReportActions, and MoneyReportHeaderModals now all use these helpers. Each caller passes only its own data.
  • CONSISTENCY-15: I split the semicolon comment in PayActionButton into two sentences.
Checks
  • Added tests/unit/HoldMenuUtilsTest.ts for both helpers.
  • Jest passed: 116 tests in 7 suites (the new test, the selection-mode hook, PayActionButton, the report preview, and the MoneyReportHeader selection-mode, focus, and placement tests).
  • npm run typecheck, lint on the changed files, oxfmt, cspell, and the React Compiler compliance check all passed.
  • I left the hold-menu code in ExpenseReportListItem alone. It uses snapshot fallbacks and has no iOS deferral, so it doesn't fit these helpers.

view run

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Fixed the failing Compare knip issues against main check. Knip flagged HoldMenuAmounts in src/libs/HoldMenuUtils.ts as an unused exported type, since nothing imports it. I removed the export type line in 640e80c. The type is still used inside the file as the return type of getHoldMenuAmounts.

The other failing checks are checklist and Check independent approval. They need reviewer action, not a code change.


view run

@ZhenjaHorbach

ZhenjaHorbach commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified 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
Screen.Recording.2026-10-23.at.13.19.55.mov
Android: mWeb Chrome
Screen.Recording.2026-10-23.at.13.18.21.mov
iOS: HybridApp
Screen.Recording.2026-10-23.at.13.15.57.mov
iOS: mWeb Safari
Screen.Recording.2026-10-23.at.13.06.36.mov
MacOS: Chrome / Safari
Screen.Recording.2026-10-23.at.13.02.19.mov

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

LGTM!

Comment thread src/libs/HoldMenuUtils.ts

/** Opens a modal. On iOS, it waits one frame first so the current touch animation finishes before the modal opens. */
function openAfterTouchFrame<T>(open: () => T | PromiseLike<T>): Promise<T> {
if (getPlatform() === CONST.PLATFORM.IOS) {

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.

This doesn't confirm to our cross-platform code philosophy. Let's just drop the platform check. Waiting one frame on all platforms shouldn't be a problem I think.

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.

It also doesn't seem like it needs to return a promise? Maybe we can just use requestAnimationFrame directly at the callsites?

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.

It's just reusing the old logic from MoneyReportHeaderModals

Image

But I will check how we can improve it!

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

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.

3 participants