You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes the theme toggle functionality on the 403 and 405 error pages. Although the theme toggle UI was already present on these pages, it was non-functional because the required JavaScript file (static/script.js) was not being loaded. While implementing the fix, I also identified and corrected a JavaScript syntax error in static/script.js that prevented the script from parsing correctly. As a result, theme initialization and theme switching now work consistently across all error pages (403, 404, 405, and 500).
Verify that the theme switches between light and dark modes.
Open browser developer tools and confirm there are no JavaScript syntax errors in the console.
Expected test output:
- Theme toggle works correctly on both 403 and 405 pages.
- Theme preference is applied consistently.
- No JavaScript syntax errors appear in the browser console.
Test Results [required]
node --check static/script.js
Output:
(no output)
This confirms the JavaScript file parses successfully without syntax errors.
My branch name follows the convention: feat/, fix/, docs/, data/, style/, test/
I have run python tests/test_basic.py and all 27 tests pass
I have run flake8 . locally and there are no errors
I have not introduced any print() or console.log() debug statements
Every new function I wrote has a docstring
I have not modified files outside the scope of the linked issue
If I changed the UI, I tested it at 375px (mobile) and 1280px (desktop)
If I added a project to the dataset, it has all required JSON fields
Notes for Reviewer
While investigating why the theme toggle was not functioning on the 403 and 405 pages, I discovered a JavaScript syntax error in static/script.js caused by a missing closing brace. Fixing this issue was necessary to ensure the script could execute correctly and enable theme functionality on the affected pages.
Hi @komalharshita
While testing this issue, I discovered a pre-existing JavaScript syntax error in static/script.js caused by a missing closing brace in createTag(). Because the browser could not parse the script successfully, JavaScript execution was interrupted, affecting functionality that depends on script.js, including theme-related behavior. Since script.js is loaded across multiple pages, the parsing failure could prevent other JavaScript-driven functionality from executing correctly. I fixed this syntax error as part of the PR since it was necessary to ensure the theme toggle could function correctly on the 403 and 405 pages.
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
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 [required]
This PR fixes the theme toggle functionality on the 403 and 405 error pages. Although the theme toggle UI was already present on these pages, it was non-functional because the required JavaScript file (static/script.js) was not being loaded. While implementing the fix, I also identified and corrected a JavaScript syntax error in static/script.js that prevented the script from parsing correctly. As a result, theme initialization and theme switching now work consistently across all error pages (403, 404, 405, and 500).
Related Issue [required]
Closes #819
Type of Change [required]
data/projects.jsonWhat Was Changed [required]
templates/403.htmlstatic/script.jsso theme initialization and toggle functionality are available on the 403 pagetemplates/405.htmlstatic/script.jsso theme initialization and toggle functionality are available on the 405 pagestatic/script.jscreateTag()which caused a JavaScript syntax error and prevented the script from executing correctlyHow to Test This PR [required]
git checkout fix-theme-toggle-functionalitypip install -r requirements.txtpython app.pyExpected test output:
Test Results [required]
node --check static/script.js
Output:
(no output)
This confirms the JavaScript file parses successfully without syntax errors.
Screenshots (if UI change)
|


|
|
Self-Review Checklist [required]
feat/,fix/,docs/,data/,style/,test/python tests/test_basic.pyand all 27 tests passflake8 .locally and there are no errorsprint()orconsole.log()debug statementsNotes for Reviewer
While investigating why the theme toggle was not functioning on the 403 and 405 pages, I discovered a JavaScript syntax error in static/script.js caused by a missing closing brace. Fixing this issue was necessary to ensure the script could execute correctly and enable theme functionality on the affected pages.