Sorry, I’m reposting this, because I was trying to set a bookmark on my original bug report, but I accidentally clicked on the trash can icon. I’m unable to restore the other topic, so I’m pasting the content here.
I think this is a bug(s).
Summary:
Unwanted color palettes spontaneously re-active when the forum is rebuilt.
I can’t seem to get the default color palettes working for existing users. There should just be “Light Mode” and “Dark Mode” and users should have those automatically set.
“Set color palette on all my devices” only appears for some users (see the screenshots for item #8).
Some users can’t see the light/dark mode switcher (item #9 in the list below).
Details:
Until yesterday, the forum had two themes: one light theme and one dark theme.
I combined them into one theme that has two color schemes (“Light Mode” and “Dark Mode”).
I made all the old themes and color schemes unavailable to users, so there are only those two color scheme available to users, and just the one new theme.
I enabled the theme-switching button in the navbar.
Whenever I rebuild the forum, two more color schemes become enabled: Horizon and Horizon Dark. I’m sure that I disabled them, because I’ve tested it multiple times by disabling them and then rebuilding. They always get re-enabled on rebuild. The latest Discourse version I’ve tested it with is 3.5.0.beta9-dev (04dbc622ab). Screenshot below.
Side note: when I go to disable the two Horizon palettes, I uncheck the box, save the setting and then go back to the palettes page. The palette that I uncheck doesn’t show as disabled in the list until I do a hard refresh of the color palettes page. I’m not sure if this is a separate bug.
Once the Horizon palettes self-enable, the users’ settings pages look like in the screenshot below where the “Dark mode” select box is set to “Same as regular” when it should be set to “Dark Mode”, the color palette. The “Regular” select box is correctly set to “Light Mode”, but it also makes the two unwanted Horizon palettes available.
After I disable the two Horizon palettes again, some users can see the light/dark mode button in the navbar and others can’t.
Also, if the light/dark mode toggle is set to “light” and I change the color palette to “dark” in the user settings (/my/preferences/interface), it will flip back to light when the page reloads. There’s no indication that after switching color palette in settings that the page needs to be saved. When I do save it and reload, the light/dark mode switcher in the navbar disappears.
If you have trouble reproducing it, I can send you a link to the forum (privately) and/or screenshare.
Screenshots
Item #5
Here are the two Horizon palettes that re-enable themselves every time the forum is rebuilt:
This is after the two Horizon palettes spontaneously enable themselves. I wrote the captions before I realized that the Horizon color palettes were spontaneously re-enabling themselves.
I’m able to reproduce the issue of the Horizon and Horizon Dark palettes automatically being re-enabled after a site rebuild, so I have logged a bug for that. We’ll have that fixed up ASAP.
Aside from the knock-on effects from that bug, the other things you noted all seem to be related to the default dark mode color scheme id setting. The good news is that we have an update in the works that migrates that setting into your theme - this makes it much more usable, easy to find, and less prone to inconsistencies like this. We plan on merging that update within the next 24 hours, and will have an announcement and docs to provide more details. I’ll circle back here once it’s live, and then you can test it out to see if it remedies these issues for you.
Thanks, I just tested it with 3.5.0.beta9-dev (33dfd7dba9).
The two Horizon themes still auto-enable when the forum is rebuilt. (To be sure, I rebuilt the forum an extra time after disabling them.)
The color switcher disappears sometimes if the color palette is changed in my user interface settings. I’m not sure if that is intended.
The small but in item #6 from my list still appears to be there. I tested it in Firefox and Chrome. It’s happening when enabling or disabling any color palette.
I’ll send you a link to a private video clip that demonstrates it.
we are seeing similar issues with custom themes and colour palettes. We also use two themes (one light and one dark, but we are looking to consolidate these in future)
If the light theme is selected, the light theme will only show if “theme default color palette is selected in the dark mode dropdown and the mode dropdown is set to “Light”. If “Auto” or dark modes are selected by the user, the theme color palette changes to dark mode.
I’m not sure if this is a bug, but I changed the names of the color palettes in the "color_schemes" field in the about.json file. That caused the settings for “Color Palette” and “Dark Color Palette” to change to integers (maybe the IDs of missing color palettes?).
I took this screenshot after selecting the new color palette names, but it was on this screen:
After making both palettes selectable, it seems like if the user sets their Color Palette to the default palette, the light/dark mode selector will be shown. If they change the color palette to the dark mode palette, the light/dark mode selector disappears.
The “Default dark mode color scheme ID” setting now appears to be missing in my site settings. I’m not sure if it was removed from Discourse. It was here in an older screenshot from above: