fix: add a global dashboard filter bar (#24)
CI / build-and-test (pull_request) Successful in 2m46s
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:
@@ -38,7 +38,7 @@ class WidgetRegistryTest {
|
||||
void register_replacesTheDefinitionOfTheSameType() {
|
||||
int before = registry.definitions().size();
|
||||
WidgetDefinition replacement = new WidgetDefinition(WidgetRegistry.REVENUE_TREND,
|
||||
"card.revenueTrend", 2, 2, () -> null);
|
||||
"card.revenueTrend", 2, 2, context -> null);
|
||||
|
||||
registry.register(replacement);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user