[PR #6957] Retrofit dashboard hooks to use react-query #6844

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

Original Pull Request: https://github.com/actualbudget/actual/pull/6957

State: closed
Merged: Yes


Renamed some hooks to better reflect the terms used in the UI IMO:
useDashboard(pageId: string): Widget[] --> useDashboardPageWidgets(pageId: string): DashboardWidgetEntity[]
useWidget(id: string): Widget --> useDashboardWidget(id: string): DashboardWidgetEntity

Renamed type Widget to DashboardWidget


Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 27 14.65 MB → 14.67 MB (+17.75 kB) +0.12%
loot-core 1 5.86 MB → 5.86 MB (-79 B) -0.00%
api 1 4.4 MB → 4.4 MB (-85 B) -0.00%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
27 14.65 MB → 14.67 MB (+17.75 kB) +0.12%
Changeset
File Δ Size
src/components/reports/useDashboardWidgetCopyMenu.ts 🆕 +1.31 kB 0 B → 1.31 kB
src/hooks/useDashboardWidget.ts 🆕 +732 B 0 B → 732 B
src/hooks/useDashboardPages.ts 🆕 +581 B 0 B → 581 B
src/reports/queries.ts 📈 +835 B (+334.00%) 250 B → 1.06 kB
src/reports/mutations.ts 📈 +10.65 kB (+305.55%) 3.49 kB → 14.14 kB
src/components/reports/Overview.tsx 📈 +2.5 kB (+10.34%) 24.21 kB → 26.71 kB
src/components/reports/DashboardHeader.tsx 📈 +210 B (+6.13%) 3.35 kB → 3.55 kB
src/components/reports/DashboardSelector.tsx 📈 +166 B (+4.63%) 3.5 kB → 3.66 kB
src/components/reports/ReportsDashboardRouter.tsx 📈 +136 B (+4.37%) 3.04 kB → 3.17 kB
src/components/reports/reports/CashFlow.tsx 📈 +373 B (+4.06%) 8.97 kB → 9.33 kB
src/components/reports/reports/Formula.tsx 📈 +377 B (+3.82%) 9.65 kB → 10.01 kB
src/components/reports/SaveReport.tsx 📈 +449 B (+3.12%) 14.04 kB → 14.48 kB
src/components/reports/reports/BudgetAnalysis.tsx 📈 +567 B (+2.63%) 21.05 kB → 21.6 kB
src/components/reports/reports/NetWorth.tsx 📈 +375 B (+2.50%) 14.64 kB → 15 kB
src/components/reports/reports/Spending.tsx 📈 +559 B (+2.34%) 23.34 kB → 23.89 kB
src/components/reports/reports/Summary.tsx 📈 +566 B (+2.02%) 27.38 kB → 27.93 kB
src/components/reports/reports/Crossover.tsx 📈 +575 B (+1.36%) 41.27 kB → 41.83 kB
src/components/reports/reports/Calendar.tsx 📈 +346 B (+1.16%) 29.04 kB → 29.37 kB
src/components/reports/reports/MarkdownCard.tsx 📈 +9 B (+0.16%) 5.66 kB → 5.67 kB
src/components/reports/reports/FormulaCard.tsx 📈 +9 B (+0.13%) 6.63 kB → 6.64 kB
src/components/reports/reports/SummaryCard.tsx 📈 +9 B (+0.12%) 7.1 kB → 7.11 kB
src/components/reports/reports/BudgetAnalysisCard.tsx 📈 +9 B (+0.11%) 7.72 kB → 7.73 kB
src/components/reports/reports/SpendingCard.tsx 📈 +9 B (+0.11%) 8.07 kB → 8.08 kB
src/components/reports/reports/NetWorthCard.tsx 📈 +9 B (+0.10%) 8.61 kB → 8.62 kB
src/components/reports/reports/CustomReportListCards.tsx 📈 +9 B (+0.09%) 9.29 kB → 9.3 kB
src/components/reports/reports/CrossoverCard.tsx 📈 +9 B (+0.08%) 10.73 kB → 10.74 kB
src/components/reports/reports/CashFlowCard.tsx 📈 +9 B (+0.08%) 11.29 kB → 11.3 kB
src/components/reports/reports/CalendarCard.tsx 📈 +9 B (+0.07%) 12.67 kB → 12.68 kB
src/components/rules/RuleRow.tsx 📉 -2 B (-0.02%) 10.83 kB → 10.83 kB
src/components/reports/graphs/NetWorthGraph.tsx 📉 -8 B (-0.03%) 23.37 kB → 23.36 kB
src/components/modals/CopyWidgetToDashboardModal.tsx 📉 -4 B (-0.19%) 2.03 kB → 2.03 kB
src/hooks/useReport.ts 📉 -2 B (-0.32%) 616 B → 614 B
src/hooks/useDashboard.ts 🔥 -1.42 kB (-100%) 1.42 kB → 0 B
src/components/reports/useWidgetCopyMenu.ts 🔥 -1.3 kB (-100%) 1.3 kB → 0 B
src/hooks/useWidget.ts 🔥 -769 B (-100%) 769 B → 0 B
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/ReportRouter.js 1.13 MB → 1.15 MB (+17.79 kB) +1.54%

Smaller

Asset File Size % Changed
static/js/index.js 9.49 MB → 9.49 MB (-45 B) -0.00%

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 12.94 kB 0%
static/js/workbox-window.prod.es5.js 5.64 kB 0%
static/js/da.js 106.62 kB 0%
static/js/de.js 180.44 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/en.js 164.99 kB 0%
static/js/es.js 173.83 kB 0%
static/js/fr.js 179.97 kB 0%
static/js/it.js 171.44 kB 0%
static/js/nb-NO.js 157.23 kB 0%
static/js/nl.js 106.65 kB 0%
static/js/pl.js 88.64 kB 0%
static/js/pt-BR.js 154.57 kB 0%
static/js/sv.js 78.2 kB 0%
static/js/th.js 182.35 kB 0%
static/js/uk.js 215.11 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.54 kB 0%
static/js/narrow.js 638.5 kB 0%
static/js/TransactionList.js 106.13 kB 0%
static/js/wide.js 164.05 kB 0%
static/js/AppliedFilters.js 9.71 kB 0%
static/js/usePayeeRuleCounts.js 10.05 kB 0%
static/js/useTransactionBatchActions.js 13.23 kB 0%
static/js/FormulaEditor.js 1.04 MB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.86 MB → 5.86 MB (-79 B) -0.00%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/platform/server/connection/index.ts 📈 +14 B (+0.36%) 3.8 kB → 3.81 kB
home/runner/work/actual/actual/packages/loot-core/src/server/dashboard/app.ts 📉 -93 B (-0.95%) 9.6 kB → 9.51 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.B1M_Dlbo.js 0 B → 5.86 MB (+5.86 MB) -

Removed

Asset File Size % Changed
kcab.worker.hYlRL2CV.js 5.86 MB → 0 B (-5.86 MB) -100%

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged
No assets were unchanged


api

Total

Files count Total bundle size % Changed
1 4.4 MB → 4.4 MB (-85 B) -0.00%
Changeset
File Δ Size
src/server/dashboard/app.ts 📉 -85 B (-0.97%) 8.6 kB → 8.51 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller

Asset File Size % Changed
bundle.api.js 4.4 MB → 4.4 MB (-85 B) -0.00%

Unchanged
No assets were unchanged

**Original Pull Request:** https://github.com/actualbudget/actual/pull/6957 **State:** closed **Merged:** Yes --- <!-- 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. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> Renamed some hooks to better reflect the terms used in the UI IMO: `useDashboard(pageId: string): Widget[]` --> `useDashboardPageWidgets(pageId: string): DashboardWidgetEntity[]` `useWidget(id: string): Widget` --> `useDashboardWidget(id: string): DashboardWidgetEntity` Renamed `type Widget` to `DashboardWidget` <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 27 | 14.65 MB → 14.67 MB (+17.75 kB) | +0.12% loot-core | 1 | 5.86 MB → 5.86 MB (-79 B) | -0.00% api | 1 | 4.4 MB → 4.4 MB (-85 B) | -0.00% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 27 | 14.65 MB → 14.67 MB (+17.75 kB) | +0.12% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/components/reports/useDashboardWidgetCopyMenu.ts` | 🆕 +1.31 kB | 0 B → 1.31 kB `src/hooks/useDashboardWidget.ts` | 🆕 +732 B | 0 B → 732 B `src/hooks/useDashboardPages.ts` | 🆕 +581 B | 0 B → 581 B `src/reports/queries.ts` | 📈 +835 B (+334.00%) | 250 B → 1.06 kB `src/reports/mutations.ts` | 📈 +10.65 kB (+305.55%) | 3.49 kB → 14.14 kB `src/components/reports/Overview.tsx` | 📈 +2.5 kB (+10.34%) | 24.21 kB → 26.71 kB `src/components/reports/DashboardHeader.tsx` | 📈 +210 B (+6.13%) | 3.35 kB → 3.55 kB `src/components/reports/DashboardSelector.tsx` | 📈 +166 B (+4.63%) | 3.5 kB → 3.66 kB `src/components/reports/ReportsDashboardRouter.tsx` | 📈 +136 B (+4.37%) | 3.04 kB → 3.17 kB `src/components/reports/reports/CashFlow.tsx` | 📈 +373 B (+4.06%) | 8.97 kB → 9.33 kB `src/components/reports/reports/Formula.tsx` | 📈 +377 B (+3.82%) | 9.65 kB → 10.01 kB `src/components/reports/SaveReport.tsx` | 📈 +449 B (+3.12%) | 14.04 kB → 14.48 kB `src/components/reports/reports/BudgetAnalysis.tsx` | 📈 +567 B (+2.63%) | 21.05 kB → 21.6 kB `src/components/reports/reports/NetWorth.tsx` | 📈 +375 B (+2.50%) | 14.64 kB → 15 kB `src/components/reports/reports/Spending.tsx` | 📈 +559 B (+2.34%) | 23.34 kB → 23.89 kB `src/components/reports/reports/Summary.tsx` | 📈 +566 B (+2.02%) | 27.38 kB → 27.93 kB `src/components/reports/reports/Crossover.tsx` | 📈 +575 B (+1.36%) | 41.27 kB → 41.83 kB `src/components/reports/reports/Calendar.tsx` | 📈 +346 B (+1.16%) | 29.04 kB → 29.37 kB `src/components/reports/reports/MarkdownCard.tsx` | 📈 +9 B (+0.16%) | 5.66 kB → 5.67 kB `src/components/reports/reports/FormulaCard.tsx` | 📈 +9 B (+0.13%) | 6.63 kB → 6.64 kB `src/components/reports/reports/SummaryCard.tsx` | 📈 +9 B (+0.12%) | 7.1 kB → 7.11 kB `src/components/reports/reports/BudgetAnalysisCard.tsx` | 📈 +9 B (+0.11%) | 7.72 kB → 7.73 kB `src/components/reports/reports/SpendingCard.tsx` | 📈 +9 B (+0.11%) | 8.07 kB → 8.08 kB `src/components/reports/reports/NetWorthCard.tsx` | 📈 +9 B (+0.10%) | 8.61 kB → 8.62 kB `src/components/reports/reports/CustomReportListCards.tsx` | 📈 +9 B (+0.09%) | 9.29 kB → 9.3 kB `src/components/reports/reports/CrossoverCard.tsx` | 📈 +9 B (+0.08%) | 10.73 kB → 10.74 kB `src/components/reports/reports/CashFlowCard.tsx` | 📈 +9 B (+0.08%) | 11.29 kB → 11.3 kB `src/components/reports/reports/CalendarCard.tsx` | 📈 +9 B (+0.07%) | 12.67 kB → 12.68 kB `src/components/rules/RuleRow.tsx` | 📉 -2 B (-0.02%) | 10.83 kB → 10.83 kB `src/components/reports/graphs/NetWorthGraph.tsx` | 📉 -8 B (-0.03%) | 23.37 kB → 23.36 kB `src/components/modals/CopyWidgetToDashboardModal.tsx` | 📉 -4 B (-0.19%) | 2.03 kB → 2.03 kB `src/hooks/useReport.ts` | 📉 -2 B (-0.32%) | 616 B → 614 B `src/hooks/useDashboard.ts` | 🔥 -1.42 kB (-100%) | 1.42 kB → 0 B `src/components/reports/useWidgetCopyMenu.ts` | 🔥 -1.3 kB (-100%) | 1.3 kB → 0 B `src/hooks/useWidget.ts` | 🔥 -769 B (-100%) | 769 B → 0 B </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/ReportRouter.js | 1.13 MB → 1.15 MB (+17.79 kB) | +1.54% **Smaller** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 9.49 MB → 9.49 MB (-45 B) | -0.00% **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/indexeddb-main-thread-worker-e59fee74.js | 12.94 kB | 0% static/js/workbox-window.prod.es5.js | 5.64 kB | 0% static/js/da.js | 106.62 kB | 0% static/js/de.js | 180.44 kB | 0% static/js/en-GB.js | 7.18 kB | 0% static/js/en.js | 164.99 kB | 0% static/js/es.js | 173.83 kB | 0% static/js/fr.js | 179.97 kB | 0% static/js/it.js | 171.44 kB | 0% static/js/nb-NO.js | 157.23 kB | 0% static/js/nl.js | 106.65 kB | 0% static/js/pl.js | 88.64 kB | 0% static/js/pt-BR.js | 154.57 kB | 0% static/js/sv.js | 78.2 kB | 0% static/js/th.js | 182.35 kB | 0% static/js/uk.js | 215.11 kB | 0% static/js/resize-observer.js | 18.37 kB | 0% static/js/BackgroundImage.js | 120.54 kB | 0% static/js/narrow.js | 638.5 kB | 0% static/js/TransactionList.js | 106.13 kB | 0% static/js/wide.js | 164.05 kB | 0% static/js/AppliedFilters.js | 9.71 kB | 0% static/js/usePayeeRuleCounts.js | 10.05 kB | 0% static/js/useTransactionBatchActions.js | 13.23 kB | 0% static/js/FormulaEditor.js | 1.04 MB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.86 MB → 5.86 MB (-79 B) | -0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/platform/server/connection/index.ts` | 📈 +14 B (+0.36%) | 3.8 kB → 3.81 kB `home/runner/work/actual/actual/packages/loot-core/src/server/dashboard/app.ts` | 📉 -93 B (-0.95%) | 9.6 kB → 9.51 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.B1M_Dlbo.js | 0 B → 5.86 MB (+5.86 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.hYlRL2CV.js | 5.86 MB → 0 B (-5.86 MB) | -100% **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 4.4 MB → 4.4 MB (-85 B) | -0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/server/dashboard/app.ts` | 📉 -85 B (-0.97%) | 8.6 kB → 8.51 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** Asset | File Size | % Changed ----- | --------- | --------- bundle.api.js | 4.4 MB → 4.4 MB (-85 B) | -0.00% **Unchanged** No assets were unchanged </div> </details> </details> <!--- bundlestats-action-comment key:combined end --->
GiteaMirror added the pull-request label 2026-02-28 21:33:28 -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#6844