Jelajahi Sumber

Merge remote-tracking branch 'origin/dev' into dev

Vanessa 1 tahun lalu
induk
melakukan
7569660cb3

+ 48 - 0
app/changelogs/v2.12.4/v2.12.4.md

@@ -0,0 +1,48 @@
+## Overview
+
+This version improves data sync stability and resolves an issue that caused data loss during data sync on Android 14.
+
+## Changelogs
+
+Below are the detailed changes in this version.
+
+### Enhancement
+
+* [Improve parsing code block pasted from web page](https://github.com/siyuan-note/siyuan/issues/10183)
+* [Setting `Esc` as a hotkey is not allowed](https://github.com/siyuan-note/siyuan/issues/10194)
+* [Use default icon if marketplace package icon does not exist](https://github.com/siyuan-note/siyuan/issues/10199)
+* [Plugins should be reloaded after the data sync](https://github.com/siyuan-note/siyuan/issues/10203)
+* [Adjust maximum width of dialog box on the desktop](https://github.com/siyuan-note/siyuan/issues/10211)
+* [Adjust the position of the indent and outdent button on the mobile](https://github.com/siyuan-note/siyuan/issues/10213)
+* [Improve AI-generated content parsing](https://github.com/siyuan-note/siyuan/issues/10217)
+* [Use ⌃0-9 instead of ⌥0-9 in macOS](https://github.com/siyuan-note/siyuan/issues/10218)
+* [Improve data sync to prevent an old snapshot to overwrite the new one](https://github.com/siyuan-note/siyuan/issues/10229)
+* [Improve search and replace spaces](https://github.com/siyuan-note/siyuan/issues/10231)
+
+### Bugfix
+
+* [Data sync may cause data loss on Android 14](https://github.com/siyuan-note/siyuan/issues/10205)
+* [Repeated escaping in preview area when searching for matching doc blocks](https://github.com/siyuan-note/siyuan/issues/10219)
+* [Remove invalid requests during boot](https://github.com/siyuan-note/siyuan/pull/10227)
+* [Spaced repetition read-only mode is invalid](https://github.com/siyuan-note/siyuan/issues/10230)
+
+### Refactor
+
+* [Simplify retry mechanism to get system version](https://github.com/siyuan-note/siyuan/pull/10198)
+* [Upgrade Electron v28.1.4](https://github.com/siyuan-note/siyuan/issues/10223)
+
+### Development
+
+* [Attribute Panel - Database supports adding key and sorting key](https://github.com/siyuan-note/siyuan/issues/10142)
+* [Improve database table view select filtering](https://github.com/siyuan-note/siyuan/issues/10193)
+* [Unable to update database table view cell under unknown circumstances](https://github.com/siyuan-note/siyuan/issues/10200)
+* [Add some database related internal kernel APIs](https://github.com/siyuan-note/siyuan/issues/10201)
+* [`Delete` at the end of a block should not delete the next block which is a database table view block](https://github.com/siyuan-note/siyuan/issues/10207)
+* [Add or remove the dock plugin should update "window.siyuan.config.uiLayout"](https://github.com/siyuan-note/siyuan/issues/10208)
+* [Set the maximum message size of WebSocket broadcast to 128 MiB](https://github.com/siyuan-note/siyuan/pull/10221)
+* [Improve database table view asset column name display](https://github.com/siyuan-note/siyuan/issues/10225)
+
+## Download
+
+* [B3log](https://b3log.org/siyuan/en/download.html)
+* [GitHub](https://github.com/siyuan-note/siyuan/releases)

+ 48 - 0
app/changelogs/v2.12.4/v2.12.4_zh_CHT.md

@@ -0,0 +1,48 @@
+## 概述
+
+此版本改進了資料同步穩定性,並解決了 Android 14 上資料同步導致資料遺失的問題。
+
+## 變更記錄
+
+以下是此版本中的詳細變更。
+
+### 改進功能
+
+* [改進從網頁貼上程式碼區塊解析](https://github.com/siyuan-note/siyuan/issues/10183)
+* [不支援配置 `Esc` 作為快捷鍵](https://github.com/siyuan-note/siyuan/issues/10194)
+* [當市集包圖示不存在時使用預設圖示](https://github.com/siyuan-note/siyuan/issues/10199)
+* [資料同步後按需重新載入插件](https://github.com/siyuan-note/siyuan/issues/10203)
+* [調整桌面端對話框最大寬度](https://github.com/siyuan-note/siyuan/issues/10211)
+* [調整行動端縮排與縮出按鈕位置](https://github.com/siyuan-note/siyuan/issues/10213)
+* [改進 AI 產生的內容解析](https://github.com/siyuan-note/siyuan/issues/10217)
+* [在 macOS 上使用 ⌃0-9 替代 ⌥0-9](https://github.com/siyuan-note/siyuan/issues/10218)
+* [改進資料同步避免舊快照覆蓋新快照](https://github.com/siyuan-note/siyuan/issues/10229)
+* [改進空格搜尋和替換](https://github.com/siyuan-note/siyuan/issues/10231)
+
+### 修復缺陷
+
+* [資料同步可能在 Android 14 上導致資料遺失](https://github.com/siyuan-note/siyuan/issues/10205)
+* [搜尋符合文件區塊時預覽區重複轉義](https://github.com/siyuan-note/siyuan/issues/10219)
+* [移除啟動時的無效請求](https://github.com/siyuan-note/siyuan/pull/10227)
+* [間隔重複唯讀模式失效](https://github.com/siyuan-note/siyuan/issues/10230)
+
+### 開發重構
+
+* [簡化取得系統版本重試機制](https://github.com/siyuan-note/siyuan/pull/10198)
+* [升級 Electron v28.1.4](https://github.com/siyuan-note/siyuan/issues/10223)
+
+### 開發者
+
+* [屬性面板 - 資料庫 支援新增按鍵和排序鍵](https://github.com/siyuan-note/siyuan/issues/10142)
+* [改進資料庫表格視圖選擇列過濾](https://github.com/siyuan-note/siyuan/issues/10193)
+* [在某些情況下無法更新資料庫表格檢視儲存格](https://github.com/siyuan-note/siyuan/issues/10200)
+* [新增一些資料庫相關內核內部 APIs](https://github.com/siyuan-note/siyuan/issues/10201)
+* [資料庫表格檢視中按 `Delete` 不再刪除下方區塊](https://github.com/siyuan-note/siyuan/issues/10207)
+* [新增和刪除停靠列插件時更新 "window.siyuan.config.uiLayout"](https://github.com/siyuan-note/siyuan/issues/10208)
+* [設定 WebSocket 廣播最大訊息大小為 128 MiB](https://github.com/siyuan-note/siyuan/pull/10221)
+* [改進資料庫表格視圖資源列名顯示](https://github.com/siyuan-note/siyuan/issues/10225)
+
+## 下載
+
+* [B3log](https://b3log.org/siyuan/download.html)
+* [GitHub](https://github.com/siyuan-note/siyuan/releases)

+ 48 - 0
app/changelogs/v2.12.4/v2.12.4_zh_CN.md

@@ -0,0 +1,48 @@
+## 概述
+
+该版本改进了数据同步稳定性,并解决了 Android 14 上数据同步导致数据丢失的问题。
+
+## 变更记录
+
+以下是此版本中的详细变更。
+
+### 改进功能
+
+* [改进从网页粘贴代码块解析](https://github.com/siyuan-note/siyuan/issues/10183)
+* [不支持配置 `Esc` 作为快捷键](https://github.com/siyuan-note/siyuan/issues/10194)
+* [当集市包图标不存在时使用默认图标](https://github.com/siyuan-note/siyuan/issues/10199)
+* [数据同步后按需重新载入插件](https://github.com/siyuan-note/siyuan/issues/10203)
+* [调整桌面端对话框最大宽度](https://github.com/siyuan-note/siyuan/issues/10211)
+* [调整移动端缩进和缩出按钮位置](https://github.com/siyuan-note/siyuan/issues/10213)
+* [改进 AI 生成的内容解析](https://github.com/siyuan-note/siyuan/issues/10217)
+* [在 macOS 上使用 ⌃0-9 替代 ⌥0-9](https://github.com/siyuan-note/siyuan/issues/10218)
+* [改进数据同步避免旧快照覆盖新快照](https://github.com/siyuan-note/siyuan/issues/10229)
+* [改进空格搜索和替换](https://github.com/siyuan-note/siyuan/issues/10231)
+
+### 修复缺陷
+
+* [数据同步可能在 Android 14 上导致数据丢失](https://github.com/siyuan-note/siyuan/issues/10205)
+* [搜索匹配文档块时预览区重复转义](https://github.com/siyuan-note/siyuan/issues/10219)
+* [移除启动时的无效请求](https://github.com/siyuan-note/siyuan/pull/10227)
+* [间隔重复只读模式失效](https://github.com/siyuan-note/siyuan/issues/10230)
+
+### 开发重构
+
+* [简化获取系统版本重试机制](https://github.com/siyuan-note/siyuan/pull/10198)
+* [升级 Electron v28.1.4](https://github.com/siyuan-note/siyuan/issues/10223)
+
+### 开发者
+
+* [属性面板 - 数据库 支持添加键和排序键](https://github.com/siyuan-note/siyuan/issues/10142)
+* [改进数据库表格视图选择列过滤](https://github.com/siyuan-note/siyuan/issues/10193)
+* [在某些情况下无法更新数据库表格视图单元格](https://github.com/siyuan-note/siyuan/issues/10200)
+* [新增一些数据库相关内核内部 APIs](https://github.com/siyuan-note/siyuan/issues/10201)
+* [数据库表格视图中按 `Delete` 不再删除下方块](https://github.com/siyuan-note/siyuan/issues/10207)
+* [添加和删除停靠栏插件时更新 "window.siyuan.config.uiLayout"](https://github.com/siyuan-note/siyuan/issues/10208)
+* [设置 WebSocket 广播最大消息大小为 128 MiB](https://github.com/siyuan-note/siyuan/pull/10221)
+* [改进数据库表格视图资源列名显示](https://github.com/siyuan-note/siyuan/issues/10225)
+
+## 下载
+
+* [B3log](https://b3log.org/siyuan/download.html)
+* [GitHub](https://github.com/siyuan-note/siyuan/releases)

+ 0 - 31
app/electron/boot.html

@@ -30,10 +30,6 @@
          style="color: #9aa0a6;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;padding: 8px;height: 16px;line-height: 16px;"></div>
 </div>
 <script>
-    const sleep = (ms) => {
-        return new Promise(resolve => setTimeout(resolve, ms))
-    }
-
     const getSearch = (key) => {
         if (window.location.search.indexOf('?') === -1) {
             return ''
@@ -49,36 +45,9 @@
         })
         return value
     }
-
-    const redirect = () => {
-        const uri = 'http://127.0.0.1:' + location.port
-        if (navigator.userAgent.match(/Android/i))
-            document.location = uri
-        else
-            window.location.replace(uri)
-    }
     (async () => {
         const v = getSearch('v')
         document.getElementById('details').textContent = "v" + v + ' Booting kernel...'
-        let progressing = false
-        while (!progressing) {
-            try {
-                const progressResult = await fetch('http://127.0.0.1:' + location.port + '/api/system/bootProgress')
-                const progressData = await progressResult.json()
-                document.getElementById('progress').style.width = progressData.data.progress + '%'
-                document.getElementById('details').textContent = progressData.data.details
-                if (progressData.data.progress >= 100) {
-                    progressing = true
-                    if (navigator.userAgent.indexOf('Electron') === -1) {
-                        redirect()
-                    }
-                } else {
-                    await sleep(100)
-                }
-            } catch (e) {
-                await sleep(100)
-            }
-        }
     })()
 </script>
 </body>

+ 1 - 1
kernel/go.mod

@@ -51,7 +51,7 @@ require (
 	github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
 	github.com/sashabaranov/go-openai v1.18.3
 	github.com/shirou/gopsutil/v3 v3.23.12
-	github.com/siyuan-note/dejavu v0.0.0-20240121151215-ff61e22aff37
+	github.com/siyuan-note/dejavu v0.0.0-20240123025532-2ca98172b05f
 	github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4
 	github.com/siyuan-note/eventbus v0.0.0-20240114153055-cf4c124ddf6d
 	github.com/siyuan-note/filelock v0.0.0-20240121150730-38e4487651d1

+ 2 - 2
kernel/go.sum

@@ -352,8 +352,8 @@ github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR
 github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d h1:lvCTyBbr36+tqMccdGMwuEU+hjux/zL6xSmf5S9ITaA=
 github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw=
 github.com/simplereach/timeutils v1.2.0/go.mod h1:VVbQDfN/FHRZa1LSqcwo4kNZ62OOyqLLGQKYB3pB0Q8=
-github.com/siyuan-note/dejavu v0.0.0-20240121151215-ff61e22aff37 h1:yfGGX94gyE5RysDvbDqE4nVp5mE3VSzzst9vxc+HUwQ=
-github.com/siyuan-note/dejavu v0.0.0-20240121151215-ff61e22aff37/go.mod h1:f5VvNOtytQblmaM4zYgm+VYcokqUR3z6IcrWMhalk6A=
+github.com/siyuan-note/dejavu v0.0.0-20240123025532-2ca98172b05f h1:BsUy5lKm17gbeeTupvSWQH6wlwrou7qiMDe6TZERkYA=
+github.com/siyuan-note/dejavu v0.0.0-20240123025532-2ca98172b05f/go.mod h1:f5VvNOtytQblmaM4zYgm+VYcokqUR3z6IcrWMhalk6A=
 github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4 h1:kJaw5L/evyW6LcB9IQT8PR4ppx8JVqOFP9Ix3rfwSrc=
 github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4/go.mod h1:UYcCCY+0wh+GmUoDOaO63j1sV5lgy7laLAk1XhEiUis=
 github.com/siyuan-note/eventbus v0.0.0-20240114153055-cf4c124ddf6d h1:ZFhIq+gy5w+FJNX3D4yIp5Aj1H/dM0rrkEdRtk3Ia44=

+ 4 - 1
kernel/treenode/node.go

@@ -287,7 +287,10 @@ func NodeStaticContent(node *ast.Node, excludeTypes []string, includeTextMarkATi
 		lastSpace = false
 		return ast.WalkContinue
 	})
-	return strings.TrimSpace(buf.String())
+
+	// 这里不要 trim,否则无法搜索首尾空格
+	// Improve search and replace for spaces https://github.com/siyuan-note/siyuan/issues/10231
+	return buf.String()
 }
 
 func FirstLeafBlock(node *ast.Node) (ret *ast.Node) {