discourse/app/assets/javascripts/admin/addon/models
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-dashboard.js FEATURE: Always show full page "New Features" to admins (#28383) 2024-08-16 09:12:24 +10:00
admin-plugin.js DEV: Use default admin routes for plugins with settings (#30941) 2025-02-04 14:57:28 +08:00
admin-user.js DEV: revert admin users list change (#32723) 2025-05-15 09:48:01 +02:00
api-key.js DEV: Require at least one scope for API key granular mode (#31253) 2025-02-10 13:22:08 +08:00
backup-status.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
backup.js DEV: Update admin models to native class syntax (#20704) 2023-03-17 10:18:42 +00:00
color-scheme-color.js FEATURE: Theme-owned color palettes (#32795) 2025-06-04 07:47:58 +03:00
color-scheme.js FEAT: Add clipboard button to new palette UI (#33430) 2025-07-03 08:09:49 +03:00
email-log.js DEV: Extract e-mail logs into their own admin page (#32211) 2025-04-08 17:50:12 +08:00
email-preview.js DEV: Update admin models to native class syntax (#20704) 2023-03-17 10:18:42 +00:00
email-settings.js DEV: Add e-mail site settings to e-mail admin page (#32214) 2025-04-08 18:59:50 +08:00
email-style.js DEV: Update admin models to native class syntax (#20704) 2023-03-17 10:18:42 +00:00
email-template.js UX: Use DPageHeader on the Emails page (#30781) 2025-01-15 15:36:16 +11:00
flag-type.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
form-template.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
incoming-email.js DEV: Extract e-mail logs into their own admin page (#32211) 2025-04-08 17:50:12 +08:00
permalink.js FIX: Make permalink search work even when there're 100+ permalinks (#31354) 2025-02-16 00:19:16 +03:00
report.js UX: Show full total numbers in admin reports (#31061) 2025-01-31 09:55:05 +10:00
screened-email.js DEV: Update lint-configs and autofix issues (#31620) 2025-03-05 01:20:16 +01:00
screened-ip-address.js DEV: Update lint-configs and rubocop-discourse (#31728) 2025-03-10 19:52:19 +01:00
screened-url.js DEV: Update lint-configs and autofix issues (#31620) 2025-03-05 01:20:16 +01:00
site-setting.js DEV: Change admin site settings filter to be route based (#33167) 2025-06-16 11:20:38 +08:00
site-text.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
staff-action-log.js FEATURE: Allow rejected user details to be scrubbed (#31987) 2025-03-31 12:40:35 +11:00
theme-settings.js FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
theme-site-settings.js FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
theme.js FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
tl3-requirements.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
user-export.js FEATURE: Allow admins to export users (#30918) 2025-01-24 08:13:25 +11:00
user-field.js DEV: Modernize admin user fields (#29843) 2024-11-25 11:54:43 +08:00
version-check.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
watched-word.js DEV: Consolidate i18n import paths (#29804) 2024-11-19 20:45:18 +00:00
web-hook.js FIX: Allow setting blank secret on an existing webhook (#33096) 2025-06-11 09:53:12 +08:00