Skip to content

Fix duplicate 'now' declarations breaking dashboard JS#134

Merged
skyelaird merged 1 commit into
mainfrom
claude/dashboard-fix-duplicate-now
May 1, 2026
Merged

Fix duplicate 'now' declarations breaking dashboard JS#134
skyelaird merged 1 commit into
mainfrom
claude/dashboard-fix-duplicate-now

Conversation

@skyelaird

Copy link
Copy Markdown
Owner

Summary

initializeDashboard() declared const now and const currentHour twice in the same scope (lines 1658 and 1672). Modern browsers reject this with a parse-time SyntaxError: Identifier 'now' has already been declared, which silently kills the entire <script> block — no event handlers get attached, no buttons work, and no /api/* calls are ever made even though dashboard.html renders.

The two uses had different semantics (fractional hour for grayLineSlider, integer hour for grayLineTimeSlider), so I renamed the second pair to currentHourInt and tickHour rather than dedupe.

Repro

  1. pip install -e ".[dashboard]" and run dvoacap-dashboard.
  2. Load http://localhost:8000 in any modern browser.
  3. Open DevTools Console — observe the SyntaxError plus a cascade of triggerRefresh is not defined, showSettings is not defined, showTab is not defined ReferenceErrors.
  4. Click any button: nothing happens, server log shows no /api/... request.

Test plan

  • Open dashboard in browser, hard-reload, verify Console is clean.
  • Click "Refresh Predictions" → server log shows POST /api/generate.
  • Click tabs (Band Details, Propagation Charts, etc.) → tab content switches.

https://claude.ai/code/session_01PLeFRjjJUKnUAjA5imhsZz


Generated by Claude Code

initializeDashboard() declared `const now` and `const currentHour` twice
in the same scope (lines 1658 and 1672). Modern browsers reject this
with a parse-time SyntaxError ("Identifier 'now' has already been
declared"), which silently kills the entire <script> block — no
event handlers get attached, no buttons work, and no /api/* calls
are ever made even though the dashboard renders.

Rename the second pair to `currentHourInt` (and `tickHour` inside the
setInterval callback) so the two distinct uses don't collide.
@skyelaird skyelaird marked this pull request as ready for review May 1, 2026 17:37
@skyelaird skyelaird merged commit db7eb43 into main May 1, 2026
14 checks passed
@skyelaird skyelaird deleted the claude/dashboard-fix-duplicate-now branch May 1, 2026 17:38
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.

2 participants