You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Home page Potential Monthly Savings shows $0 while Opportunities shows $212-$314 #749
The Home page "Potential Monthly Savings" KPI shows $0 while the Opportunities page shows $212 – $314 for the same dataset (same Provider/Account filters, "All / All").
These two views must reflect the same underlying recommendation aggregate. Either:
The Home KPI is hitting a different endpoint (or path within the same endpoint) that returns 0, or
The Home KPI is aggregating the wrong field (e.g. current_savings instead of potential_savings, or only "approved" recs instead of all active recs).
Note the recommendation count on Home is 23 -- which matches the variant count on Opportunities. So Home is reading the recs but failing to sum the savings.
Likely root cause hypothesis
frontend/src/dashboard.ts computes the Home KPIs from a separate API call (/api/dashboard or /api/home/kpis -- find the actual endpoint). The handler probably sums a field that is null/zero for all current recommendations. Inspect:
The handler's SELECT to confirm which column it sums.
The recommendation rows in the DB: do they have a potential_monthly_savings value (or equivalent)?
The Opportunities page handler's SELECT, which clearly does produce the correct $212 – $314 range.
If both pages should aggregate the same dataset, the cleanest fix is to make the Home KPI handler call the same aggregation path as Opportunities (factor out a shared aggregator).
Files likely involved
frontend/src/dashboard.ts (Home KPI rendering)
internal/api/handler_home.go or handler_dashboard.go (KPI aggregator)
Compare with internal/api/handler_opportunities.go or equivalent
Verification
After fix:
Home Potential Monthly Savings matches Opportunities Potential Monthly Savings for All/All, then again with a Provider filter, then with an Account filter.
The recommendation count on both pages also matches (depends on linked issue resolution).
Activity
fix(home/kpi): Potential Monthly Savings sums recs same as Opportunit…
cristim commentedon May 28, 2026
Verified shipped: PR #755 (commit 4332f6f, merged 2026-05-27) is in feat/multicloud-web-frontend. dashboard.ts unwraps the recommendations envelope so Potential Monthly Savings sums correctly; tests added in dashboard.test.ts.