Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
8 changes: 8 additions & 0 deletions tests/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ def test_hourly_peak_hour_constants(self):
self.assertIn('PEAK_HOURS_UTC', HTML_TEMPLATE)
self.assertIn('[12, 13, 14, 15, 16, 17]', HTML_TEMPLATE)

def test_hourly_filter_uses_selected_range_bounds(self):
"""Hourly dashboard rows use the same selected date bounds as daily rows."""
self.assertNotIn("cutoff", HTML_TEMPLATE)
self.assertGreaterEqual(
HTML_TEMPLATE.count("(!start || r.day >= start) && (!end || r.day <= end)"),
2,
)


class TestPricingParity(unittest.TestCase):
"""Verify CLI and dashboard pricing tables stay in sync."""
Expand Down