Skip to content

fix: replace undefined cutoff with start/end range in hourly filter#116

Open
q0821 wants to merge 1 commit into
phuryn:mainfrom
q0821:fix/dashboard-cutoff-undefined
Open

fix: replace undefined cutoff with start/end range in hourly filter#116
q0821 wants to merge 1 commit into
phuryn:mainfrom
q0821:fix/dashboard-cutoff-undefined

Conversation

@q0821
Copy link
Copy Markdown

@q0821 q0821 commented May 13, 2026

Summary

  • Dashboard threw ReferenceError: cutoff is not defined at dashboard.py:622 (line 745 in source), breaking applyFilter() and stopping the page from rendering whenever loadData() fired.
  • The reference was a leftover from the range-bounds refactor: the daily and session filters were migrated to use { start, end } from getRangeBounds(), but the hourly filter still referenced the old cutoff variable.
  • Replaces the broken filter with the same start / end bounds the sibling filters use. As a side effect this also fixes a silent data-mismatch: under the broken code the (!cutoff || ...) short-circuit was always truthy, so the hourly chart was rendering the full timeline instead of the selected range — meaning the "Average Hourly Distribution" chart never honored upper bounds like prev-month, month, or week.

Repro (before fix)

  1. Open the dashboard.
  2. Browser console shows:
    ReferenceError: cutoff is not defined
        at (index):622:38
        at Array.filter (<anonymous>)
        at applyFilter ((index):621:53)
        at loadData ((index):1095:5)
    
  3. Charts and tables do not populate.

Test plan

  • Reload dashboard — no console error, charts and tables render.
  • Switch between ranges (week, month, prev-month, 7d, 30d, 90d, all) — hourly chart updates in sync with the daily / model / project charts.
  • Confirm grep -n cutoff dashboard.py returns no matches.

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant