From 51a2af766680194746a49ad65d4c558028381093 Mon Sep 17 00:00:00 2001 From: Jackie Yeh Date: Wed, 13 May 2026 18:38:31 +0800 Subject: [PATCH] fix: replace undefined cutoff with start/end range in hourly filter The hourly chart filter referenced an undefined `cutoff` variable left over from the range-bounds refactor, throwing a ReferenceError that broke dashboard rendering. Switch to the same `start`/`end` bounds the daily and session filters use, which also fixes a silent data-mismatch where the hourly chart ignored upper bounds (e.g. prev-month, week). --- dashboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard.py b/dashboard.py index ebf8d5f..a6621a4 100644 --- a/dashboard.py +++ b/dashboard.py @@ -742,7 +742,7 @@ def get_dashboard_data(db_path=DB_PATH): // Hourly aggregation (filtered by model + range, then bucketed by UTC hour) const hourlySrc = (rawData.hourly_by_model || []).filter(r => - selectedModels.has(r.model) && (!cutoff || r.day >= cutoff) + selectedModels.has(r.model) && (!start || r.day >= start) && (!end || r.day <= end) ); const hourlyAgg = aggregateHourly(hourlySrc, hourlyTZ);