Fix duplicate 'now' declaration in served.html so dashboard buttons work#135
Merged
Merged
Conversation
The captured served.html snapshot still had the SyntaxError that was fixed in dashboard.html via f1c1faf: const now / const currentHour were declared twice inside initializeDashboard() (and again inside its setInterval callback). The parse error short-circuited the entire script, leaving onclick handlers calling undefined triggerRefresh and showSettings, which made the dashboard unresponsive. Mirrors the dashboard.html fix: rename the duplicate gray-line-time slider locals to currentHourInt and tickHour so each scope has a single declaration. served.html now matches dashboard.html byte-for-byte. https://claude.ai/code/session_01BLfWHK9hf8k4aBBaQjfQa8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The user reported the dashboard "not responsive" — the Refresh and Settings buttons did nothing — and shared a browser console with three errors:
All three are caused by a single bug. Inside
initializeDashboard()inserved.html,const now = new Date()was declared on line 1658 and then re-declared on line 1672 in the same block scope. The same pattern repeated inside the function'ssetIntervalcallback. The resultingSyntaxErroraborts parsing of the entire<script>block, so the top-leveltriggerRefresh(defined at line 2864) andshowSettings(line 3447) never become callable, and the inlineonclickhandlers on lines 693 and 698 fail withReferenceError.This is the same bug that was fixed in
src/dvoacap/dashboard/dashboard.htmlin commitf1c1faf(PR #134), but the capturedserved.htmlsnapshot at the repo root never received the fix. This PR mirrors that fix — renaming the duplicate locals tocurrentHourIntandtickHour— soserved.htmlmatchesdashboard.htmlbyte-for-byte.Test plan
diff src/dvoacap/dashboard/dashboard.html served.htmlis emptyserved.htmlparses withnode --check(previously failed at line 1672)triggerRefreshandshowSettingsare top-level function declarations, so they reachwindowonce the script parsesf1c1faf, runpip install -e ".[dashboard]" --force-reinstalland hard-refresh)https://claude.ai/code/session_01BLfWHK9hf8k4aBBaQjfQa8
Generated by Claude Code