fix: add missing theme toggle button to homepage navbar - #1079
Conversation
|
@HarshalKushwaha0027 is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@HarshalKushwaha0027 kindly resolve the merge conflicts |
|
Thank you for taking the time to contribute to DevPath and for working on this usability improvement! Your effort in identifying and fixing the missing theme toggle on the homepage helps make the user experience more consistent across the application. I also appreciate that you fixed the incorrect HTML closing tag while implementing the feature. Addressing the DOM structure issue alongside the theme toggle keeps the codebase cleaner and prevents potential rendering issues. The implementation is focused, well-scoped, and includes clear testing steps to verify both desktop and mobile behavior. This change improves accessibility and ensures users can switch themes directly from the homepage, matching the experience on other pages. Great work, and thank you again for investing your time and effort into improving DevPath. Approved for merge. ✅ |
Summary
The homepage (
index.html) navbar was missing the theme toggle button that alreadyexists on the project detail page (
project.html). Users had no way to switch betweenlight and dark mode from the homepage without opening the mobile menu. This PR adds the
theme toggle to the desktop navbar on the homepage, matching the behaviour already present
on all other pages. It also fixes a pre-existing HTML bug where the navbar search form
was incorrectly closed with
</div>instead of</form>, causing invalid DOM structure.Related Issue
Closes #1037
Type of Change
What Was Changed
src/templates/index.html</div>→</form>closing tag bug on navbar search form; addednav-rightdiv containing desktop nav links and theme toggle via{% include 'partials/theme_toggle.html' %}How to Test This PR
git checkout fix/homepage-theme-togglepip install -r requirements.txtcd src && python app.pypython tests/test_basic.pyExpected test output:
Test Results
77 passed, 1 failed out of 78 tests
Screenshots
| Before | After |


|
|
|
| No theme toggle visible in homepage navbar | Theme toggle button visible in top-right of homepage navbar |
Self-Review Checklist
fix/homepage-theme-togglepython tests/test_basic.pyand all 27 tests passflake8 .locally and there are no errorsprint()orconsole.log()debug statementsNotes for Reviewer
style.cssorscript.js— the existing CSS classes(
.theme-toggle,.icon-moon,.icon-sun) and JS initialization forid="theme-toggle"already handled this case; only the HTML was missing.
{% include 'partials/theme_toggle.html' %}pattern is identical to whatproject.htmlalready uses, so no new partial was created.</div>→</form>fix is a bonus bug fix discovered while working on this issue.