Skip to content

fix: theme switch without reload#5132

Merged
walterbender merged 7 commits intosugarlabs:masterfrom
7se7en72025:fix/theme-switch-no-reload-4520
Jan 17, 2026
Merged

fix: theme switch without reload#5132
walterbender merged 7 commits intosugarlabs:masterfrom
7se7en72025:fix/theme-switch-no-reload-4520

Conversation

@7se7en72025
Copy link
Contributor

@7se7en72025 7se7en72025 commented Jan 11, 2026

theme now switches instantly without refreshing the whole page

added applyThemeInstantly() to update colors in real-time quick.
updates body classes, canvas bg, platformColor, meta tags
refreshes palettes and floating windows on the fly
updated tests....

sugarlabs_finalthemechangefix.mp4

fixes #4520

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@7se7en72025 7se7en72025 force-pushed the fix/theme-switch-no-reload-4520 branch from 2756eb5 to 6179b63 Compare January 11, 2026 01:55
@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

1 similar comment
@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@7se7en72025 7se7en72025 force-pushed the fix/theme-switch-no-reload-4520 branch from 5b3a14e to 17f7a16 Compare January 11, 2026 02:12
@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@7se7en72025
Copy link
Contributor Author

7se7en72025 commented Jan 11, 2026

@omsuneri i did run prettier, it showed the same after 3 tries :)

@Commanderk3
Copy link
Member

Commanderk3 commented Jan 11, 2026

@7se7en72025 Does it change the color of the background canvas as well?
The video you have shown, is it before or after?

@7se7en72025
Copy link
Contributor Author

Sorry i forgot it, will commit soon.
Thanx

@github-actions
Copy link
Contributor

❌ Some Jest tests failed. Please check the logs and fix the issues before merging.

Failed Tests:

themebox.test.js

@7se7en72025
Copy link
Contributor Author

@Commanderk3 done pls check the changes, updated video in desc
thanx

@Ashish-Rautela
Copy link
Contributor

@7se7en72025 To resolve this ESLint issue, I suggest installing the latest version of Prettier (CI always uses the latest version) and then run Prettier on the affected files.

@7se7en72025
Copy link
Contributor Author

7se7en72025 commented Jan 12, 2026

Ahh Thanx ,will try and commit soon

@github-actions
Copy link
Contributor

❌ Some Jest tests failed. Please check the logs and fix the issues before merging.

Failed Tests:

themebox.test.js

@github-actions
Copy link
Contributor

❌ Some Jest tests failed. Please check the logs and fix the issues before merging.

Failed Tests:

themebox.test.js

Refactor jest.spyOn for getItem to improve readability.
@github-actions
Copy link
Contributor

❌ Some Jest tests failed. Please check the logs and fix the issues before merging.

Failed Tests:

themebox.test.js

@7se7en72025
Copy link
Contributor Author

same happened with me in #4832
can someone pls help
@omsuneri @walterbender @pikurasa @Commanderk3

@github-actions
Copy link
Contributor

❌ Some Jest tests failed. Please check the logs and fix the issues before merging.

Failed Tests:

themebox.test.js

@github-actions
Copy link
Contributor

❌ Some Jest tests failed. Please check the logs and fix the issues before merging.

Failed Tests:

themebox.test.js

@walterbender walterbender merged commit 5a02a80 into sugarlabs:master Jan 17, 2026
4 of 5 checks passed
@walterbender
Copy link
Member

oops. I thought I fixed it. Aargh.

021nirav-blip pushed a commit to 021nirav-blip/musicblocks that referenced this pull request Jan 28, 2026
* fix: instant theme switching without page reload

* Fix canvas background not updating on theme switch

* Refactor theme application to use arrow functions

* Refactor themebox test for consistency and clarity

* Refactor getItem mock implementation in tests

Refactor jest.spyOn for getItem to improve readability.

* Refactor themebox test for improved readability

* prettier

---------

Co-authored-by: Walter Bender <walter@sorceo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Switching between light and dark mode causes a full-page reload instead of applying the theme instantly

4 participants