From 48162b12a63fb9ed3c5893af99a7c68fc4e97373 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 4 Sep 2024 11:49:22 +0800 Subject: [PATCH 1/2] :bug: The sorting of fields in the database attribute panel is unstable https://github.com/siyuan-note/siyuan/issues/12043 --- kernel/model/attribute_view.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 62075a389..9f0c1769b 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -651,7 +651,7 @@ func GetBlockAttributeViewKeys(blockID string) (ret []*BlockAttributeViewKeys) { } // 字段排序 - refreshAttrViewKeyIDs(attrView) + refreshAttrViewKeyIDs(attrView, true) sorts := map[string]int{} for i, k := range attrView.KeyIDs { sorts[k] = i @@ -2533,7 +2533,7 @@ func SortAttributeViewKey(avID, keyID, previousKeyID string) (err error) { return } - refreshAttrViewKeyIDs(attrView) + refreshAttrViewKeyIDs(attrView, false) var currentKeyID string var idx, previousIndex int @@ -2562,7 +2562,7 @@ func SortAttributeViewKey(avID, keyID, previousKeyID string) (err error) { return } -func refreshAttrViewKeyIDs(attrView *av.AttributeView) { +func refreshAttrViewKeyIDs(attrView *av.AttributeView, needSave bool) { // 订正 keyIDs 数据 existKeyIDs := map[string]bool{} @@ -2583,6 +2583,10 @@ func refreshAttrViewKeyIDs(attrView *av.AttributeView) { } } attrView.KeyIDs = tmp + + if needSave { + av.SaveAttributeView(attrView) + } } func (tx *Transaction) doAddAttrViewColumn(operation *Operation) (ret *TxErr) { From e078e0a08655a8d5c2ccdc1c830800806c67c1bb Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 4 Sep 2024 16:58:09 +0800 Subject: [PATCH 2/2] :art: Improve text https://github.com/siyuan-note/siyuan/issues/12236 --- app/appearance/langs/en_US.json | 1 + app/appearance/langs/es_ES.json | 3 ++- app/appearance/langs/fr_FR.json | 3 ++- app/appearance/langs/ja_JP.json | 1 + app/appearance/langs/zh_CHT.json | 3 ++- app/appearance/langs/zh_CN.json | 3 ++- app/src/ai/chat.ts | 2 +- app/src/mobile/util/keyboardToolbar.ts | 2 +- app/src/protyle/hint/extend.ts | 4 ++-- 9 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index edb0a8579..b94572ec5 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -375,6 +375,7 @@ "aiBrainStorm": "Brainstorm", "aiFixGrammarSpell": "Fix grammar, spelling and typos", "aiCustomAction": "Custom action...", + "aiWriting": "AI writing", "database": "Database", "manage": "Manage", "spaceRepetition": "Spaced Repetition", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index bdd9e93e1..3646eed20 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -135,7 +135,7 @@ "unchecked": "desmarcado", "percentChecked": "Porcentaje comprobado", "percentUnchecked": "Porcentaje no marcado", - "checkbox": "Casilla de verificación", + "checkbox": "Caja", "unsplit": "Desdividir", "unsplitAll": "Desdividir Todo", "resetCardTip": "¿Estás seguro de restablecer ${x} tarjetas?", @@ -375,6 +375,7 @@ "aiBrainStorm": "Lluvia de ideas", "aiFixGrammarSpell": "Corregir gramática, ortografía y errores tipográficos.", "aiCustomAction": "Acción personalizada...", + "aiWriting": "Escritura de IA", "database": "Base de datos", "manage": "Administrar", "spaceRepetition": "Repetición Espaciada", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 36ca9b5b6..e9c028a7a 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -135,7 +135,7 @@ "unchecked": "Décoché", "percentChecked": "Pourcentage vérifié", "percentUnchecked": "Pourcentage non coché", - "checkbox": "case à cocher", + "checkbox": "Case à cocher", "unsplit": "Unsplit", "unsplitAll": "Tout dédiviser", "resetCardTip": "Êtes-vous sûr de réinitialiser ${x} flashcards ?", @@ -375,6 +375,7 @@ "aiBrainStorm": "Remue-méninges", "aiFixGrammarSpell": "Correction de la grammaire, de l'orthographe et des fautes de frappe", "aiCustomAction": "Action personnalisée...", + "aiWriting": "Écriture de l'IA", "database": "Base de données", "manage": "Gérer", "spaceRepetition": "Répétition espacée", diff --git a/app/appearance/langs/ja_JP.json b/app/appearance/langs/ja_JP.json index ba338697e..b40d9ed1b 100644 --- a/app/appearance/langs/ja_JP.json +++ b/app/appearance/langs/ja_JP.json @@ -375,6 +375,7 @@ "aiBrainStorm": "ブレインストーミング", "aiFixGrammarSpell": "文法、スペル、誤字の修正", "aiCustomAction": "カスタムアクション...", + "aiWriting": "AIライティング", "database": "データベース", "manage": "管理", "spaceRepetition": "復習", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index a264cd55c..9c09e5084 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -135,7 +135,7 @@ "unchecked": "未完成", "percentChecked": "已完成佔比", "percentUnchecked": "未完成佔比", - "checkbox": "勾選方塊", + "checkbox": "複選框", "unsplit": "取消分割畫面", "unsplitAll": "取消全部分螢幕", "resetCardTip": "確定重設 ${x} 張閃卡?", @@ -375,6 +375,7 @@ "aiBrainStorm": "頭腦風暴", "aiFixGrammarSpell": "修正語法、拼寫和錯別字", "aiCustomAction": "自定義操作...", + "aiWriting": "AI 編寫", "database": "數據庫", "manage": "管理", "spaceRepetition": "間隔重複", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index 31d9807a1..dc9e03cf0 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -135,7 +135,7 @@ "unchecked": "未完成", "percentChecked": "已完成占比", "percentUnchecked": "未完成占比", - "checkbox": "勾选框", + "checkbox": "复选框", "unsplit": "取消分屏", "unsplitAll": "取消全部分屏", "resetCardTip": "确定重置 ${x} 张闪卡?", @@ -375,6 +375,7 @@ "aiBrainStorm": "头脑风暴", "aiFixGrammarSpell": "修正语法、拼写和错别字", "aiCustomAction": "自定义操作...", + "aiWriting": "AI 编写", "database": "数据库", "manage": "管理", "spaceRepetition": "间隔重复", diff --git a/app/src/ai/chat.ts b/app/src/ai/chat.ts index a2cd79345..d5ef80d2a 100644 --- a/app/src/ai/chat.ts +++ b/app/src/ai/chat.ts @@ -5,7 +5,7 @@ import {fillContent} from "./actions"; export const AIChat = (protyle: IProtyle, element: Element) => { const dialog = new Dialog({ - title: "AI Chat", + title: "✨ " + window.siyuan.languages.aiWriting, content: `