Bug: Broken Theme Toggle, Duplicate Navbar Icons, and SyntaxError in script.js
What happened?
Bug Description: There are multiple interconnected bugs affecting the client-side logic and layout of the application, most noticeably breaking the dark mode/light mode functionality. Broken Theme Toggle: On PC devices, there are two distinct theme toggles visible in the navbar. One works, while the other does nothing. Mobile View Bug: The non-working duplicate toggle leaks into the mobile view, overlapping with the intended mobile toggle and causing the theme changing feature to break on smaller devices. Fatal JavaScript Error: In the browser console, there is a fatal execution error: Uncaught SyntaxError: Unexpected end of input script.js:1194, preventing any dynamic scripts from running reliably. Root Cause: HTML Duplication: In templates/index.html, the {% include 'partials/theme_toggle.html' %} was placed directly next to the explicit inline
Steps to reproduce
https://github.com/user-attachments/assets/95f55f46-09b0-4fa0-9778-7009eb78cbdc
To reproduce the expected behavior and verify the fixes for the theme toggle and navigation issues, follow these steps. Steps to Reproduce Expected Behavior Environment Setup: Ensure you are using a modern Python environment (Python 3.8+ is recommended). Run the project using the instructions provided previously: Bash
From the project root
python -m venv venv
Activate environment
Mac/Linux: source venv/bin/activate | Windows: venv\Scripts\activate
pip install -r requirements.txt python app.py Verify Navbar Structure: Open http://127.0.0.1:5000 in your browser. Desktop: Ensure only one theme toggle button is visible in the top navigation bar. Mobile: Resize the window to mobile width (or open dev tools and toggle device mode). Ensure the mobile menu renders correctly and that the duplicate toggle icon has been removed from the navigation flow. Verify Theme Switching: Click the theme toggle button. The UI should switch seamlessly between light and dark mode, and the icon should swap (sun/moon) immediately. Refresh the page. The chosen theme should persist (it is cached in localStorage). Open the Browser Console (F12 -> Console tab). Ensure no errors appear, specifically verifying that the SyntaxError: Unexpected end of input is gone. Verify Logic Integrity: Perform a search on the homepage. Click "View Full Project" to navigate to a detail page. Test the "Copy Code" button in the sliding code panel. Ensure the toast message "Copied!" appears and that the console remains clean of syntax errors.
Expected behaviour
the toggle switch not working . also two toggle switch appearing in navbar .
Area of the app affected
Homepage form
Python version
3.11.4
Operating system
macos
Relevant error output or logs
Before submitting
- [x] I searched existing issues and this has not been reported before.
- [x] I can reproduce this bug consistently with the steps above.
- [x] I am running the latest version of the main branch.
Thank you for opening your first issue in DevPath.
Please make sure to:
- Read CONTRIBUTING.md
- Wait for assignment before starting work
- Follow repository guidelines carefully
Happy contributing.
Sorry @kabirumarkhan-stack since I have detected this bug so this issue will be assigned to me
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!
This issue was closed because it has been inactive for an extended period. If this issue is still relevant, feel free to reopen it or create a new one.