0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-11 00:50:34 +08:00
discourse/app/assets/stylesheets
Natalie Tay 254750692d
DEV: Introduce a category scope enum for flexible category selection (#41505)
This PR adds a shared `CategoryScopeSiteSetting` enum for category-scope
dropdowns.

The enum keeps the stored values short (`all`, `public`, `include`,
`include_strict`, `exclude`, `exclude_strict`) while letting the admin
UI show clearer labels like “Include selected categories (with
subcategories)”. This gives category-list settings a reusable way to
explain include/exclude and strict/non-strict behavior without making
the setting description do all the work.

Example usage:

```yaml
feature_name_category_scope:
    type: enum
    default: "public" # public categories
    enum: "CategoryScopeSiteSetting"
    client: false
    area: "feature-name"
feature_name_categories:
    type: category_list
    default: ""
    client: false
    area: "feature-name"
    depends_on:
      - feature_name_category_scope
    depends_on_values:
      feature_name_category_scope:
        - include
        - include_strict
        - exclude
        - exclude_strict
    depends_behavior: "hidden" # this settting will be hidden based on the depends_on_values
    dependent_setting_display: "inline" # this setting will be displayed inline to the above
```

And suitable descriptions in `server.en.yml`

```yaml
feature_name_category_scope: "Choose which categories this feature can use. Include and exclude options use {{setting:feature_name_categories}}."   
feature_name_categories: "Categories used when the category scope is set to <strong>include</strong> or <strong>exclude</strong>."
```

https://github.com/user-attachments/assets/d5255687-e995-4123-951b-2c784b315c0b
2026-07-08 15:54:10 +08:00
..
admin DEV: Introduce a category scope enum for flexible category selection (#41505) 2026-07-08 15:54:10 +08:00
common UX: simplify ai conversations topic map styles, alignment (#41528) 2026-07-07 16:06:41 -04:00
lib
vendor
admin.scss
admin_rtl.scss
color_definitions.scss DEV: Add --d-selected-text-color variable (#39495) 2026-04-23 13:06:24 -04:00
common.scss DEV: Exploring a token system (#38700) 2026-04-23 13:47:45 -05:00
desktop.scss DEV: move desktop sidebar-section CSS to common, remove desktop css index (#40803) 2026-06-11 15:09:09 -04:00
desktop_rtl.scss
embed.scss DEV: Apply latest stylelint autofixes (#36294) 2025-11-27 18:07:22 +01:00
mobile.scss DEV: move mobile select-kit CSS to common files (#39055) 2026-04-02 13:46:06 -04:00
mobile_rtl.scss
publish.scss
qunit-custom.scss
wcag.scss UX: Implement foundation fixes & feedback (#40494) 2026-06-02 13:29:09 -05:00
wizard.scss UX: Add horizon site skeleton to setup wizard (#40617) 2026-06-08 14:32:38 -07:00
wizard_rtl.scss