User-defined theme switcher disappears on admin pages

The user-defined option selector disappears from the hamburger menu if you switch while you are in Admin pages - and stays missing if you navigate back to the main site - until you hard refresh.

BEFORE

AFTER

repro steps:

  • Navigate to dashboard, then click the hamburger menu so can see the theme options.
  • Select a different theme
  • When this loads, the options to switch again are missing on the menu

This does not happen outside of admin area

3 Likes

Isn’t this in fact expected since admin areas are intentionally not themed, e.g. we don’t allow admin to be broken by theming as it becomes impossible to fix it because you need the admin UI to work in order to change anything about theming in the first place?

Also, isn’t the trivial workaround to… simply avoid switching themes in the admin area?

Possibly, but if that is the case, then the option to switch themes should disappear when you navigate to admin, but it doesn’t so I am able to switch themes here. It is only after doing it that it disappears, so it looked to be an omission rather than a safety issue.

yes, and this may be an edge case. I was testing a possible issue with column headers not appearing (or rather being white on white) so wanting to see if the reported issue was theme-related - i.e. some OTHER setting was breaking the admin interface when it should not. So there will be some possible occasions where you might want or need to, but one could keep switching out of admin to do this, but since the option appears here, others may experience the same

This is also a component, not a part of core Discourse at all. To be honest, I’m not even a fan of this optional add-on feature here. It clutters the menu.

This is totally unrelated to this specific component, happens on any component that amends the hamburger menu, eg:

Must be leftover from “auto disable customization in admin on reload”, that we created prior to safe mode

5 Likes

Good catch @robmc , we had some archeological code that is no longer needed and no longer makes sense:

https://github.com/discourse/discourse/commit/4c8fe13500c5b79bb93366fdfb4003e82f585220

This is now fixed.

9 Likes