Skip to content

[Due for payment 2026-11-09] [$175] [Batch 3] Replace ProcessMoneyReportHoldMenu with useHoldMenuModal in SelectionToolbar and report preview (2 modals) #102977

Open

Description

@MelvinBot

Part of #80285.

Problem

ProcessMoneyReportHoldMenu is an older, pay-only copy of the global HoldMenuModalWrapper. Both are built on useHoldMenuSubmit and render the same DecisionModal. Move its two callers to useHoldMenuModal().showHoldMenu, then delete the component. The header already does this in MoneyReportHeaderSelectionDropdown.tsx:212-219.

Modals in this batch

Instance Notes
src/components/MoneyRequestReportView/SelectionToolbar/index.tsx:333-347 The selection-mode pay hold menu. Call showHoldMenu inside the onHoldMenuOpen handlers in useSelectionModeReportActions.ts:106-112 and :249-254. Pass requestType, paymentType, methodID, the amounts, and onConfirm. Forward the currently dropped _onConfirm, the way the header dropdown does. transactionCount currently includes expenses being deleted, so pass it in or accept the small difference.
src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHoldMenu.tsx:29-41 The report-preview pay hold menu. Call showHoldMenu directly from PayActionButton.confirmPayment. Compute the amounts with getNonHeldAndFullAmount, pass the report IDs (the wrapper reads the reports from Onyx), and pass onConfirm: startAnimation.

Code to remove

  • src/components/ProcessMoneyReportHoldMenu.tsx. Point the type-only ActionHandledType imports in useSelectionModePayment.ts and useSelectionModeReportActions.ts at @hooks/useHoldMenuSubmit.
  • In useSelectionModeReportActions.ts: the isHoldMenuVisible, paymentType, requestType, and selectedVBBAToPayFromHoldMenu state (L85-88), plus handleHoldMenuClose.
  • In SelectionToolbar: the hold-menu block and the values it reads from the hook.
  • In the report preview: ReportPreviewHoldMenu.tsx, its use in MoneyRequestReportPreviewBody.tsx, and the holdMenu state and ReportPreviewHoldMenuContext in MoneyRequestReportPreviewProvider.tsx and MoneyRequestReportPreviewContext.ts.

Tests to update

  • tests/ui/components/ReportPreviewHoldMenuTest.tsx: delete it or rewrite it.
  • tests/ui/MoneyRequestReportPreview.test.tsx: mock useHoldMenuModal instead of ProcessMoneyReportHoldMenu.
  • tests/unit/hooks/useSelectionModeReportActions.test.ts: it checks isHoldMenuVisible, handleHoldMenuClose, and handleHoldMenuConfirm.

Gotchas

  1. Amounts become a snapshot taken at show time. The header and ExpenseReportListItem already rely on this.
  2. iOS timing. MoneyReportHeaderModals.tsx:103-109 waits one animation frame on iOS before opening. Consider doing the same here.
  3. Unmount safety improves. Confirming currently clears the selection and unmounts the toolbar while the modal closes. A global modal survives that.

Acceptance criteria

  • Paying a report with held expenses shows the hold menu from both selection mode and the report preview, and both "pay only" and "pay full amount" behave as before.
  • ProcessMoneyReportHoldMenu and ReportPreviewHoldMenu are deleted.
  • Existing relevant tests pass. Add or update coverage where needed.
Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @ZhenjaHorbach

Activity

  1. melvin-bot commented on Oct 8, 2026

    @melvin-bot
  2. melvin-bot commented on Oct 12, 2026

    @melvin-bot
  3. ZhenjaHorbach commented on Oct 13, 2026

    @ZhenjaHorbach
  4. melvin-bot commented on Oct 16, 2026

    @melvin-bot
  5. melvin-bot commented on Oct 20, 2026

    @melvin-bot
  6. roryabraham commented on Oct 20, 2026

    @roryabraham
    Contributor

    Making this a weekly

  7. ZhenjaHorbach commented on Oct 21, 2026

    @ZhenjaHorbach
    Contributor

    @MelvinBot
    Create the PR to migrate all modals from the issue description

  8. MelvinBot commented on Oct 21, 2026

    @MelvinBot
    ContributorAuthor

    🤖 Draft PR created: Replace ProcessMoneyReportHoldMenu with useHoldMenuModal in SelectionToolbar and report preview
    Please mark it as "Ready for review" or ask me to do that for you when it is ready for review.

    It moves both callers in the issue to useHoldMenuModal().showHoldMenu. It also deletes ProcessMoneyReportHoldMenu, ReportPreviewHoldMenu, and the related state and context.

    • Selection mode: both onHoldMenuOpen handlers now open the global modal. The dropped lifecycle onConfirm is now forwarded, as the header dropdown does.
    • Report preview: PayActionButton.confirmPayment opens the global modal directly with onConfirm: startAnimation.
    • iOS: both callers wait one animation frame before opening, matching the header.

    One expected difference: selection mode's transactionCount now excludes expenses pending deletion.

    Checks: typecheck, ESLint, and the React Compiler check pass. Related Jest suites pass: 23 suites, 495 tests.

    Not yet tested: the manual pay flow. An automated web run failed because the test session showed a blank page before reaching the app. spell-changed could not run in the shallow clone.

  9. changed the title [-][Batch 3] Replace ProcessMoneyReportHoldMenu with useHoldMenuModal in SelectionToolbar and report preview (2 modals)[/-] [+][$175] [Batch 3] Replace ProcessMoneyReportHoldMenu with useHoldMenuModal in SelectionToolbar and report preview (2 modals)[/+] on Oct 23, 2026
  10. melvin-bot commented on Oct 23, 2026

    @melvin-bot
  11. added and removed
    ReviewingHas a PR in review
    on Nov 2, 2026
  12. changed the title [-][$175] [Batch 3] Replace ProcessMoneyReportHoldMenu with useHoldMenuModal in SelectionToolbar and report preview (2 modals)[/-] [+][Due for payment 2026-11-09] [$175] [Batch 3] Replace ProcessMoneyReportHoldMenu with useHoldMenuModal in SelectionToolbar and report preview (2 modals)[/+] on Nov 2, 2026
  13. melvin-bot commented on Nov 2, 2026

    @melvin-bot

    @ZhenjaHorbach

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.27-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-11-09. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions