The SLA dashboard view (src/components/dashboard/sla-dashboard-view.tsx) implements a comparison mode that fetches metrics for a previous period. The comparisonFilters calculation uses filters.date_from as the end date and subtracts 30 days to compute the start date. However, when filters.date_from is not set, it defaults to Date.now(), which may not align with the user's intended comparison window. The calculation does not account for filters.date_to.
Root cause: Lines 65-75 in src/components/dashboard/sla-dashboard-view.tsx - Fixed 30-day period logic ignores actual filter range.
Why this is architecturally hard
- Comparison window logic assumes fixed 30-day period, but primary filter range may be different
filters.date_to is ignored in comparison calculation
- Backend API expects valid ISO dates; improper calculation can result in date_to before date_from
Acceptance criteria
Getting started
Files: src/components/dashboard/sla-dashboard-view.tsx
The SLA dashboard view (
src/components/dashboard/sla-dashboard-view.tsx) implements a comparison mode that fetches metrics for a previous period. ThecomparisonFilterscalculation usesfilters.date_fromas the end date and subtracts 30 days to compute the start date. However, whenfilters.date_fromis not set, it defaults toDate.now(), which may not align with the user's intended comparison window. The calculation does not account forfilters.date_to.Root cause: Lines 65-75 in src/components/dashboard/sla-dashboard-view.tsx - Fixed 30-day period logic ignores actual filter range.
Why this is architecturally hard
filters.date_tois ignored in comparison calculationAcceptance criteria
Getting started
Files:
src/components/dashboard/sla-dashboard-view.tsx