-
Notifications
You must be signed in to change notification settings - Fork 319
[BUG] Theme Toggle Doesn't Persist on Page Refresh #1506
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomersgssoc26GSSoC 2026 contributionGSSoC 2026 contributiongssoc:assignedGSSoC: Issue assigned to a contributorGSSoC: Issue assigned to a contributorlevel:beginnerGSSoC: Beginner difficulty (20 pts)GSSoC: Beginner difficulty (20 pts)needs-triageNeeds maintainer triageNeeds maintainer triagetype:bugGSSoC type bonus: bug fixGSSoC type bonus: bug fix
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomersgssoc26GSSoC 2026 contributionGSSoC 2026 contributiongssoc:assignedGSSoC: Issue assigned to a contributorGSSoC: Issue assigned to a contributorlevel:beginnerGSSoC: Beginner difficulty (20 pts)GSSoC: Beginner difficulty (20 pts)needs-triageNeeds maintainer triageNeeds maintainer triagetype:bugGSSoC type bonus: bug fixGSSoC type bonus: bug fix
Summary
When a user switches between Light and Dark mode using the
ThemeTogglecomponent, the selected theme is lost on page refresh. The app always defaults back to the system default instead of remembering the user's choice.Description
The
ThemeToggle.tsxcomponent reads fromThemeContextand toggles the theme, but it does not persist the user's preference tolocalStorage. On every page refresh, the component re-initializes without checking for a saved preference. The theme selection should survive browser refreshes.Steps to Reproduce
http://localhost:3000/dashboardExpected Behavior
After toggling the theme, the user's choice should be saved in
localStorage. On page reload,ThemeContextshould read this saved value and apply the correct theme without any flash or reset.Actual Behavior
The theme resets to the default theme on every page reload. The user's manually selected theme is not remembered.
Environment
System Information (Optional)
src/components/ThemeToggle.tsx,src/components/ThemeContext.tsxHello I am a GSSOC'26 COntributor and would love to work on this issue. Please assign it to me under gssoc'26
/assign gssoc