Repository navigation
Closed
Labels
DailyKSv2KSv2
Description
Part of #80285.
Problem
Each of these call sites mounts its own DecisionModal. They should use the global useDecisionModal instead. All eight are one-button alerts: no first option, no onModalHide, and fixed translation strings. Each one becomes a single showDecisionModal({title, prompt, secondOptionText}) call, and you can delete the local isVisible state.
Modals in this batch
| Instance | Notes |
|---|---|
src/pages/workspace/WorkspaceMembersPage.tsx:829 |
"Download failed". It is triggered from the "Download CSV" menu item inside a useMemo, so add showDecisionModal to its deps. You can drop isSmallScreenWidth (L137-139). |
src/pages/workspace/perDiem/WorkspacePerDiemPage.tsx:414 |
"Download failed". Same shape as above. useState becomes unused. |
src/pages/workspace/categories/WorkspaceCategoriesPage.tsx:712 |
"Download failed". Keep isSmallScreenWidth, which is still used elsewhere, but update the stale comment at L67. |
src/pages/workspace/tags/WorkspaceTagsPage.tsx:824 |
"Download failed". It has two failure callbacks (multi-level and single-level tags). |
src/pages/workspace/tags/ImportTagsOptionsPage.tsx:298 |
"Download failed". It opens from a link inside a global ConfirmModal prompt. Keep the close(() => showDecisionModal(...)) wrapper. Without it, the ConfirmModal is pushed under the alert and reappears after "OK". Fold the 4 identical callbacks into one helper. |
src/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx:505 |
"Offline". It is triggered by "Deactivate" while offline. You can remove useState and useResponsiveLayout. |
src/pages/Search/SearchTransactionsChangeReport.tsx:380 |
"Offline". It has three trigger sites (create, select, and remove report). You can also drop the fragment wrapper. |
src/components/ImportOnyxState/BaseImportOnyxState.tsx:56 |
"Invalid file". Visibility comes from props owned by index.tsx and index.native.tsx. Call showDecisionModal in each parent's .catch, then remove the isErrorModalVisible props. |
Shared helper
The "Offline" and "Download failed" bodies are already duplicated in useExportActions.ts:114-128 and MoneyReportHeaderModals.tsx:71-85. Consider adding a small hook that returns showOfflineModal and showDownloadFailedModal, and using it here and in those two files. Batches 2 and 4 can then reuse it.
Shared gotchas
shouldHandleNavigationBackflips fromundefinedtotrue(useDecisionModal.ts:14), so browser Back now closes these alerts. This matches the modals that are already migrated.- Props become a snapshot taken at show time.
- Only the top of the global stack renders (
ModalContext.tsx:157).
Acceptance criteria
- All eight instances use
useDecisionModal(), and noDecisionModalimport remains in these files. - Each alert still shows the same title, prompt, and button. On ImportTags, the ConfirmModal does not reappear after the alert closes.
- Existing relevant tests pass. Add or update coverage where needed.
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022110678056437306567
- Upwork Job ID: 2110678056437306567
- Last Price Increase: 2026-10-15
Issue Owner
Current Issue Owner: @ZhenjaHorbachMetadata
Metadata
Assignees
Labels
DailyKSv2KSv2
Activity
melvin-bot commentedon Oct 8, 2026
@roryabraham, @ZhenjaHorbach Whoops! This issue is 2 days overdue. Let's get this updated quick!
ZhenjaHorbach commentedon Oct 9, 2026
@MelvinBot
Create the PR to migrate all modals from the issue description
MelvinBot commentedon Oct 9, 2026
🤖 Draft PR created: Migrate batch 1 one-button alerts from DecisionModal to useDecisionModal
Please mark it as "Ready for review" or ask me to do that for you when it is ready for review.
All eight modals in this issue now call
useDecisionModal(), and none of these files importDecisionModalanymore. A newuseAlertModalshook supplies the shared "Offline" and "Download failed" alerts, anduseExportActionsandMoneyReportHeaderModalsuse it too.ImportTagsOptionsPagekeeps theclose(...)wrapper inside one shared helper, so the ConfirmModal does not reappear after the alert closes.Lint, typecheck, React Compiler, spell check, and 10 related Jest suites (77 tests, including a new
useAlertModalstest) all pass. I couldn't run a browser check of the "Invalid file" alert. The test session was stuck on a blank page, and the web driver can't upload files. Please fill in theTestsandQAsections before marking the PR ready.view run · no recording available
melvin-bot commentedon Oct 12, 2026
@roryabraham, @ZhenjaHorbach Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
ZhenjaHorbach commentedon Oct 13, 2026
Not overdue
Try to complete reviewing the PR today
[-][Batch 1] Refactor DecisionModal usage to useDecisionModal in simple alert modals (8 modals)[/-][+][$175] [Batch 1] Refactor DecisionModal usage to useDecisionModal in simple alert modals (8 modals)[/+]melvin-bot commentedon Oct 15, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022110678056437306567
[-][$175] [Batch 1] Refactor DecisionModal usage to useDecisionModal in simple alert modals (8 modals)[/-][+][Due for payment 2026-10-30] [$175] [Batch 1] Refactor DecisionModal usage to useDecisionModal in simple alert modals (8 modals)[/+]melvin-bot commentedon Oct 23, 2026
@ZhenjaHorbach
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.18-1 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-10-30. 🎊
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]
melvin-bot commentedon Oct 26, 2026
@ZhenjaHorbach Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
roryabraham commentedon Oct 27, 2026
@MelvinBot what code changes remain to be completed in the scope of this issue?
MelvinBot commentedon Oct 27, 2026
No code changes remain. Migrate batch 1 one-button alerts from DecisionModal to useDecisionModal merged on 2026-10-21 and reached production in 9.5.18-1. It covers all eight modals and the shared helper.
The remaining work is not code. Someone still needs to complete the Contributor+ checklist, and payment is due 2026-10-30.
How I checked current
mainDecisionModal. Each one now callsuseDecisionModaldirectly or through the newuseAlertModalshook.useExportActionsandMoneyReportHeaderModalsalso useuseAlertModals.ImportTagsOptionsPagekeeps theclose(...)wrapper inside one helper (ImportTagsOptionsPage.tsx:59-62).isErrorModalVisibleprops are gone.ImportOnyxState/index.tsxandindex.native.tsxcallshowDecisionModalthemselves.WorkspaceCategoriesPageandWorkspacePerDiemPagestill have a localshowOfflineModal(example). It usesshowConfirmModal, notDecisionModal, so it is outside this issue's scope.ZhenjaHorbach commentedon Oct 27, 2026
@roryabraham
Let's close this