Skip to content

FIX: Don't force user-selectable on Horizon's default color palettes #34062

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

OsamaSayegh
Copy link
Member

We currently have logic that ensures Horizon's default palettes are marked as user-selectable each time the server boots up (i.e. on deploy), even if an admin has previously chosen to remove the user-selectable status on those palettes. We should respect the admin's choice, so this PR amends that logic so it only marks the palettes user-selectable when Horizon is first installed.

Internal topic: t/160291.

@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/bug-s-with-color-palettes-and-light-dark-mode-switcher/377013/8

@@ -113,6 +113,7 @@ def self.update_theme(
)
existing = false
end
theme.has_just_been_created = !existing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your solution works, but it is a bit complex. Update of theme is setting has_just_been_created which is later used by SystemThemesManager.

What would you say if instead, we would hook directly here:

https://github.com/discourse/discourse/blob/main/db/fixtures/600_themes.rb#L5

I am thinking about something like SystemThemesManager.sync!(has_just_been_created: !theme_exists)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants