Commit Graph

4318 Commits

Author SHA1 Message Date
Daniel 677063aa44 🎨 https://github.com/siyuan-note/siyuan/issues/17261
Signed-off-by: Daniel <845765@qq.com>
2026-03-22 16:26:19 +08:00
Jeffrey Chen c055028af0 ♻️ Code style: Potential resource leak (#17313)
* ♻️ Code style: Potential resource leak

* 🎨 Still use f.Unlock()

---------

Co-authored-by: D <845765@qq.com>
2026-03-22 12:41:59 +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
Jeffrey Chen 349a8ddc98 ♻️ Code style: unused function (#17307)
* ♻️ Code style: unused function

* Refactor reload handling in processMessage

Refactor reload logic to handle scroll reset and maintain functionality for mobile and non-mobile environments.

* Add ReloadUIResetScroll function to websocket.go

---------

Co-authored-by: D <845765@qq.com>
2026-03-22 12:19:44 +08:00
Jeffrey Chen 71342abe99 ♻️ Code style: Omit explicit types and remove unused (blank identifier) parameters (#17310) 2026-03-22 11:30:20 +08:00
Daniel bd5873559b ♻️ https://github.com/siyuan-note/siyuan/pull/17309
Signed-off-by: Daniel <845765@qq.com>
2026-03-22 11:29:03 +08:00
Jeffrey Chen 8dbe00d634 ♻️ Code style: Unused formal parameters (#17309) 2026-03-22 11:26:39 +08:00
Jeffrey Chen 7ad7fa3cad ♻️ Code style: unused variable (#17306) 2026-03-22 11:20:52 +08:00
Jeffrey Chen fdb1e4ac00 ♻️ Code style: Comparing with the equality operator fails on wrapped errors (#17303) 2026-03-22 11:11:25 +08:00
Jeffrey Chen 5a27e25ca6 ♻️ Code style: Format kernel/model/publish_access.go (#17300) 2026-03-22 11:05:48 +08:00
Jeffrey Chen 60fa7fe545 ♻️ Code style: Adjust comment formatting (#17299) 2026-03-22 11:05:22 +08:00
Daniel 9497f5dc1b 🎨 Supports rolling back a specified file within a data snapshot https://github.com/siyuan-note/siyuan/issues/12355
Signed-off-by: Daniel <845765@qq.com>
2026-03-22 11:03:03 +08:00
Jeffrey Chen fdd7285e90 ♻️ Code style: Redundant else branch (#17298) 2026-03-22 10:50:13 +08:00
Daniel 1667adb1c4 ♻️ min(runtime.NumCPU(), n)
Signed-off-by: Daniel <845765@qq.com>
2026-03-21 11:59:42 +08:00
iliya 717a8e857c ♻️ kernel/model/index: optimizations (#17286)
* kernel/model/carddav: modernize with wg.Go

* kernel/model/carddav: remove unused code
2026-03-21 11:55:47 +08:00
iliya 4597117e56 ♻️ modernize with wg.Go and remove unused code (#17285)
* kernel/model/caldav: modernize with wg.Go

* kernel/model/caldav: remove unused code
2026-03-21 11:55:13 +08:00
iliya 440f9e29ec ♻️ kernel/model/repository: refactor with wg.Go (#17288) 2026-03-21 11:53:35 +08:00
iliya 956bf40c6d ♻️ kernel/model/bazaar: modernize with wg.Go (#17284) 2026-03-21 11:53:03 +08:00
iliya 6bd344a4bb ♻️ kernel/model/index: remove redundant return (#17287) 2026-03-21 11:51:41 +08:00
iliya 87b28d3bdc ♻️ kernel/model/import: refactor bytes.HasPrefix + bytes.TrimPrefix (#17270)
* kernel/model/import: refactor bytes.HasPrefix + bytes.TrimPrefix

with bytes.CutPrefix.

remove redundant return in htmlBlock2Inline func

* Refactor token trimming for HTML blocks and links

* Update import.go

* Fix token trimming for HTML block processing
2026-03-21 11:43:15 +08:00
iliya 87e540c475 ♻️ kernel/model/sync: refactor HasPrefix + manual trimming and Index + m… (#17272)
* kernel/model/sync: refactor HasPrefix + manual trimming and Index + manual trimming

remove redundant returns.

rename arg in SetSyncPerception.

refactor errors.New fmt.Sprintf with fmt.Errorf

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-21 11:07:35 +08:00
iliya 0065886057 ♻️ kernel/model/search: refactor for loops (#17271) 2026-03-21 11:03:18 +08:00
iliya b45824d75a ♻️ kernel/model/history: remove unnecessary val in loop (#17269) 2026-03-21 10:49:41 +08:00
iliya 253b64fe3a ♻️ kernel/model/export: refactor manual loop with slices.Contains and manual copying with maps.Copy (#17268) 2026-03-21 10:48:37 +08:00
iliya 76d72e1334 ♻️ kernel/model/assets: refactoring (#17267)
* kernel/model/assets: refactoring

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: D <845765@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-21 10:42:38 +08:00
iliya 7c727bd140 ♻️ kernel/model/assets: refactor with strings.Cut (#17266) 2026-03-21 10:37:10 +08:00
Daniel edb3e6ff6c 🎨 https://github.com/siyuan-note/siyuan/issues/17261
Signed-off-by: Daniel <845765@qq.com>
2026-03-20 20:46:22 +08:00
Daniel ccc4e48c79 🎨 https://github.com/siyuan-note/siyuan/issues/12355#issuecomment-4087872586
Signed-off-by: Daniel <845765@qq.com>
2026-03-19 14:00:06 +08:00
Daniel 49e2a672c7 🎨 Supports rolling back a specified file within a data snapshot https://github.com/siyuan-note/siyuan/issues/12355
Signed-off-by: Daniel <845765@qq.com>
2026-03-19 13:01:45 +08:00
Daniel 59da115cc9 ♻️ Rename func
Signed-off-by: Daniel <845765@qq.com>
2026-03-19 13:01:45 +08:00
Daniel 974008f950 🔊 Print a warning log when calling a deprecated kernel API https://github.com/siyuan-note/siyuan/issues/17257
Signed-off-by: Daniel <845765@qq.com>
2026-03-19 10:01:02 +08:00
Daniel 6b073623c7 🎨 Clean code
Signed-off-by: Daniel <845765@qq.com>
2026-03-17 20:15:57 +08:00
Jeffrey Chen 26e72ea292 🎨 Use the util.FileURLToLocalPath function to convert file:// file links uniformly (#17239) 2026-03-17 09:04:37 +08:00
Jeffrey Chen badf73723e 🎨 Improve support for URL-encoded local file names (#17238) 2026-03-17 08:52:58 +08:00
Daniel d6182c431d 🎨 https://github.com/siyuan-note/siyuan/issues/17228
Signed-off-by: Daniel <845765@qq.com>
2026-03-15 20:17:42 +08:00
Jeffrey Chen 4b0b075184 Improve closing user guide notebook (#17189)
* 🎨 Improve closing user guide notebook https://github.com/siyuan-note/siyuan/issues/17182

* 🎨 Improve closing user guide notebook https://github.com/siyuan-note/siyuan/pull/17189#issuecomment-4045377189

* 🎨 Improve closing user guide notebook

* 🎨 Improve closing user guide notebook https://github.com/siyuan-note/siyuan/pull/17189#issuecomment-4062459992
2026-03-15 19:51:20 +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
Jeffrey Chen a9d1d7eeac 🧑‍💻 Add kernel API /api/ui/reloadTheme (#17206) 2026-03-13 20:37:28 +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 dd42efdc23 🎨 Improve block link export (#17202)
* 🎨 Improve block link export https://github.com/siyuan-note/siyuan/issues/17193

* 🎨 Improve block link export https://github.com/siyuan-note/siyuan/issues/17193
2026-03-13 17:02:42 +08:00
Daniel dd6377b29c 🎨 https://github.com/siyuan-note/siyuan/issues/17179
Signed-off-by: Daniel <845765@qq.com>
2026-03-13 10:28:20 +08:00
Daniel 3ae8b2f3ae 🎨 https://github.com/siyuan-note/siyuan/issues/17157
Signed-off-by: Daniel <845765@qq.com>
2026-03-13 10:15:20 +08:00
Daniel 1a4109d1e5 🎨 https://github.com/siyuan-note/siyuan/pull/17196
Signed-off-by: Daniel <845765@qq.com>
2026-03-13 09:30:59 +08:00
Daniel 3f944d0d75 🎨 https://github.com/siyuan-note/siyuan/pull/17196
Signed-off-by: Daniel <845765@qq.com>
2026-03-13 09:09:45 +08:00
konti1334 f0f2bdd2c1 ✨ Broadcast ws-main setBlockAttrs event after API call https://github.com/siyuan-note/siyuan/issues/17179 (#17196)
Co-authored-by: You name <konty@github.com>
2026-03-13 08:56:09 +08:00
Vanessa 8b1ff779ac ♻️ https://github.com/siyuan-note/siyuan/pull/16041 2026-03-12 21:08:11 +08:00
Yuxin Zhao 3facc37df9 Publish service supports document-level access control (#16041)
* 🎨 improve publish service https://github.com/siyuan-note/siyuan/issues/11928

* fix: change publish access storage

* 🎨 publish access control #16041

* fix: publish access in embed block and search

* fix: multiple lock in pubish service & insert locked content in publish service

* fix: multiple lock

* fix: password in embed block

* fix: locked and forbidden docs in gallery

* fix: dont use publish access block

* fix: attribute view of publish disabled docs

* fix: disable docs in table and gallery

* fix: locked docs in attribute view

* fix: purge publish access

* fix: disable docs in table and gallery groups

* fix: locked and disabled docs in attribute view, outline and preview

* fix: create publish_access.go

* fix: move publish auth to publish_access.go

* fix: tag and ref of locked docs

* fix: backlink of locked docs

* fix: search in locked docs

* fix: search history and asset

* fix: copy to markdown

* fix: hide command panel

* fix: publish access control in mobile

* fix: recent docs of invisible and locked docs

* fix: backlink in mobile

* fix: empty Tab

* fix: get locked and forbidden doc assets and files

* fix: refblock & asset

* fix: disable /api/file/sql in publish mode

* fix: publish access of kanban

* fix: adjustment for review

* fix: /api/filetree/setPublishAccess return error meesage

* fix: move the publishAccess button to the More Menu & revert the fix for barCommand/menuCommand

* fix: hotkey of command panel
2026-03-12 18:04:01 +08:00
Jeffrey Chen 60f783a3e8 Support setting document title to empty (#17110)
* 🎨 Support setting document title to empty

* 🎨 Support setting document title to empty

* 🎨 Support setting document title to empty

* 🎨 Support setting document title to empty
2026-03-12 10:47:12 +08:00
Jeffrey Chen 8b1cd2d5a3 ⚡ Improve exportTree https://github.com/siyuan-note/siyuan/issues/17178 (#17183) 2026-03-11 21:46:08 +08:00
Daniel 167c203d93 🎨 Fix https://github.com/siyuan-note/siyuan/issues/17180
Signed-off-by: Daniel <845765@qq.com>
2026-03-11 21:33:35 +08:00