Skip to content

fix: Faster theme loading to avoid flickering #3062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2025

Conversation

arkirchner
Copy link
Contributor

@arkirchner arkirchner commented Aug 6, 2025

The tubo:load event is faster than the migration event. The color changing requires no sprocket code and can be controlled without the migration event. This removes the flickering in dark mode when navigating the page.

This change is possible because the theme-changing logic was moved to Webpacker and loads before Sprockets. Please see #3025

Related to #3040

@arkirchner arkirchner self-assigned this Aug 6, 2025
@arkirchner arkirchner added the javascript Pull requests that update Javascript code label Aug 6, 2025
The `tubo:load` event is faster than the migration event. The color changing requires no sprocket code and can be controlled without the migration event. This removes the flickering in dark mode when navigating the page.

This change is possible because the theme-changing logic was moved to Webpacker and loads before Sprockets. Please see #3025

Related to #3040
@arkirchner arkirchner force-pushed the ak/faster_theme_changes branch from 819c51c to dc99577 Compare August 6, 2025 08:55
@arkirchner arkirchner added the bug label Aug 6, 2025
Copy link

codecov bot commented Aug 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.24%. Comparing base (9c22788) to head (dc99577).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3062      +/-   ##
==========================================
+ Coverage   70.08%   70.24%   +0.16%     
==========================================
  Files         215      215              
  Lines        6850     6850              
==========================================
+ Hits         4801     4812      +11     
+ Misses       2049     2038      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@arkirchner arkirchner merged commit caccb8a into main Aug 7, 2025
15 checks passed
@arkirchner arkirchner deleted the ak/faster_theme_changes branch August 7, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants