discourse/app/services
Martin Brennan 19af83d39e
FEATURE: Themeable site settings (#32233)
This commit introduces the concept of themeable site settings,
which is a new tool for theme authors that lives alongside theme
modifiers and theme settings. Here is a quick summary:

* Theme settings - These are custom settings used to control UI and functionality within your theme or component and provide configuration options. These cannot change core Discourse functionality.
* Theme modifiers - Allows a theme or a component to modify selected server-side functionality of core Discourse as an alternative to building a plugin.
* Themeable site settings (new) - Allows a theme (not components) to override a small subset of core site settings, which generally control parts of the UI and other minor functionality. This allows themes to have a greater control over the full site experience.

Themeable site settings will be shown for all themes, whether the theme
changes
the value or not, and have a similar UI to custom theme settings.

We are also introducing a new page at
`/admin/config/theme-site-settings` that
allows admins to see all possible themeable site settings, and which
themes
are changing the value from the default.

### Configuration

Theme authors can configure initial values themeable site settings using
a section in the `about.json` file like so:

```json
"theme_site_settings": {
  "search_experience": "search_field"
}
```

These values will not change when the theme updates, because we cannot
know if admins have manually changed them.

### Limitations

Themeable site settings are only really intended to control elements of
the UI, and when retrieving their value we require a theme ID, so these
limitations apply:

- Themeable site settings cannot be used in Sidekiq jobs
- Themeable site settings cannot be used in markdown rules
- Themeable site settings will be cached separately to client site
settings using theme ID as a key
- Themeable site settings will override keys on the `siteSettings`
service on the client using the application preloader
- `SiteSetting.client_settings_json` will not include themeable site
settings, instead you can call `SiteSetting.theme_site_settings_json`
with a theme ID

### Initial settings

There are only two site settings that will be themeable to begin with:

* `enable_welcome_banner`
* `search_experience`

And our new Horizon theme will take advantage of both. Over time, more
settings that control elements of the UI will be exposed this way.
2025-07-16 11:00:21 +10:00
..
admin_notices DEV: Apply new Rubocop linting on services 2024-12-02 17:31:36 +01:00
discourse_id DEV: Add Discourse ID authenticator (#33186) 2025-06-17 09:47:00 -04:00
experiments DEV: Apply new Rubocop linting on services 2024-12-02 17:31:36 +01:00
flags FEATURE: allow edit custom flags (#32344) 2025-04-17 12:31:52 +08:00
notifications FEATURE: Consolidate link notifications (#26567) 2024-04-09 11:53:37 -06:00
problem_check DEV: Remove full_page_login setting (#32189) 2025-04-29 10:40:40 +02:00
site_setting DEV: Move backfill into SiteSetting::Update service (#32037) 2025-03-28 12:01:56 +08:00
spam_rule DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
themes FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
user DEV: Add missing specs to User::BulkDestroy 2025-04-08 11:42:51 +02:00
anonymous_shadow_creator.rb UX: Improve naming for anonymous mode settings (#31832) 2025-03-21 04:54:06 +03:00
badge_granter.rb FIX: error when trying to un-favorite badge (#32369) 2025-04-22 15:36:48 +08:00
base_bookmarkable.rb FIX: Show deleted bookmark reminders in user bookmarks menu (#25905) 2024-02-29 09:03:49 +10:00
category_hashtag_data_source.rb FEATURE: add icons and emojis to category (#31795) 2025-03-26 09:46:17 +04:00
color_scheme_revisor.rb FEATURE: Theme-owned color palettes (#32795) 2025-06-04 07:47:58 +03:00
destroy_task.rb DEV: Don't allow context-free system post destruction (#32523) 2025-05-05 09:58:29 +08:00
email_settings_exception_handler.rb FIX: Show the SMTP authentication error for group UI (#27914) 2024-07-16 09:14:17 +10:00
email_settings_validator.rb UX: Use a dropdown for SSL mode for group SMTP (#27932) 2024-07-18 10:33:14 +10:00
email_style_updater.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
external_upload_manager.rb DEV: lint against Layout/EmptyLineBetweenDefs (#24914) 2023-12-15 23:46:04 +08:00
group_action_logger.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
group_mentions_updater.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
group_message.rb DEV: Don't allow context-free system post destruction (#32523) 2025-05-05 09:58:29 +08:00
handle_chunk_upload.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
hashtag_autocomplete_service.rb FEATURE: add icons and emojis to category (#31795) 2025-03-26 09:46:17 +04:00
heat_settings_updater.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
inline_uploads.rb FIX: Use filename as alt for hotlinked image uploads (#31651) 2025-03-11 14:45:06 +11:00
notification_emailer.rb DEV: Bump rubocop_discourse (#29608) 2024-11-06 06:27:49 +08:00
post_action_notifier.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
post_alerter.rb FIX: Adds further support for 'prioritize_full_name_in_ux' setting (#31346) 2025-02-17 12:09:18 -06:00
post_bookmarkable.rb FIX: Serialize categories for bookmarks (#26606) 2024-04-17 17:23:47 +03:00
post_owner_changer.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
push_notification_pusher.rb FIX: avoid double base path on push notification (#32228) 2025-04-12 08:16:53 +10:00
random_topic_selector.rb DEV: Remove Discourse.redis.delete_prefixed (#22103) 2023-06-16 12:44:35 +10:00
registered_bookmarkable.rb FIX: Show deleted bookmark reminders in user bookmarks menu (#25905) 2024-02-29 09:03:49 +10:00
search_indexer.rb DEV: Update nokogiri to 1.18.1 (#30554) 2025-01-07 12:05:39 +01:00
sidebar_section_links_updater.rb DEV: Limit the number of category sidebar links a user can have (#26756) 2024-04-25 13:21:39 -05:00
sidebar_site_settings_backfiller.rb DEV: Drop distributed mutex fromSidebarSiteSettingsBackfiller#backfill! (#25674) 2024-02-15 06:21:03 +08:00
site_setting_update_existing_users.rb UX: Split hide_profile_and_presence user option (#29632) 2024-11-12 22:22:58 -03:00
site_settings_task.rb FEATURE: mandatory fields for group site setting (#26612) 2024-04-18 08:53:52 +10:00
staff_action_logger.rb FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
tag_hashtag_data_source.rb DEV: add tag hashtag data source style type (#33289) 2025-06-20 18:08:47 +04:00
theme_settings_migrations_runner.rb DEV: Switch to pnpm for JS dependencies (#28671) 2024-09-03 10:51:07 +01:00
themes_install_task.rb FEATURE: Theme settings migrations (#24071) 2023-11-02 08:10:15 +03:00
topic_bookmarkable.rb FIX: Serialize categories for bookmarks (#26606) 2024-04-17 17:23:47 +03:00
topic_status_updater.rb FIX: Message for bulk closing topics silently (#27400) 2024-06-11 09:36:54 +10:00
topic_timestamp_changer.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
tracked_topics_updater.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
trust_level_granter.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
user_action_manager.rb FIX: permanent delete of posts by deleted users (#28992) 2024-09-24 12:26:31 +03:00
user_activator.rb FIX: do not enforce 2fa when an account is created with OAuth (#28625) 2024-08-29 11:19:04 +10:00
user_anonymizer.rb FEATURE: Add option to hide full name input at signup (#30471) 2024-12-30 22:26:20 +03:00
user_authenticator.rb Don't require password to create users with previous authentication (#32201) 2025-04-15 10:35:49 -05:00
user_destroyer.rb DEV: Don't allow context-free system post destruction (#32523) 2025-05-05 09:58:29 +08:00
user_merger.rb FEATURE: Merge user associated accounts, favouring the target user upon conflict (#26645) 2024-04-16 17:37:33 +08:00
user_notification_renderer.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
user_notification_schedule_processor.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
user_password_expirer.rb DEV: Migrate user passwords data to UserPassword table (#28746) 2024-10-10 09:23:06 +08:00
user_silencer.rb DEV: Enable unless cops 2023-02-21 10:30:48 +01:00
user_stat_count_updater.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
user_suspender.rb SECURITY: Don't allow suspending staff users via other_user_ids param 2024-07-03 20:49:29 +08:00
user_updater.rb UX: Split hide_profile_and_presence user option (#29632) 2024-11-12 22:22:58 -03:00
username_changer.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
username_checker_service.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
web_hook_emitter.rb DEV: Move webhook event header modifier for redelivery-recalucation (#27177) 2024-05-24 10:37:10 -05:00
wildcard_domain_checker.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
wildcard_url_checker.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
word_watcher.rb FIX: Ensure queued posts with watched words are processed correctly. (#31641) 2025-03-05 13:59:42 +11:00