From 193993d11095744c183fa361797a3d897a44d780 Mon Sep 17 00:00:00 2001
From: Jeffrey Chen <78434827+TCOTC@users.noreply.github.com>
Date: Wed, 3 Apr 2024 20:40:30 +0800
Subject: [PATCH 1/4] =?UTF-8?q?[i18n]=20=E5=B0=86=E3=80=8C=E6=A0=BC?=
=?UTF-8?q?=E5=BC=8F=E5=8C=96=E3=80=8D=E6=94=B9=E4=B8=BA=E3=80=8C=E6=8E=92?=
=?UTF-8?q?=E7=89=88=E3=80=8D=20(#10859)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/appearance/langs/zh_CHT.json | 14 +++++++-------
app/appearance/langs/zh_CN.json | 14 +++++++-------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json
index 9fc0d5fd2..3b987573b 100644
--- a/app/appearance/langs/zh_CHT.json
+++ b/app/appearance/langs/zh_CHT.json
@@ -437,13 +437,13 @@
"downloaded": "已下載",
"allOp": "所有操作",
"allNotebooks": "所有筆記本",
- "historyClean": "清理 (clean)",
- "historyUpdate": "更新 (update)",
- "historyDelete": "刪除 (delete)",
- "historyFormat": "格式化 (format)",
- "historySync": "同步 (sync)",
- "historyReplace": "替換 (replace)",
- "historyOutline": "大綱 (outline)",
+ "historyClean": "清理 (clean)",
+ "historyUpdate": "更新 (update)",
+ "historyDelete": "刪除 (delete)",
+ "historyFormat": "排版 (format)",
+ "historySync": "同步 (sync)",
+ "historyReplace": "替換 (replace)",
+ "historyOutline": "大綱 (outline)",
"htmlBlockError": "以下 script 執行會影響界面顯示,已經停止運行該腳本",
"fileHistory": "文件歷史",
"htmlBlockTip": "形成了多個 HTML 塊,為防止資料丟失請使用 <div> 標籤包裹並去掉空行",
diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json
index 198da0c61..b65bcba0b 100644
--- a/app/appearance/langs/zh_CN.json
+++ b/app/appearance/langs/zh_CN.json
@@ -437,13 +437,13 @@
"downloaded": "已下载",
"allOp": "所有操作",
"allNotebooks": "所有笔记本",
- "historyClean": "清理 (clean)",
- "historyUpdate": "更新 (update)",
- "historyDelete": "删除 (delete)",
- "historyFormat": "格式化 (format)",
- "historySync": "同步 (sync)",
- "historyReplace": "替换 (replace)",
- "historyOutline": "大纲 (outline)",
+ "historyClean": "清理 (clean)",
+ "historyUpdate": "更新 (update)",
+ "historyDelete": "删除 (delete)",
+ "historyFormat": "排版 (format)",
+ "historySync": "同步 (sync)",
+ "historyReplace": "替换 (replace)",
+ "historyOutline": "大纲 (outline)",
"htmlBlockError": "以下 script 执行会影响界面显示,已经停止运行该脚本",
"fileHistory": "文件历史",
"htmlBlockTip": "形成了多个 HTML 块,为防止数据丢失请使用 <div> 标签包裹并去掉空行",
From be67ffa288afe7066f2e6b6db6702b6db15c807f Mon Sep 17 00:00:00 2001
From: Daniel <845765@qq.com>
Date: Wed, 3 Apr 2024 21:17:54 +0800
Subject: [PATCH 2/4] :art: Auto verify the database name when clicking the
block superscript icon https://github.com/siyuan-note/siyuan/issues/10861
---
kernel/model/attribute_view.go | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index ffd62d553..e99d1bdcb 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -289,6 +289,13 @@ func GetBlockAttributeViewKeys(blockID string) (ret []*BlockAttributeViewKeys) {
return
}
+ if !attrView.ExistBlock(blockID) {
+ // 比如剪切后粘贴,块 ID 会变,但是属性还在块上,这里做一次数据订正
+ // Auto verify the database name when clicking the block superscript icon https://github.com/siyuan-note/siyuan/issues/10861
+ unbindBlockAv(nil, avID, blockID)
+ return
+ }
+
var keyValues []*av.KeyValues
for _, kv := range attrView.KeyValues {
kValues := &av.KeyValues{Key: kv.Key}
From 16dd27d6561988e1543fcce466345ab964082991 Mon Sep 17 00:00:00 2001
From: Daniel <845765@qq.com>
Date: Wed, 3 Apr 2024 21:18:45 +0800
Subject: [PATCH 3/4] :art: Remove legacy incorrect history data
---
kernel/model/conf.go | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/model/conf.go b/kernel/model/conf.go
index c2cac4b80..a7a6fb1bc 100644
--- a/kernel/model/conf.go
+++ b/kernel/model/conf.go
@@ -986,6 +986,7 @@ func clearWorkspaceTemp() {
os.RemoveAll(filepath.Join(util.DataDir, ".siyuan", "history"))
os.RemoveAll(filepath.Join(util.WorkspaceDir, "backup"))
os.RemoveAll(filepath.Join(util.WorkspaceDir, "sync"))
+ os.RemoveAll(filepath.Join(util.DataDir, "%")) // v3.0.6 生成的错误历史文件夹
logging.LogInfof("cleared workspace temp")
}
From 24363ad7171bbe54ed910de9824ea018a3ebd4c9 Mon Sep 17 00:00:00 2001
From: Daniel <845765@qq.com>
Date: Wed, 3 Apr 2024 21:33:53 +0800
Subject: [PATCH 4/4] :art: Refresh the corresponding rollup after deleting
rows from the database https://github.com/siyuan-note/siyuan/issues/10858
---
kernel/av/relation.go | 3 +++
kernel/model/attribute_view.go | 5 +++++
2 files changed, 8 insertions(+)
diff --git a/kernel/av/relation.go b/kernel/av/relation.go
index 28a4eb1f3..7d6ccdab9 100644
--- a/kernel/av/relation.go
+++ b/kernel/av/relation.go
@@ -41,6 +41,9 @@ func GetSrcAvIDs(destAvID string) []string {
if nil == srcAvIDs {
return nil
}
+
+ // 排除自己
+ srcAvIDs = gulu.Str.RemoveElem(srcAvIDs, destAvID)
return srcAvIDs
}
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index e99d1bdcb..ce9fa5b1f 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -2186,6 +2186,11 @@ func removeAttributeViewBlock(srcIDs []string, avID string, tx *Transaction) (er
}
}
+ relatedAvIDs := av.GetSrcAvIDs(avID)
+ for _, relatedAvID := range relatedAvIDs {
+ util.BroadcastByType("protyle", "refreshAttributeView", 0, "", map[string]interface{}{"id": relatedAvID})
+ }
+
err = av.SaveAttributeView(attrView)
return
}