Files
siyuan/kernel
konti1334 2e6b13eec4 🎨 add POST /api/setting/setTheme endpoint (#17198)
Adds a minimal endpoint for activating a theme by name and mode without
requiring the caller to fetch and re-POST the entire appearance config blob.

Request body:
  { "theme": "<theme-dir-name>", "mode": 0|1 }

Behaviour:
- Sets both ThemeLight and ThemeDark to the supplied theme name
- Sets Mode (0 = light, 1 = dark)
- Calls InitAppearance() to validate the theme exists and reads its
  version from theme.json for cache-busting
- Saves conf.json
- Broadcasts the "setAppearance" WebSocket event so all open windows
  call loadAssets() and reload the theme CSS with the new ?v= parameter

Returns the full Appearance config (same shape as setAppearance).

Motivation: external tools (e.g. OS-level theme switchers) previously
had to GET /api/system/getConf, patch the appearance object, and POST
the entire blob to /api/setting/setAppearance.  /api/setting/setTheme
reduces that to a single, self-contained call with no dependencies.

Co-authored-by: You name <konty@github.com>
2026-03-13 17:28:45 +08:00
..
2026-03-03 10:16:22 +08:00
2026-03-09 00:54:50 +08:00
…
2026-03-10 13:01:28 +08:00
2026-02-15 16:18:45 +08:00
2026-01-28 10:44:42 +08:00
2026-03-13 10:49:16 +08:00
2026-03-04 22:33:35 +08:00
2025-10-04 14:15:03 +08:00