Bug(s) met kleurenpaletten en licht/donker modus schakelaar

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:

  1. Until yesterday, the forum had two themes: one light theme and one dark theme.
  2. I combined them into one theme that has two color schemes (“Light Mode” and “Dark Mode”).
  3. 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.
  4. I enabled the theme-switching button in the navbar.
  5. 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.
  6. 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.
  7. 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.
  8. After I disable the two Horizon palettes again, some users can see the light/dark mode button in the navbar and others can’t.
  9. 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:

Item #7

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.

Item #8

These are screenshots sent to me by users after the Horizon palettes are removed.

This user can see the light/dark mode switching button in the top navbar:

This user can’t see the light/dark mode switcher in the top navbar, and a checkbox is missing:

Additional settings for reference:

Bedankt voor het vastleggen van dit alles, @j127.

Ik kan het probleem reproduceren dat de Horizon- en Horizon Dark-paletten automatisch opnieuw worden ingeschakeld na een site-rebuild, dus ik heb daarvoor een bug geregistreerd. We zullen dat zo snel mogelijk oplossen.

Afgezien van de neveneffecten van die bug, lijken de andere dingen die je hebt opgemerkt allemaal verband te houden met de instelling default dark mode color scheme id. Het goede nieuws is dat we een update in de maak hebben die die instelling naar je thema migreert - dit maakt het veel bruikbaarder, makkelijker te vinden en minder gevoelig voor inconsistenties zoals deze. We zijn van plan die update binnen de komende 24 uur samen te voegen, en zullen een aankondiging en documentatie hebben om meer details te geven. Ik kom hier terug zodra het live is, en dan kun je het testen om te zien of het deze problemen voor je oplost.

3 likes

Klinkt goed, bedankt.

1 like

This is now live and announced here: Improved dark and light mode handling 🎨

Update when you get a moment and let me know how it goes :slight_smile:

1 like

Bedankt, ik heb het zojuist getest met 3.5.0.beta9-dev (33dfd7dba9).

  • De twee Horizon-thema’s worden nog steeds automatisch ingeschakeld wanneer het forum opnieuw wordt opgebouwd. (Om zeker te zijn, heb ik het forum nog een keer opnieuw opgebouwd nadat ik ze had uitgeschakeld.)
  • De kleurenschakelaar verdwijnt soms als het kleurenpalet in mijn gebruikersinterface-instellingen wordt gewijzigd. Ik weet niet zeker of dat de bedoeling is.
  • De kleine knop in item #6 van mijn lijst lijkt er nog steeds te zijn. Ik heb het getest in Firefox en Chrome. Het gebeurt bij het in- of uitschakelen van een kleurenpalet.

Ik stuur je een link naar een privé-videoclip die dit demonstreert.

The pull request to change that has not been merged yet.

2 likes

Hallo allemaal,

we zien vergelijkbare problemen met aangepaste thema’s en kleurenpaletten. We gebruiken ook twee thema’s (een lichte en een donkere, maar we willen deze in de toekomst consolideren)

Als het lichte thema is geselecteerd, wordt het lichte thema alleen weergegeven als “thema standaard kleurenpalet is geselecteerd in de donkere modus dropdown en de modus dropdown is ingesteld op ‘Licht’”. Als de gebruiker “Automatisch” of donkere modi selecteert, verandert het kleurenpalet van het thema naar de donkere modus.

Some updates:

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:

That also caused the light/dark mode selector to disappear for some users after logging in.

The new color palettes weren’t marked as selectable by users, so users just see this for Color Palette choices in their preferences:

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.

There’s also some confusing behavior here:

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:

1 like

We made some recent updates to how Discourse handles dark and light palettes:

Many of these updates address the issues mentioned here, and we have some other updates in the works that will streamline this process further.

For example, this open PR streamlines and improves the user interface preferences: FEATURE: remove dark mode checkbox by lis2 · Pull Request #34165 · discourse/discourse · GitHub

2 likes

Thanks! This all looks really good now. There’s even a preview for users.

1 like

With all of these colour palette updates, that preview is one of my favourite parts :smile:

1 like