Skip to content

Conversation

@Akshaychdev
Copy link

Fix dark mode toggle visibility and system theme handling (Redmine 6.1.0)

Summary

This PR fixes two issues affecting the Dark Mode plugin in Redmine 6.1.0:

  • Restores visibility of the dark mode toggle in the account menu
  • Prevents automatic dark mode from overriding explicit user preference

Details

  • The dark mode toggle is now inserted as a proper <li> within the account menu, ensuring it is visible and styled correctly in Redmine 6.1.0.
  • Automatic dark mode based on prefers-color-scheme is now optional and controlled via a plugin setting.
  • By default, dark mode activates only through the manual toggle. When enabled by an admin, browser/OS theme preference is respected.
image image

Configuration

A new plugin setting has been added:

Administration → Plugins → Dark Mode → Configure
Follow browser/OS dark theme preference (default: disabled)

image

Changes

  • assets/javascripts/dark.js – Fix toggle insertion into account menu
  • assets/stylesheets/dark.css – Apply system theme conditionally
  • lib/dark_application_hooks.rb – Add body class based on setting
  • init.rb – Register plugin settings
  • app/views/settings/_redmine_dark_settings.html.erb – Settings UI
  • config/settings.yml – Settings configuration

Testing

  • Verified locally using Redmine 6.1.0 Docker setup
  • Toggle is visible and functional
  • Manual toggle persists via cookie
  • Automatic dark mode applies only when explicitly enabled
  • Manual toggle always overrides system preference

Notes

I am not a Ruby specialist; the Ruby changes were implemented with AI assistance and validated through local testing. Feedback and improvements are welcome.

Compatibility

  • ✅ Redmine 6.1.0
  • ✅ Backward compatible with earlier versions

…ting for Redmine 6.1.0

- Insert dark mode toggle as a proper <li> inside the account menu to ensure visibility in Redmine 6.1.0
- Apply system/browser dark theme only when explicitly enabled via plugin settings
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.

1 participant