[PR #4018] [MERGED] [Redux Toolkit Migration] appSlice #5153

Closed
opened 2026-02-28 21:06:54 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/4018
Author: @joel-jeremy
Created: 12/20/2024
Status: Merged
Merged: 1/18/2025
Merged by: @joel-jeremy

Base: masterHead: redux-toolkit-app-slice


📝 Commits (10+)

📊 Changes

42 files changed (+279 additions, -222 deletions)

View changed files

📝 packages/desktop-client/src/components/App.tsx (+1 -2)
📝 packages/desktop-client/src/components/FatalError.tsx (+1 -1)
📝 packages/desktop-client/src/components/FinancesApp.tsx (+2 -1)
📝 packages/desktop-client/src/components/HelpMenu.tsx (+25 -2)
📝 packages/desktop-client/src/components/Titlebar.tsx (+1 -1)
📝 packages/desktop-client/src/components/UpdateNotification.tsx (+2 -2)
📝 packages/desktop-client/src/components/accounts/Account.tsx (+4 -4)
📝 packages/desktop-client/src/components/manager/ConfigServer.tsx (+1 -1)
📝 packages/desktop-client/src/components/manager/ManagementApp.tsx (+3 -2)
📝 packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx (+2 -2)
📝 packages/desktop-client/src/components/mobile/accounts/Accounts.tsx (+3 -2)
📝 packages/desktop-client/src/components/mobile/budget/index.tsx (+2 -1)
📝 packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx (+2 -1)
📝 packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.jsx (+1 -1)
📝 packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx (+2 -2)
📝 packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx (+1 -1)
📝 packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx (+1 -1)
📝 packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx (+1 -1)
📝 packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx (+1 -1)
📝 packages/desktop-client/src/components/reports/Overview.tsx (+2 -2)

...and 22 more files

📄 Description

Reviewers - summary of changes:

  1. Deleted loot-core/client/actions/app.ts and loot-core/client/reducers/app.ts
  2. Changed imports from loot-core/client/actions to desktop-client/app/appSlice
  3. Addition of .unwrap() on dispatch(...) invocations which depend on the result of the dispatch e.g. const payees: PayeeEntity[] = await dispatch(getPayees()) --> const payees: PayeeEntity[] = await dispatch(getPayees()).unwrap()
  4. Actions payloads are now objects for consistency
  5. Since some actions have been removed and replaced with plain calls to window.Actual I had to type the window.Actual object here with a new Actual type and had to update some references to satisfy typescript complaints - most are just change from optional to non-optional i.e. window.Actual?.openFileInBrowser(...) --> window.Actual.openFileInBrowser(...)
    • Removed actions:
      • uploadFile --> moved to desktop-client/src/index.ts
      • openDocsForCurrentPage --> Moved to HelpMenu.tsx
      • reloadApp --> Replaced with window.Actual.reload()
      • focused --> moved to desktop-client/src/index.ts as appFocused

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/4018 **Author:** [@joel-jeremy](https://github.com/joel-jeremy) **Created:** 12/20/2024 **Status:** ✅ Merged **Merged:** 1/18/2025 **Merged by:** [@joel-jeremy](https://github.com/joel-jeremy) **Base:** `master` ← **Head:** `redux-toolkit-app-slice` --- ### 📝 Commits (10+) - [`9175d90`](https://github.com/actualbudget/actual/commit/9175d909005f212ad3ebfc3e7607a57e4e6461e9) Migrate to accountSlice - [`3e41cbb`](https://github.com/actualbudget/actual/commit/3e41cbb716cd2c6bb5632eb02073b1afca3e4854) Fix lint and typecheck errors - [`828219b`](https://github.com/actualbudget/actual/commit/828219b0b3a6d40808f8ff6f4c157ea6489842fe) Update types - [`0e1291d`](https://github.com/actualbudget/actual/commit/0e1291d644dcf8fbda343a047fee868f334e9f98) Fix lint - [`daefe9f`](https://github.com/actualbudget/actual/commit/daefe9fd473502428769b9e262639d74451b9aaf) Fix types - [`db3ab76`](https://github.com/actualbudget/actual/commit/db3ab7670270314aecb9e1c43cf621a71b3788b5) Cleanup - [`8f84d45`](https://github.com/actualbudget/actual/commit/8f84d459926e79d091cfd00690ef77cdc0efd7e8) Rename file - [`aee1fe6`](https://github.com/actualbudget/actual/commit/aee1fe66e26ff75aec3c01c6a9c3d7557654337a) Rename state - [`accffd5`](https://github.com/actualbudget/actual/commit/accffd5aa9d2af8da9d61fd48730e561225e4cb6) Cleanup - [`67ae738`](https://github.com/actualbudget/actual/commit/67ae7382430724d8bd9799fce2b7c8cbdb85ad7b) Fix typecheck error ### 📊 Changes **42 files changed** (+279 additions, -222 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/App.tsx` (+1 -2) 📝 `packages/desktop-client/src/components/FatalError.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/FinancesApp.tsx` (+2 -1) 📝 `packages/desktop-client/src/components/HelpMenu.tsx` (+25 -2) 📝 `packages/desktop-client/src/components/Titlebar.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/UpdateNotification.tsx` (+2 -2) 📝 `packages/desktop-client/src/components/accounts/Account.tsx` (+4 -4) 📝 `packages/desktop-client/src/components/manager/ConfigServer.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/manager/ManagementApp.tsx` (+3 -2) 📝 `packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx` (+2 -2) 📝 `packages/desktop-client/src/components/mobile/accounts/Accounts.tsx` (+3 -2) 📝 `packages/desktop-client/src/components/mobile/budget/index.tsx` (+2 -1) 📝 `packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx` (+2 -1) 📝 `packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.jsx` (+1 -1) 📝 `packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx` (+2 -2) 📝 `packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/reports/Overview.tsx` (+2 -2) _...and 22 more files_ </details> ### 📄 Description <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes --> - [x] `actions/account.ts` / `reducers/account.ts` -> `accounts/accountsSlice.ts` #4012 - [x] `actions/queries.ts` / `reducers/queries.ts` -> `queries/queriesSlice.ts` #4016 - [x] `actions/app.ts` / `reducers/app.ts` -> `app/appSlice.ts` #4018 - [ ] `actions/budgets.ts` / `reducers/budgets.ts` -> `budgets/budgetsSlice.ts` - [ ] `actions/modals.ts` / `reducers/modals.ts` -> `modals/modalsSlice.ts` - [ ] `actions/notifications.ts` / `reducers/notifications.ts` -> `notifications/notificationsSlice.ts` - [ ] `actions/prefs.ts` / `reducers/prefs.ts` -> `prefs/prefsSlice.ts` - [ ] `actions/user.ts` / `reducers/user.ts` -> `users/usersSlice.ts` Reviewers - summary of changes: 1. Deleted loot-core/client/actions/app.ts and loot-core/client/reducers/app.ts 2. Changed imports from loot-core/client/actions to desktop-client/app/appSlice 3. Addition of `.unwrap()` on `dispatch(...)` invocations which depend on the result of the dispatch e.g. `const payees: PayeeEntity[] = await dispatch(getPayees())` --> `const payees: PayeeEntity[] = await dispatch(getPayees()).unwrap()` 4. Actions payloads are now objects for consistency 5. Since some actions have been removed and replaced with plain calls to `window.Actual` I had to type the `window.Actual` object here with a new `Actual` type and had to update some references to satisfy typescript complaints - most are just change from optional to non-optional i.e. `window.Actual?.openFileInBrowser(...)` --> `window.Actual.openFileInBrowser(...)` - Removed actions: - uploadFile --> moved to `desktop-client/src/index.ts` - openDocsForCurrentPage --> Moved to `HelpMenu.tsx` - reloadApp --> Replaced with `window.Actual.reload()` - focused --> moved to `desktop-client/src/index.ts` as `appFocused` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 21:06:54 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#5153