101 Commits

Author SHA1 Message Date
Jeffrey Chen 887e5d8ed2 🎨 Improve the creation of new documents (#17959)
* 🎨 Improve the creation of new documents https://github.com/siyuan-note/siyuan/issues/11915

* 🎨 Improve the creation of new block reference documents https://github.com/siyuan-note/siyuan/issues/11915
2026-06-29 10:33:43 +08:00
Daniel 922c2fcf0d Supports configuring secrets and variables https://github.com/siyuan-note/siyuan/issues/17933 2026-06-25 09:15:53 +08:00
Jeffrey Chen 1fa30d4803 New settings UI (#17675)
* New settings UI

* AI 配置项

* 清理调试代码

* https://github.com/siyuan-note/siyuan/pull/17675#discussion_r3441865530

* https://github.com/siyuan-note/siyuan/pull/17675#discussion_r3441458542

* 还原:修改停靠栏快捷键设置之后不能立即生效 https://github.com/siyuan-note/siyuan/pull/17675#discussion_r3446054676

* 改进条件编译 1

* 改进条件编译 2

* 改进条件编译 1.1

* 改进条件编译 2.1
2026-06-21 08:45:59 +08:00
Jeffrey Chen 5e0a1a4be2 ♻️ Change the lang value to comply with RFC 5646 https://github.com/siyuan-note/siyuan/issues/17855 (#17888) 2026-06-19 23:34:31 +08:00
Jeffrey Chen 43b191af75 🎨 Improve AI configuration normalization (#17883) 2026-06-19 07:41:43 +08:00
Daniel dbf076ce98 New settings UI https://github.com/siyuan-note/siyuan/issues/17601
Signed-off-by: Daniel <845765@qq.com>
2026-06-16 11:21:45 +08:00
Daniel 42a4284448 AI Agent https://github.com/siyuan-note/siyuan/issues/17797
Signed-off-by: Daniel <845765@qq.com>
2026-06-15 23:39:43 +08:00
Jeffrey Chen ca0ce7ff2d ♻️ Adjust the AI configuration structure (#17858) 2026-06-15 08:39:01 +08:00
Daniel f0e961537b AI Agent https://github.com/siyuan-note/siyuan/issues/17797
Signed-off-by: Daniel <845765@qq.com>
2026-06-14 21:40:44 +08:00
Daniel c1716dacbb New settings UI https://github.com/siyuan-note/siyuan/issues/17601
Signed-off-by: Daniel <845765@qq.com>
2026-06-14 20:05:55 +08:00
Daniel 70c6af57d1 New settings UI https://github.com/siyuan-note/siyuan/issues/17601
Signed-off-by: Daniel <845765@qq.com>
2026-06-14 19:46:20 +08:00
Daniel e97a72cba5 New settings UI https://github.com/siyuan-note/siyuan/issues/17601
Signed-off-by: Daniel <845765@qq.com>
2026-06-14 18:49:14 +08:00
Daniel 69a8fba803 ♻️ Change the lang value to comply with RFC 5646 https://github.com/siyuan-note/siyuan/issues/17855
Signed-off-by: Daniel <845765@qq.com>
2026-06-14 14:03:02 +08:00
Daniel 8ef2669978 New settings UI https://github.com/siyuan-note/siyuan/issues/17601
Signed-off-by: Daniel <845765@qq.com>
2026-06-14 09:06:54 +08:00
Daniel f32f48c720 New settings UI https://github.com/siyuan-note/siyuan/issues/17601
Signed-off-by: Daniel <845765@qq.com>
2026-06-13 21:57:40 +08:00
Daniel ea892bca7e New settings UI https://github.com/siyuan-note/siyuan/issues/17601
Signed-off-by: Daniel <845765@qq.com>
2026-06-13 14:34:04 +08:00
Daniel 123ed61f76 ♻️ No longer create table blocks_fts_case_insensitive https://github.com/siyuan-note/siyuan/issues/17849
Signed-off-by: Daniel <845765@qq.com>
2026-06-13 12:11:23 +08:00
Daniel 59dc786120 New settings UI https://github.com/siyuan-note/siyuan/issues/17601
Signed-off-by: Daniel <845765@qq.com>
2026-06-13 12:09:59 +08:00
游夏 36f4e3720e 🎨 Add Simplified/Traditional Chinese sensitivity option (#17846)
*  搜索支持区分繁简选项 Add Simplified/Traditional Chinese sensitivity option for search

新增搜索配置 hanSensitive(区分繁简,默认开启 = 现状行为,命名与语义
向 caseSensitive 对齐)。关闭后简体与繁体可互相检索。

- FTS 层:关闭区分繁简时,blocks_fts / blocks_fts_case_insensitive 建表
  追加 han_insensitive 分词器参数(依赖 88250/go-sqlite3 配套补丁),
  繁体在分词时按单字折叠为简体,token 偏移仍指向原文;
- 切换选项复用区分大小写现有的 FullReindex 流程;
- 高亮:EncloseHighlighting 在关闭区分繁简时将关键字逐字符展开为
  繁简等价字符类(如 诗经 -> [诗詩][经經]),与分词器使用同一份
  OpenCC TSCharacters 映射数据;
- 兼容:旧版本 conf.json 缺 hanSensitive 字段时按既往行为置为开启;
  setSearch 请求未携带该字段(现行前端/第三方调用)时保持当前值,
  避免被零值意外翻转并触发重建索引;
- 遵照配置界面重写计划(#17601),本次不改动设置界面与 i18n,仅添加
  配置数据结构字段与前端类型定义(config.d.ts)。

范围说明:本次仅覆盖块全文搜索(关键字/查询语法)的命中与高亮;
历史/资源文件搜索、数据库属性过滤、虚拟引用、查找替换的替换动作
不在本次范围内(替换保持字节精确以避免误改原文)。

Fixes #13304

* 🐛 add missing util.SearchHanSensitive referenced by highlighting and sql.SetHanSensitive

Copilot 评审指出 util.SearchHanSensitive 未定义导致无法编译:补上该全局
变量(默认 true,与既往行为一致,由 sql.SetHanSensitive 维护),并修正
conf/search.go 的 gofmt 对齐。已在本地以 dev 当前 go.mod(已合并的
88250/go-sqlite3 分词器)完成 go build -tags fts5 与 kernel/search 单测验证。
2026-06-12 15:59:50 +08:00
Daniel e0208e875e AI Agent https://github.com/siyuan-note/siyuan/issues/17797
Signed-off-by: Daniel <845765@qq.com>
2026-06-07 18:10:02 +08:00
Yingyi / 颖逸 c4ae1d44e5 🎨 Fix kernel plugin related issues (#17670)
* feat(kernel-plugin): Prevent storage.put and storage.remove in read-only mode

* feat(kernel-plugin): Reload petal plugin on install

When installing a Bazaar package, ensure that if the corresponding petal exists and is enabled we call SetPetalEnabled to trigger a kernel plugin reload before scheduling the plugin reload. This ensures the petal's kernel plugin picks up the newly installed package immediately.

* feat(kernel-plugin): Use gin-contrib/sse.Event for SSE handling

Replace the custom sseEvent type with gin-contrib/sse.Event and update the SSE handling pipeline. The JS handler now accepts an event object (data, event, id, retry), which is validated and converted to sse.Event before being sent on the channel; the server renders events with c.Render(-1, e). Added import for github.com/gin-contrib/sse and bumped gin-contrib/sse to v1.1.1 in go.mod (go.sum updated accordingly).

* feat(kernel-plugin): Add global kernel plugin start/stop hooks

Introduce OnKernelPluginsStart and OnKernelPluginsStop hooks and replace the previous OnKernelPluginShutdown usage. Update Close to call OnKernelPluginsStop and wire the new hooks in the plugin manager (OnKernelPluginsStart -> GetManager().Start, OnKernelPluginsStop -> GetManager().Stop). Existing per-plugin OnKernelPluginStart/OnKernelPluginStop handlers remain unchanged. This adds global lifecycle hooks to start and stop all valid plugins via the manager.

* feat(kernel-plugin): Add plugin manager state and bazaar handling

Call kernel plugin start/stop callbacks when bazaar settings change and add lifecycle state to the PluginManager. setting.go now triggers model.OnKernelPluginsStop or model.OnKernelPluginsStart when Bazaar.PetalDisabled or Bazaar.Trust change. plugin/manager.go introduces a PluginManagerState enum, initializes the manager as stopped, adds a State() accessor, and changes lifecycleMu to an RWMutex. Start/Stop now check the current state to avoid redundant operations, skip starting if bazaar config disables plugins, and update the manager state after start/stop, with additional log messages. These changes improve safety around concurrent start/stop and ensure bazaar configuration is honored.

* feat(kernel-plugin): Add plugin hot-reload watcher and per-plugin dirs

Add fsnotify-based watcher and manager context to detect kernel.js changes and trigger plugin hot-reloads. Introduce pluginsDir, pluginDir and storageDir fields and use storageDir in storage API to prevent path traversal. Replace single plugin mutex map with per-plugin mutex map, serialize start/stop per plugin, and adjust StartPlugin/StopPlugin flow to stop first for hot-reload, honor Bazaar config flags, and propagate start context. Update KernelPlugin to accept a start context and set per-plugin directories. Add helper functions to add/remove plugin dirs from the watcher and simplify GetLoadedPlugin. (Note: go.sum changes are present but not described.)

* feat(kernel-plugin): Add storage watcher and plugin reload improvements

Introduce per-plugin fsnotify storage watcher and expose a JS API for it (siyuan.storage.watcher.add/remove). KernelPlugin now accepts a parent context, creates an fsnotify.Watcher, starts a storage watch goroutine that publishes standardized runtime events (createEventMessage) for fs changes, and provides addStorageWatch/removeStorageWatch helpers. Manager API renamed to addPluginSourceWatch/removePluginSourceWatch with safer watcher handling and clearer reload logging; StartPlugin now passes the manager context into NewKernelPlugin. Also refactor runtime start/stop event publishing to use createEventMessage and add minor logging/error handling for watcher creation and path watch operations. The JS watcher object is frozen and integrated into siyuan.storage.
2026-05-13 08:24:46 +08:00
Daniel 38be2cd887 Shorthands on mobile https://github.com/siyuan-note/siyuan/issues/14414
Signed-off-by: Daniel <845765@qq.com>
2026-05-09 18:33:19 +08:00
Jeffrey Chen 5c674d7249 ♻️ Replace interface{} with any (#17415) 2026-04-05 16:48:32 +08:00
Jeffrey Chen 9256842fca ♻️ ParseJsonArg adds null value check (#17399) 2026-04-04 08:53:09 +08:00
Jeffrey Chen ea69c9ab3c 🎨 Add kernel API /api/setting/setIcon (#17326) 2026-03-24 23:00:53 +08:00
Daniel a8abfa5ddf ♻️ https://github.com/siyuan-note/siyuan/pull/17307
Signed-off-by: Daniel <845765@qq.com>
2026-03-22 12:26:51 +08:00
Daniel f31ba9485c 🎨 Improve set publish
Signed-off-by: Daniel <845765@qq.com>
2026-03-18 12:43:55 +08:00
Jeffrey Chen c14301aed1 ♻️ Improve /api/setting/setTheme https://github.com/siyuan-note/siyuan/pull/17198 (#17205) 2026-03-13 20:38:32 +08:00
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
Jeffrey Chen 465755e184 ♻️ Remove bazaar cache clear on appearance language change (#17160) 2026-03-08 15:13:43 +08:00
Daniel e878e5cc4b 🎨 Support configuring the floating window hover trigger delay https://github.com/siyuan-note/siyuan/pull/17123
Signed-off-by: Daniel <845765@qq.com>
2026-03-02 23:28:49 +08:00
Jeffrey Chen 2739def842 🎨 Support configuring the floating window hover trigger delay (#17123)
* 🎨 Support configuring the floating window hover trigger delay

* 🎨 Support configuring the floating window hover trigger delay
2026-03-02 23:13:02 +08:00
Daniel 9d1302a8f1 🎨 Supports setting Pandoc parameters for export docx https://github.com/siyuan-note/siyuan/issues/16845
Signed-off-by: Daniel <845765@qq.com>
2026-01-23 20:58:53 +08:00
Daniel e9564ff0ec 🎨 Supports setting Pandoc parameters for export docx https://github.com/siyuan-note/siyuan/issues/16845
Signed-off-by: Daniel <845765@qq.com>
2026-01-20 10:05:49 +08:00
Daniel 28c51981e4 🎨 Automatically apply code snippets after data synchronization https://github.com/siyuan-note/siyuan/issues/16736
Signed-off-by: Daniel <845765@qq.com>
2026-01-02 12:38:37 +08:00
Daniel 42b7929786 🎨 Supports configuring the maximum number of Recent documents to be listed https://github.com/siyuan-note/siyuan/issues/16720
Signed-off-by: Daniel <845765@qq.com>
2025-12-30 08:48:45 +08:00
Daniel 96c2093bd8 🎨 Supports configuring the maximum number of Recent documents to be listed https://github.com/siyuan-note/siyuan/issues/16720
Signed-off-by: Daniel <845765@qq.com>
2025-12-29 22:36:56 +08:00
Daniel 364b253082 🎨 Improve file history generation https://github.com/siyuan-note/siyuan/issues/16501
Signed-off-by: Daniel <845765@qq.com>
2025-12-03 18:09:49 +08:00
Daniel fb982b5a81 🎨 Improve interface loading after switching themes and updating code snippets https://github.com/siyuan-note/siyuan/issues/16390
Signed-off-by: Daniel <845765@qq.com>
2025-11-23 19:33:45 +08:00
Daniel 3cc93f2425 🎨 Improve interface loading after switching themes and updating code snippets https://github.com/siyuan-note/siyuan/issues/16390
Signed-off-by: Daniel <845765@qq.com>
2025-11-23 15:40:35 +08:00
Daniel 47a6d288b0 🎨 Support setting status bar message switch https://github.com/siyuan-note/siyuan/issues/16236
Signed-off-by: Daniel <845765@qq.com>
2025-11-13 13:01:12 +08:00
Daniel c3da02f657 🎨 History Retention Days supports a maximum setting of 3650 https://github.com/siyuan-note/siyuan/issues/15979
Signed-off-by: Daniel <845765@qq.com>
2025-09-29 22:22:15 +08:00
Daniel e36592ab5c 🎨 History Retention Days supports a maximum setting of 3650 https://github.com/siyuan-note/siyuan/issues/15979
Signed-off-by: Daniel <845765@qq.com>
2025-09-29 21:14:44 +08:00
Daniel eb13c34fe5 🎨 Alert users when .sy file or database .json exceed 8MB https://github.com/siyuan-note/siyuan/issues/15451 2025-08-24 10:50:03 +08:00
Daniel e492b1fa51 🎨 XSS through emoji name https://github.com/siyuan-note/siyuan/issues/15034 2025-06-23 11:03:39 +08:00
Daniel 526e436fbc 🔒 XSS through emoji name https://github.com/siyuan-note/siyuan/issues/15034 https://github.com/siyuan-note/siyuan/pull/15041 2025-06-17 17:00:29 +08:00
Daniel 4c080e2b34 🎨 Trim space in dialynote/block ref/new doc save path https://github.com/siyuan-note/siyuan/issues/14482 2025-03-31 15:29:59 +08:00
Daniel e25e8042ba 🐛 The marketplace language does not change after switching the appearance language https://github.com/siyuan-note/siyuan/issues/12892 2024-10-26 21:36:08 +08:00
Oleksandr Redko b100721fee ♻️ Refactor Go to err != nil, err == nil (#12385) 2024-09-04 09:40:50 +08:00
Daniel 4e9b0bc6c6 🐛 Publish https://github.com/siyuan-note/siyuan/issues/11902 2024-07-07 22:39:53 +08:00