discourse/app/assets/javascripts/admin/addon/components
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-config-area-cards DEV: standardise toasts duration (#32741) 2025-05-15 14:59:37 +02:00
admin-config-areas FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
form-template UX: Update some delete confirmation dialogs (#33018) 2025-06-02 09:14:58 -04:00
modal UX: Close admin search modal immediately when result is selected (#32811) 2025-05-21 08:09:15 +10:00
report-filters DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
schema-setting FIX: fix label and description not working in type objects for site settings (#32868) 2025-05-23 11:39:19 -03:00
site-settings DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-area-settings.gjs FEATURE: Bulk save site settings (#32013) 2025-04-01 09:39:19 +08:00
admin-backups-actions.gjs DEV: Consolidate i18n import paths (#29804) 2024-11-19 20:45:18 +00:00
admin-backups-logs.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-badges-award.gjs DEV: Add Settings tab to admin Badges page (#32251) 2025-04-21 09:41:29 +08:00
admin-badges-index.gjs DEV: Add Settings tab to admin Badges page (#32251) 2025-04-21 09:41:29 +08:00
admin-badges-list.gjs DEV: Add Settings tab to admin Badges page (#32251) 2025-04-21 09:41:29 +08:00
admin-badges-show.gjs FIX: Badge grouping for system badges should be editable (#33504) 2025-07-08 10:56:47 +08:00
admin-badges.gjs DEV: allows to pass @currentWhen to NavItem (#32825) 2025-05-21 09:31:47 +02:00
admin-config-area-card-section.gjs UX: card section toggle (#31644) 2025-03-06 10:31:29 +11:00
admin-config-area-card.gjs DEV: Move AdminConfigAreaCard back to the admin bundle (#33429) 2025-07-02 14:03:33 +03:00
admin-config-area-empty-list.gjs FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
admin-editable-field.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-embedding-host-form.gjs UX: admins embedding page follows admin ux guideline (#30122) 2025-01-06 13:01:08 +11:00
admin-filtered-site-settings.gjs DEV: Move SiteSettingFilter to admin namespace (#32458) 2025-04-25 14:13:49 +08:00
admin-flag-item.gjs DEV: Use reusable d-table instead of admin-only styles (#33531) 2025-07-10 19:58:04 -06:00
admin-flags-form.gjs DEV: Simplify "Admin Flags Page" system test to reduce runtime duration (#32431) 2025-04-24 15:47:22 +08:00
admin-font-chooser.gjs UX: split admin logo and fonts to separate pages (#32700) 2025-05-14 14:02:34 +08:00
admin-fonts-form.gjs DEV: standardise toasts duration (#32741) 2025-05-15 14:59:37 +02:00
admin-form-row.gjs DEV: [gjs-codemod] apply codemod 2025-04-02 13:44:15 +01:00
admin-logo-form.gjs DEV: standardise toasts duration (#32741) 2025-05-15 14:59:37 +02:00
admin-nav.gjs DEV: Sort imports 2023-10-10 21:46:54 +01:00
admin-notice.gjs DEV: add btn-default classes to buttons using default styling (#31039) 2025-01-28 15:40:34 -05:00
admin-penalty-history.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-penalty-post-action.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-penalty-reason.gjs DEV: [gjs-codemod] apply codemod 2025-04-02 13:44:15 +01:00
admin-penalty-similar-users.gjs DEV: [gjs-codemod] apply codemod 2025-04-02 13:44:15 +01:00
admin-permalink-form.gjs FIX: Make permalink search work even when there're 100+ permalinks (#31354) 2025-02-16 00:19:16 +03:00
admin-plugin-config-area.gjs DEV: Remove plugin sidebar rendering fallback (#31012) 2025-01-28 09:42:24 +08:00
admin-plugin-config-page.gjs DEV: Remove plugin sidebar rendering fallback (#31012) 2025-01-28 09:42:24 +08:00
admin-plugins-list-item.gjs DEV: Use reusable d-table instead of admin-only styles (#33531) 2025-07-10 19:58:04 -06:00
admin-plugins-list.gjs DEV: Use reusable d-table instead of admin-only styles (#33531) 2025-07-10 19:58:04 -06:00
admin-report-chart.gjs DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-report-counters.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-report-inline-table.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-report-radar.gjs DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-report-stacked-chart.gjs DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-report-stacked-line-chart.gjs DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-report-storage-stats.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-report-table-cell.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-report-table-header.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-report-table-row.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-report-table.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-report.gjs DEV: Move admin only constants into admin bundle (#32141) 2025-04-03 14:28:36 +08:00
admin-reports.gjs DEV: Update lint-configs and rubocop-discourse (#31728) 2025-03-10 19:52:19 +01:00
admin-search-filters.gjs FEATURE: Initial version of experimental admin search (#31299) 2025-02-21 11:59:24 +10:00
admin-search.gjs FIX: Wait for data before showing admin search results (#32796) 2025-05-19 14:14:29 +08:00
admin-section-landing-item.gjs DEV: Change dIcon to icon in components (#31083) 2025-01-31 10:55:31 +10:00
admin-section-landing-wrapper.gjs DEV: Add a skeleton for section landing page & items (#28477) 2024-10-02 12:19:38 +10:00
admin-site-settings-changes-banner.gjs FEATURE: Theme-owned color palettes (#32795) 2025-06-04 07:47:58 +03:00
admin-site-settings-filter-controls.gjs Revert "UX: Hide inner site settings sidebar if admin sidebar enabled (#31047)" (#31267) 2025-02-11 12:47:40 +10:00
admin-theme-editor.gjs DEV: [gjs-codemod] apply codemod 2025-04-02 13:44:15 +01:00
admin-user-exports-table.gjs DEV: standardise toasts duration (#32741) 2025-05-15 14:59:37 +02:00
admin-user-field-item.gjs DEV: Use reusable d-table instead of admin-only styles (#33531) 2025-07-10 19:58:04 -06:00
admin-user-fields-form.gjs PERF: Introduce lazyHash and update PluginOutlet calls to use it (#32823) 2025-05-22 12:07:22 +01:00
admin-watched-word.gjs A11Y: add aria-hidden="true" wrapper around zero width space character in buttons (#31544) 2025-02-27 12:51:10 -05:00
api-key-item.gjs DEV: Use reusable d-table instead of admin-only styles (#33531) 2025-07-10 19:58:04 -06:00
bulk-user-delete-confirmation.gjs DEV: revert admin users list change (#32723) 2025-05-15 09:48:01 +02:00
changes-banner.gjs FEATURE: Theme-owned color palettes (#32795) 2025-06-04 07:47:58 +03:00
chart.gjs FIX: Rerender Chart component if config changes (#29955) 2024-11-28 13:37:59 +10:00
color-input.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
color-palette-editor.gjs FEATURE: system themes (#32681) 2025-06-13 10:36:31 +08:00
dashboard-new-feature-item.gjs DEV: standardise toasts duration (#32741) 2025-05-15 14:59:37 +02:00
dashboard-new-features.gjs FEATURE: Allow showing only experiments on "What's new?" (#31347) 2025-02-14 13:30:37 +10:00
dashboard-period-selector.gjs DEV: add btn-default classes to buttons using default styling (#31039) 2025-01-28 15:40:34 -05:00
dashboard-problems.gjs DEV: Move discourse-common/ helpers to discourse/ (#30728) 2025-01-13 09:36:11 +00:00
email-styles-editor.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
embeddable-host.gjs DEV: Use reusable d-table instead of admin-only styles (#33531) 2025-07-10 19:58:04 -06:00
emoji-uploader.gjs DEV: Remove final {{action uses and enable lint rule (#32348) 2025-04-25 21:25:06 +01:00
emoji-value-list.gjs DEV: [gjs-codemod] apply codemod 2025-04-02 13:44:15 +01:00
file-size-input.gjs DEV: Consolidate i18n import paths (#29804) 2024-11-19 20:45:18 +00:00
flag-user.gjs DEV: Deprecate boundDate and formatAge helpers (#32672) 2025-05-10 20:08:08 +02:00
highlighted-code.gjs DEV: Convert highlighted-code to glimmer/gjs (#28914) 2024-09-17 13:49:35 +02:00
images-uploader.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
inline-edit-checkbox.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
install-theme-item.gjs DEV: Change dIcon to icon in components (#31083) 2025-01-31 10:55:31 +10:00
ip-lookup.gjs DEV: revert admin users list change (#32723) 2025-05-15 09:48:01 +02:00
moderation-history-item.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
permalink-form.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
plugin-commit-hash.gjs DEV: Convert various components to gjs (#26782) 2024-04-30 16:44:49 +02:00
screened-ip-address-form.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
secret-value-list.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
setting-validation-message.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
silence-details.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
simple-list.gjs DEV: [gjs-codemod] apply codemod 2025-04-02 13:44:15 +01:00
site-customization-change-details.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
site-customization-change-field.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
site-setting.gjs DEV: Update eye icon behavior for secret site settings (#33345) 2025-06-25 10:23:22 -05:00
site-text-summary.gjs DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
staff-actions.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
tags-uploader.gjs DEV: Move discourse-common/ helpers to discourse/ (#30728) 2025-01-13 09:36:11 +00:00
theme-setting-editor.js FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
theme-setting-relatives-selector.js FIX: Make theme relative selectors save (#33344) 2025-06-25 14:06:13 +03:00
theme-settings-editor.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
theme-site-setting-editor.gjs FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
theme-site-settings.gjs FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
theme-translation.js FIX: Hide secret admin fields by default (#33255) 2025-06-24 13:36:59 -05:00
theme-upload-add.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
themes-grid-card.gjs UX: reload the page when the default theme is changed (#33217) 2025-06-17 08:58:27 +08:00
themes-grid-placeholder.gjs UX: Add more info to theme cards (#32334) 2025-05-05 09:06:05 +08:00
themes-grid.gjs DEV: Move AdminConfigAreaCard back to the admin bundle (#33429) 2025-07-02 14:03:33 +03:00
themes-list-item.gjs PERF: Introduce lazyHash and update PluginOutlet calls to use it (#32823) 2025-05-22 12:07:22 +01:00
uppy-backup-uploader.gjs DEV: Consolidate i18n import paths (#29804) 2024-11-19 20:45:18 +00:00
value-list.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
version-checks.gjs PERF: Introduce lazyHash and update PluginOutlet calls to use it (#32823) 2025-05-22 12:07:22 +01:00
watched-word-form.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
watched-word-uploader.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
webhook-event-chooser.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
webhook-event.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
webhook-events.gjs DEV: refactor load-more component to glimmer and use intersection observer (#32285) 2025-04-28 10:22:35 +08:00
webhook-item.gjs DEV: Use reusable d-table instead of admin-only styles (#33531) 2025-07-10 19:58:04 -06:00
webhook-status.gjs UX: Apply admin table to webhooks (#30317) 2024-12-17 08:52:29 -07:00