Matt
681b94a8ef
feat(reports): prior-period comparison toggle on the Sales report
...
Adds a "Compare to prior period" toggle to the Sales report header.
When on, the API recomputes the KPI window for the equal-length window
immediately preceding the selected range (previousPeriodBounds) behind
`?compare=1`, and the five window-derived KPI tiles (Won, Lost, Win
rate, Avg time-to-close, New leads) render colour-correct "vs prior"
deltas. Point-in-time tiles (Active interests, Pipeline value) have no
prior-window analogue and intentionally show no delta. The prior-window
query runs in parallel with the main batch and resolves to null when the
toggle is off (zero cost). Toggle state persists in the saved-template
config.
Closes the spec's "period comparison on every report" gap for Sales;
Operational already rendered period-start deltas.
Pure helpers TDD'd: previousPeriodBounds (range.ts) +
computeSalesKpiComparison (sales-comparison.ts), 7 unit tests. tsc +
lint clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-05-31 18:49:35 +02:00
..
2026-05-31 18:49:35 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-04 22:57:01 +02:00
2026-05-25 16:03:14 +02:00
2026-05-06 14:57:24 +02:00
2026-05-23 00:52:59 +02:00
2026-05-07 20:58:34 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-05 04:07:03 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-26 21:48:19 +02:00
2026-05-23 00:52:59 +02:00
2026-05-26 18:48:15 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-25 15:09:35 +02:00
2026-05-25 15:09:35 +02:00
2026-05-25 15:09:35 +02:00
2026-05-25 16:03:14 +02:00
2026-05-23 00:52:59 +02:00
2026-05-27 22:42:37 +02:00
2026-05-27 22:42:37 +02:00
2026-05-23 00:52:59 +02:00
2026-05-18 13:28:50 +02:00
2026-05-12 18:16:18 +02:00
2026-05-26 21:09:50 +02:00
2026-05-18 13:28:50 +02:00
2026-05-24 20:41:27 +02:00
2026-05-23 00:52:59 +02:00
2026-05-25 15:09:35 +02:00
2026-05-23 00:52:59 +02:00
2026-05-26 20:06:12 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-12 21:11:23 +02:00
2026-05-25 13:11:19 +02:00
2026-05-26 20:06:12 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-04 22:57:01 +02:00
2026-05-23 00:52:59 +02:00
2026-05-05 20:18:05 +02:00
2026-05-23 00:52:59 +02:00
2026-05-04 22:57:01 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-27 22:42:37 +02:00
2026-05-06 14:57:24 +02:00
2026-05-13 12:07:57 +02:00
2026-05-04 22:57:01 +02:00
2026-05-23 00:52:59 +02:00
2026-05-27 22:42:37 +02:00
2026-05-23 00:52:59 +02:00
2026-05-25 13:15:22 +02:00
2026-05-23 00:52:59 +02:00
2026-05-26 21:57:20 +02:00
2026-05-05 20:48:13 +02:00
2026-05-25 16:03:14 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-25 03:40:37 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-26 21:57:20 +02:00
2026-05-27 22:42:37 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-12 20:51:49 +02:00
2026-05-23 00:52:59 +02:00
2026-05-27 22:42:37 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-13 12:27:08 +02:00
2026-05-23 00:52:59 +02:00
2026-05-25 03:40:37 +02:00
2026-05-23 00:52:59 +02:00
2026-05-26 22:05:14 +02:00
2026-05-23 00:52:59 +02:00
2026-05-25 15:09:35 +02:00
2026-05-23 00:52:59 +02:00
2026-05-25 15:17:06 +02:00
2026-05-24 20:41:27 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-04 22:57:01 +02:00
2026-05-13 12:07:57 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-27 22:41:53 +02:00
2026-05-25 14:26:18 +02:00
2026-05-25 14:26:18 +02:00
2026-05-23 00:52:59 +02:00
2026-05-13 12:07:57 +02:00
2026-05-25 15:09:35 +02:00
2026-05-31 18:49:16 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-04-29 01:58:42 +02:00
2026-05-23 00:52:59 +02:00
2026-05-11 13:01:47 +02:00
2026-05-27 22:42:37 +02:00
2026-05-31 18:49:16 +02:00
2026-05-23 00:52:59 +02:00
2026-05-26 21:29:05 +02:00
2026-05-13 12:58:58 +02:00
2026-05-27 22:42:37 +02:00
2026-05-23 00:52:59 +02:00
2026-04-29 01:58:42 +02:00
2026-05-27 22:42:37 +02:00
2026-05-25 15:34:43 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-23 00:52:59 +02:00
2026-05-25 15:09:35 +02:00
2026-05-23 00:52:59 +02:00
2026-05-27 22:42:37 +02:00