discourse/app/assets/javascripts/admin/addon/controllers
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-badges DEV: Add Settings tab to admin Badges page (#32251) 2025-04-21 09:41:29 +08:00
admin-analytics-settings.js DEV: Add Analytics and SEO admin config page (#32190) 2025-04-07 16:15:37 +08:00
admin-api-keys-index.js DEV: Update admin controllers to native class syntax (#20674) 2023-03-15 09:42:12 +00:00
admin-api-keys-new.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-api-keys-settings.js DEV: Move User API admin settings into API keys page (#32232) 2025-04-10 10:40:25 +08:00
admin-api-keys.js DEV: Move User API admin settings into API keys page (#32232) 2025-04-10 10:40:25 +08:00
admin-area-settings-base.js FEATURE: Initial version of experimental admin search (#31299) 2025-02-21 11:59:24 +10:00
admin-backups-index.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-backups-logs.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
admin-backups-settings.js FEATURE: settings tab for permalinks (#30192) 2024-12-19 10:40:34 +11:00
admin-backups.js UX: Apply admin interface guidelines to Backups page (#28051) 2024-08-20 09:59:43 +10:00
admin-badges.js DEV: Add Settings tab to admin Badges page (#32251) 2025-04-21 09:41:29 +08:00
admin-config-content-categories-and-tags.js DEV: Add Content admin config page (#32194) 2025-04-10 11:20:22 +08:00
admin-config-content-posts-and-topics.js DEV: Add Content admin config page (#32194) 2025-04-10 11:20:22 +08:00
admin-config-content-settings.js FIX: Broken links to site settings under Content section (#33597) 2025-07-14 16:14:50 +08:00
admin-config-content-sharing.js DEV: Add Content admin config page (#32194) 2025-04-10 11:20:22 +08:00
admin-config-content-stats-and-thresholds.js DEV: Add Content admin config page (#32194) 2025-04-10 11:20:22 +08:00
admin-config-developer-settings.js UX: Admin setting page consistency - Developer (#30607) 2025-01-07 15:17:36 +11:00
admin-config-experimental-settings.js UX: Admin setting page consistency - Experimental (#30572) (#30603) 2025-01-07 12:22:10 +10:00
admin-config-files-settings.js UX: Admin setting page consistency - Files and Other (#30572) (#30614) 2025-01-07 16:39:00 +10:00
admin-config-flags-settings.js FEATURE: settings tab for permalinks (#30192) 2024-12-19 10:40:34 +11:00
admin-config-group-permissions-settings.js UX: Admin setting page consistency - Group permissions (#30528) (#30578) 2025-01-07 11:25:21 +10:00
admin-config-interface-settings.js DEV: Add Interface and layout admin config page (#32197) 2025-04-08 09:22:10 +08:00
admin-config-legal-settings.js UX: Admin setting page consistency - Legal (#30572) 2025-01-06 16:08:42 +10:00
admin-config-localization-settings.js FEATURE: Localization admin settings config page (#31085) 2025-01-31 12:55:30 +10:00
admin-config-login-and-authentication-settings.js UX: Move first settings admin route to config page (#30510) 2025-01-02 09:13:37 +10:00
admin-config-logo-settings.js UX: Admin setting page consistency - Site Logo (#30567) 2025-01-06 15:45:19 +11:00
admin-config-navigation-settings.js UX: Admin setting page consistency - Navigation (#30574) 2025-01-06 17:44:33 +11:00
admin-config-notifications-settings.js UX: Admin setting page consistency - Notifications (#30528) 2025-01-03 10:34:40 +10:00
admin-config-onebox-settings.js UX: Admin setting page consistency - Onebox (#30611) 2025-01-07 16:21:53 +11:00
admin-config-rate-limits-settings.js UX: Admin setting page consistency - Rate Limits (#30609) 2025-01-07 15:46:40 +11:00
admin-config-search-settings.js UX: Admin setting page consistency - Search (#30528) (#30573) 2025-01-06 16:36:48 +10:00
admin-config-security-settings.js UX: Admin setting page consistency - Security (#30598) 2025-01-07 13:48:40 +11:00
admin-config-site-admin-settings.js DEV: Add Site admin admin config page (#32196) 2025-04-08 09:52:42 +08:00
admin-config-spam-settings.js UX: Admin setting page consistency - Spam (#30606) 2025-01-07 15:17:15 +11:00
admin-config-trust-levels-settings.js UX: Admin setting page consistency - Trust levels (#30571) 2025-01-06 15:53:18 +10:00
admin-config-user-api-settings.js UX: Admin setting page consistency - User API (#30610) 2025-01-07 16:05:54 +11:00
admin-config-user-defaults-settings.js DEV: Add User defaults admin config page (#32195) 2025-04-08 09:21:54 +08:00
admin-customize-colors-show.js UX: Update some delete confirmation dialogs (#33018) 2025-06-02 09:14:58 -04:00
admin-customize-colors.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-customize-email-style-edit.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-customize-form-templates-index.js DEV: Use the "new" service import (#26059) 2024-03-06 18:05:11 +01:00
admin-customize-robots-txt.js DEV: refactor usage of buffered-content mixin (#31926) 2025-03-21 09:06:26 +08:00
admin-customize-themes-edit.js UX: Simplify admin theme editor (#31561) 2025-03-03 12:20:11 +00:00
admin-customize-themes-show-colors.js FEATURE: Theme-owned color palettes (#32795) 2025-06-04 07:47:58 +03:00
admin-customize-themes-show-index.js FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
admin-customize-themes-show.js FEATURE: Theme-owned color palettes (#32795) 2025-06-04 07:47:58 +03:00
admin-customize-themes.js DEV: remove old themes/components code (#32875) 2025-05-26 09:21:15 +08:00
admin-dashboard-general.js DEV: Move admin only constants into admin bundle (#32141) 2025-04-03 14:28:36 +08:00
admin-dashboard-moderation.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-dashboard-reports.js DEV: Move discourse-common/config/environment to discourse/lib (#30738) 2025-01-13 15:29:26 +00:00
admin-dashboard-tab.js DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
admin-dashboard.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-email-advanced-test.js DEV: Ignore an upcoming eslint rule (#29194) 2024-10-14 19:09:25 +02:00
admin-email-logs-bounced.js DEV: Extract e-mail logs into their own admin page (#32211) 2025-04-08 17:50:12 +08:00
admin-email-logs-received.js DEV: Extract e-mail logs into their own admin page (#32211) 2025-04-08 17:50:12 +08:00
admin-email-logs-rejected.js DEV: Extract e-mail logs into their own admin page (#32211) 2025-04-08 17:50:12 +08:00
admin-email-logs-sent.js DEV: Extract e-mail logs into their own admin page (#32211) 2025-04-08 17:50:12 +08:00
admin-email-logs-skipped.js DEV: Extract e-mail logs into their own admin page (#32211) 2025-04-08 17:50:12 +08:00
admin-email-logs.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
admin-email-preview-digest.js DEV: Use the "new" service import (#26059) 2024-03-06 18:05:11 +01:00
admin-email-server-settings.js DEV: Add e-mail site settings to e-mail admin page (#32214) 2025-04-08 18:59:50 +08:00
admin-email-settings.js DEV: Add e-mail site settings to e-mail admin page (#32214) 2025-04-08 18:59:50 +08:00
admin-email-templates-edit.js DEV: refactor usage of buffered-content mixin (#31926) 2025-03-21 09:06:26 +08:00
admin-email-templates.js UX: Use DPageHeader on the Emails page (#30781) 2025-01-15 15:36:16 +11:00
admin-embedding-crawlers.js DEV: standardise toasts duration (#32741) 2025-05-15 14:59:37 +02:00
admin-embedding-index.js DEV: Update lint-configs and rubocop-discourse (#31728) 2025-03-10 19:52:19 +01:00
admin-embedding-posts-and-topics.js DEV: standardise toasts duration (#32741) 2025-05-15 14:59:37 +02:00
admin-embedding-settings.js UX: admins embedding page follows admin ux guideline (#30122) 2025-01-06 13:01:08 +11:00
admin-embedding.js UX: admins embedding page follows admin ux guideline (#30122) 2025-01-06 13:01:08 +11:00
admin-emojis-settings.js FEATURE: settings tab for permalinks (#30192) 2024-12-19 10:40:34 +11:00
admin-emojis.js DEV: Modernize admin emoji JavaScript (#29714) 2024-11-19 15:44:34 +08:00
admin-groups-index.js DEV: Add dedicated admin groups page (#32377) 2025-04-22 11:23:25 +08:00
admin-groups-settings.js DEV: Add dedicated admin groups page (#32377) 2025-04-22 11:23:25 +08:00
admin-groups.js DEV: Add dedicated admin groups page (#32377) 2025-04-22 11:23:25 +08:00
admin-logs-screened-emails.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
admin-logs-screened-ip-addresses.js DEV: Move discourse-common/config/environment to discourse/lib (#30738) 2025-01-13 15:29:26 +00:00
admin-logs-screened-urls.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
admin-logs-staff-action-logs.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-permalinks-index.js UX: Update some delete confirmation dialogs (#33018) 2025-06-02 09:14:58 -04:00
admin-permalinks-settings.js FEATURE: settings tab for permalinks (#30192) 2024-12-19 10:40:34 +11:00
admin-plugins-index.js DEV: Only include custom admin UIs in the plugins index tabs (#31192) 2025-02-05 15:02:46 +08:00
admin-plugins-show-settings.js FEATURE: settings tab for permalinks (#30192) 2024-12-19 10:40:34 +11:00
admin-plugins.js FIX: Only include custom plugin config routes in tabs for old show page (#31213) 2025-02-06 10:03:01 +08:00
admin-reports-dashboard-settings.js DEV: Add Dashboard settings tab to Reports page (#32235) 2025-04-10 10:41:12 +08:00
admin-reports-show.js DEV: Add value transformer for admin reports show query params (#31597) 2025-03-04 13:33:08 +11:00
admin-reports.js DEV: Add Dashboard settings tab to Reports page (#32235) 2025-04-10 10:41:12 +08:00
admin-search-index.js UX: Show keyboard shortcut on full admin search page (#31646) 2025-04-03 14:12:31 +10:00
admin-search-logs-index.js DEV: Update lint-configs and rubocop-discourse (#31728) 2025-03-10 19:52:19 +01:00
admin-search-logs-term.js DEV: Consolidate i18n import paths (#29804) 2024-11-19 20:45:18 +00:00
admin-site-settings-category.js DEV: Change admin site settings filter to be route based (#33167) 2025-06-16 11:20:38 +08:00
admin-site-settings.js DEV: Change admin site settings filter to be route based (#33167) 2025-06-16 11:20:38 +08:00
admin-site-text-edit.js FIX: Refresh disabled state when switching between site texts (#32262) 2025-04-14 08:00:08 +03:00
admin-site-text-index.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-user-badges.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-user-index.js DEV: refactor CanCheckEmailsHelper to directly take model id (#32129) 2025-04-03 20:33:15 +08:00
admin-user.js DEV: Update lint-configs and rubocop-discourse (#31728) 2025-03-10 19:52:19 +01:00
admin-users-list-show.js DEV: standardise toasts duration (#32741) 2025-05-15 14:59:37 +02:00
admin-users-settings.js DEV: Add Settings tab to admin Users page (#32255) 2025-04-11 11:10:53 +08:00
admin-watched-words-action.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-watched-words.js DEV: Move discourse-common/config/environment to discourse/lib (#30738) 2025-01-13 15:29:26 +00:00
admin-web-hooks-edit.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-web-hooks-index.js DEV: Consolidate i18n import paths (#29804) 2024-11-19 20:45:18 +00:00
admin-web-hooks-show.js DEV: Update lint-configs and rubocop-discourse (#31728) 2025-03-10 19:52:19 +01:00
admin-web-hooks.js DEV: Update admin controllers to native class syntax (#20674) 2023-03-15 09:42:12 +00:00
admin-whats-new.js FEATURE: Allow admins to force refresh "What's new?" (#29911) 2024-11-27 09:40:55 +10:00
admin.js FIX: remove admin_sidebar_enabled_groups setting (#31693) 2025-03-11 11:41:38 +11:00