fix: add a global dashboard filter bar (#24)
CI / build-and-test (pull_request) Successful in 2m46s

The reporting period was baked into the data service, so nothing could
change what the dashboard shows without editing code.

- DashboardFilter (period + optional region) parameterises every
  ChartDataService query; the no-arg overloads are the default filter.
- DashboardContext is the bus between the new DashboardFilterBar and the
  widgets: charts subscribe in WidgetRegistry, KPI tiles in DashboardView.
- Updates go through updateData, so widgets patch in place instead of
  being rebuilt; SparklineChart gained the same path.
- KpiData carries the number, the bundle the unit and number pattern, so
  a KPI value can follow the filter and stay locale-formatted.
- Filter state is deliberately not persisted, unlike the grid layout.

Closes #24

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0124BiJikbhbiEsNfJxdWM69
This commit is contained in:
Pit Friedrich
2026-07-28 20:52:33 +02:00
parent cdbd61aefb
commit df5d1a9b9b
19 changed files with 762 additions and 84 deletions
@@ -31,14 +31,24 @@ gridstack.pickerTitle=Choose a widget
gridstack.dragHandle=Move
gridstack.close=Close
filter.period=Period
filter.period.month=Month
filter.period.quarter=Quarter
filter.period.halfYear=Half year
filter.period.year=Year
filter.region=Region
filter.allRegions=All regions
# The KPI values are MessageFormat patterns: the number comes from the data
# service (it depends on the filter), unit and number format from the bundle.
kpi.revenueTotal=Total revenue
kpi.revenueTotal.value=1.24M
kpi.revenueTotal.value={0,number,#,##0.00}M
kpi.openOrders=Open orders
kpi.openOrders.value=38
kpi.openOrders.value={0,number,#,##0}
kpi.newCustomers=New customers
kpi.newCustomers.value=112
kpi.newCustomers.value={0,number,#,##0}
kpi.averageOrderValue=Avg. order value
kpi.averageOrderValue.value=486
kpi.averageOrderValue.value={0,number,#,##0}
chart.revenueSeries=Revenue 2026
chart.pointClick=Series {0}, point {1}
@@ -50,6 +60,17 @@ month.mar=Mar
month.apr=Apr
month.may=May
month.jun=Jun
month.jul=Jul
month.aug=Aug
month.sep=Sep
month.oct=Oct
month.nov=Nov
month.dec=Dec
week.1=Week 1
week.2=Week 2
week.3=Week 3
week.4=Week 4
region.north=North
region.south=South