diff --git a/app/appearance/langs/de_DE.json b/app/appearance/langs/de_DE.json index 67b24984d..1eddcfb06 100644 --- a/app/appearance/langs/de_DE.json +++ b/app/appearance/langs/de_DE.json @@ -1,4 +1,6 @@ { + "backlinkContainChildren": "Enthalten Rückverweise untergeordnete Blöcke", + "backlinkContainChildrenTip": "Wenn aktiviert, werden untergeordnete Blöcke in die Berechnung der Rückverweise einbezogen", "entryNum": "Anzahl der Einträge", "workspaceData": "Arbeitsbereichsdaten", "confirmRemoveRelationField": "Sind Sie sicher, dass Sie das Feld, das mit ${x} verknüpft ist, löschen möchten?", diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index 58608e0fb..570217c9f 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -1,4 +1,6 @@ { + "backlinkContainChildren": "Do backlinks contain child blocks", + "backlinkContainChildrenTip": "When enabled, child blocks will be included in the backlink calculation", "entryNum": "Number of entries", "workspaceData": "Workspace data", "confirmRemoveRelationField": "Are you sure you want to delete the field associated with ${x}?", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index e7d7b939d..426978c5e 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -1,4 +1,6 @@ { + "backlinkContainChildren": "¿Los enlaces inversos contienen bloques secundarios?", + "backlinkContainChildrenTip": "Una vez habilitado, los bloques secundarios se incluirán en el cálculo de los enlaces inversos", "entryNum": "Número de entradas", "workspaceData": "Datos del espacio de trabajo", "confirmRemoveRelationField": "¿Está seguro de que desea eliminar el campo asociado a ${x}?", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index e4aff93eb..c45c36891 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -1,4 +1,6 @@ { + "backlinkContainChildren": "Les liens retour contiennent-ils des sous-blocs", + "backlinkContainChildrenTip": "Une fois activé, les sous-blocs seront inclus dans le calcul des liens retour", "entryNum": "Nombre d'entrées", "workspaceData": "Données de l'espace de travail", "confirmRemoveRelationField": "Êtes-vous sûr de vouloir supprimer le champ associé à ${x}?", diff --git a/app/appearance/langs/he_IL.json b/app/appearance/langs/he_IL.json index 5aac13d94..b5e218ff5 100644 --- a/app/appearance/langs/he_IL.json +++ b/app/appearance/langs/he_IL.json @@ -1,4 +1,6 @@ { + "backlinkContainChildren": "האם קישורים חוזרים כוללים בלוקים משניים", + "backlinkContainChildrenTip": "לאחר ההפעלה, בלוקים משניים ייכללו בחישוב הקישורים החוזרים", "entryNum": "מספר ערכים", "workspaceData": "נתוני סביבת עבודה", "confirmRemoveRelationField": "האם אתה בטוח שברצונך למחוק את השדה המשויך ל-${x}?", diff --git a/app/appearance/langs/it_IT.json b/app/appearance/langs/it_IT.json index efbc4bfd7..b841cf6c9 100644 --- a/app/appearance/langs/it_IT.json +++ b/app/appearance/langs/it_IT.json @@ -1,4 +1,6 @@ { + "backlinkContainChildren": "I backlink contengono blocchi figli", + "backlinkContainChildrenTip": "Dopo l'attivazione, i blocchi figli saranno inclusi nel calcolo dei backlink", "entryNum": "Numero di voci", "workspaceData": "Dati dello spazio di lavoro", "confirmRemoveRelationField": "Sei sicuro di voler eliminare il campo associato a ${x}?", diff --git a/app/appearance/langs/ja_JP.json b/app/appearance/langs/ja_JP.json index 35bea10f4..9f4ea7767 100644 --- a/app/appearance/langs/ja_JP.json +++ b/app/appearance/langs/ja_JP.json @@ -1,4 +1,6 @@ { + "backlinkContainChildren": "バックリンクに子ブロックを含めるかどうか", + "backlinkContainChildrenTip": "有効にすると、子ブロックがバックリンク計算に含まれます", "entryNum": "エントリ数", "workspaceData": "ワークスペースデータ", "confirmRemoveRelationField": "${x} に関連するフィールドを同時に削除してもよろしいですか?", diff --git a/app/appearance/langs/pl_PL.json b/app/appearance/langs/pl_PL.json index b9689c6b1..23213ee0b 100644 --- a/app/appearance/langs/pl_PL.json +++ b/app/appearance/langs/pl_PL.json @@ -1,4 +1,6 @@ { + "backlinkContainChildren": "Czy linki zwrotne zawierają bloki podrzędne", + "backlinkContainChildrenTip": "Po włączeniu bloki podrzędne zostaną uwzględnione w obliczeniach linków zwrotnych", "entryNum": "Количество записей", "workspaceData": "Dane przestrzeni roboczej", "confirmRemoveRelationField": "Czy na pewno chcesz usunąć pole powiązane z ${x}?", diff --git a/app/appearance/langs/ru_RU.json b/app/appearance/langs/ru_RU.json index d36786f7f..82e62035d 100644 --- a/app/appearance/langs/ru_RU.json +++ b/app/appearance/langs/ru_RU.json @@ -1,4 +1,6 @@ { + "backlinkContainChildren": "Включать ли дочерние блоки в обратные ссылки", + "backlinkContainChildrenTip": "После включения дочерние блоки будут включены в расчет обратных ссылок", "entryNum": "Количество записей", "workspaceData": "Данные рабочей области", "confirmRemoveRelationField": "Вы уверены, что хотите удалить поле, связанное с ${x}?", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index 33697abd5..041315fe7 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -1,4 +1,6 @@ { + "backlinkContainChildren": "反向鏈接包含子塊", + "backlinkContainChildrenTip": "啟用後子塊將被納入到反向鏈接計算中", "entryNum": "條目數", "workspaceData": "工作空間數據", "confirmRemoveRelationField": "確定同時刪除關聯至 ${x} 中的字段嗎?", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index c5c400350..d8884343f 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -1,4 +1,6 @@ { + "backlinkContainChildren": "反向链接包含子块", + "backlinkContainChildrenTip": "启用后子块将被纳入到反向链接计算中", "entryNum": "条目数", "workspaceData": "工作空间数据", "confirmRemoveRelationField": "确定同时删除关联至 ${x} 中的字段吗?", diff --git a/app/changelogs/v3.1.10/v3.1.10.md b/app/changelogs/v3.1.10/v3.1.10.md index 42e7652f3..10df390eb 100644 --- a/app/changelogs/v3.1.10/v3.1.10.md +++ b/app/changelogs/v3.1.10/v3.1.10.md @@ -2,7 +2,7 @@ This version improves database performance and user interface details. -In addition, we have also improved the backlink panel logic and no longer include sub-blocks in the calculation, which helps to display backlinks more accurately. +In addition, we have also improved the backlink panel details to support excluding child-blocks from backlink calculations, which helps to display backlinks more accurately. ## Changelogs @@ -13,6 +13,7 @@ Below are the detailed changes in this version. * [Improve interaction when deleting two-way relation field in a database](https://github.com/siyuan-note/siyuan/issues/11252) * [Improve plugin dock position persistence](https://github.com/siyuan-note/siyuan/issues/11931) * [Supports disabling Markdown `~~` syntax input](https://github.com/siyuan-note/siyuan/issues/12641) +* [Improve database paging loading](https://github.com/siyuan-note/siyuan/issues/12780) * [WebDAV/S3 data sync and backup support configurable concurrent requests](https://github.com/siyuan-note/siyuan/issues/12798) * [Improve the logic of multiple selected blocks forming a super block](https://github.com/siyuan-note/siyuan/issues/12809) * [Browser clipping extension sends no more scrolling pages](https://github.com/siyuan-note/siyuan/issues/12817) @@ -22,8 +23,9 @@ Below are the detailed changes in this version. * [Improve database relation & rollup field loading performance](https://github.com/siyuan-note/siyuan/issues/12835) * [Improve user interface](https://github.com/siyuan-note/siyuan/issues/12848) * [Refresh doc tree after data sync](https://github.com/siyuan-note/siyuan/issues/12860) -* [The backlink panel no longer displays child-block references](https://github.com/siyuan-note/siyuan/issues/12861) +* [Support child-blocks not being included in the backlink calculation](https://github.com/siyuan-note/siyuan/issues/12861) * [The backlink panel no longer displays breadcrumbs of the first-level blocks](https://github.com/siyuan-note/siyuan/issues/12862) +* [Improve custom emojis at the beginning of the block](https://github.com/siyuan-note/siyuan/issues/12868) ### Bugfix diff --git a/app/changelogs/v3.1.10/v3.1.10_zh_CHT.md b/app/changelogs/v3.1.10/v3.1.10_zh_CHT.md index dd0f3b05e..a99c416d6 100644 --- a/app/changelogs/v3.1.10/v3.1.10_zh_CHT.md +++ b/app/changelogs/v3.1.10/v3.1.10_zh_CHT.md @@ -2,7 +2,7 @@ 此版本改進了資料庫效能和使用者介面細節。 -另外,我們也改進了反鏈面板邏輯,不再將子塊納入計算,這有助於更精確地顯示反鏈。 +另外,我們也改進了反鏈面板細節,支援子區塊不納入反鏈計算,這有助於更精確地顯示反鏈。 ## 變更記錄 @@ -13,6 +13,7 @@ * [改進刪除資料庫中雙向關聯欄位時的互動](https://github.com/siyuan-note/siyuan/issues/11252) * [改進插件停靠列位置的持久化](https://github.com/siyuan-note/siyuan/issues/11931) * [支援禁用 Markdown `~~` 語法輸入](https://github.com/siyuan-note/siyuan/issues/12641) +* [改進資料庫分頁載入](https://github.com/siyuan-note/siyuan/issues/12780) * [WebDAV/S3 資料同步與備份支援設定並發請求數](https://github.com/siyuan-note/siyuan/issues/12798) * [改進多選塊形成超級塊的邏輯](https://github.com/siyuan-note/siyuan/issues/12809) * [瀏覽器剪藏擴充功能不再需要捲動頁面](https://github.com/siyuan-note/siyuan/issues/12817) @@ -22,8 +23,9 @@ * [改進資料庫關聯和匯總欄位載入效能](https://github.com/siyuan-note/siyuan/issues/12835) * [改進使用者介面](https://github.com/siyuan-note/siyuan/issues/12848) * [資料同步後刷新文件樹](https://github.com/siyuan-note/siyuan/issues/12860) -* [反向連結面板不再顯示子塊引用](https://github.com/siyuan-note/siyuan/issues/12861) +* [支援子區塊不納入反鏈計算](https://github.com/siyuan-note/siyuan/issues/12861) * [反向連結面板不再顯示一一級塊的麵包屑](https://github.com/siyuan-note/siyuan/issues/12862) +* [改進區塊開始處的自訂表情](https://github.com/siyuan-note/siyuan/issues/12868) ### 修復缺陷 @@ -36,4 +38,4 @@ ## 下載 * [B3log](https://b3log.org/siyuan/download.html) -* [GitHub](https://github.com/siyuan-note/siyuan/releases) +* [GitHub](https://github.com/siyuan-note/siyuan/releases) \ No newline at end of file diff --git a/app/changelogs/v3.1.10/v3.1.10_zh_CN.md b/app/changelogs/v3.1.10/v3.1.10_zh_CN.md index b1c731a47..92f6a7439 100644 --- a/app/changelogs/v3.1.10/v3.1.10_zh_CN.md +++ b/app/changelogs/v3.1.10/v3.1.10_zh_CN.md @@ -2,7 +2,7 @@ 该版本改进了数据库性能和用户界面细节。 -另外,我们也改进了反链面板逻辑,不再将子块纳入计算,这有助于更加精确地显示反链。 +另外,我们也改进了反链面板细节,支持子块不纳入反链计算,这有助于更加精确地显示反链。 ## 变更记录 @@ -13,6 +13,7 @@ * [改进删除数据库中双向关联字段时的交互](https://github.com/siyuan-note/siyuan/issues/11252) * [改进插件停靠栏位置的持久化](https://github.com/siyuan-note/siyuan/issues/11931) * [支持禁用 Markdown `~~` 语法输入](https://github.com/siyuan-note/siyuan/issues/12641) +* [改进数据库分页加载](https://github.com/siyuan-note/siyuan/issues/12780) * [WebDAV/S3 数据同步和备份支持配置并发请求数](https://github.com/siyuan-note/siyuan/issues/12798) * [改进多选块形成超级块的逻辑](https://github.com/siyuan-note/siyuan/issues/12809) * [浏览器剪藏扩展不再需要滚动页面](https://github.com/siyuan-note/siyuan/issues/12817) @@ -22,8 +23,9 @@ * [改进数据库关联和汇总字段加载性能](https://github.com/siyuan-note/siyuan/issues/12835) * [改进用户界面](https://github.com/siyuan-note/siyuan/issues/12848) * [数据同步后刷新文档树](https://github.com/siyuan-note/siyuan/issues/12860) -* [反向链接面板不再显示子块引用](https://github.com/siyuan-note/siyuan/issues/12861) +* [支持子块不纳入反链计算](https://github.com/siyuan-note/siyuan/issues/12861) * [反向链接面板不再显示一级块的面包屑](https://github.com/siyuan-note/siyuan/issues/12862) +* [改进块开始处的自定义表情](https://github.com/siyuan-note/siyuan/issues/12868) ### 修复缺陷 diff --git a/app/src/config/editor.ts b/app/src/config/editor.ts index 5c526f81e..7208d34e1 100644 --- a/app/src/config/editor.ts +++ b/app/src/config/editor.ts @@ -191,6 +191,14 @@ export const editor = { +
${window.siyuan.languages.generateHistory} @@ -386,6 +394,7 @@ export const editor = { blockRefDynamicAnchorTextMaxLen: parseInt((editor.element.querySelector("#blockRefDynamicAnchorTextMaxLen") as HTMLInputElement).value), backlinkExpandCount: parseInt((editor.element.querySelector("#backlinkExpandCount") as HTMLInputElement).value), backmentionExpandCount: parseInt((editor.element.querySelector("#backmentionExpandCount") as HTMLInputElement).value), + backlinkContainChildren: (editor.element.querySelector("#backlinkContainChildren") as HTMLInputElement).checked, dynamicLoadBlocks: dynamicLoadBlocks, codeLigatures: (editor.element.querySelector("#codeLigatures") as HTMLInputElement).checked, codeTabSpaces: parseInt((editor.element.querySelector("#codeTabSpaces") as HTMLInputElement).value), diff --git a/app/src/config/search.ts b/app/src/config/search.ts index 8d3ffd658..23e894875 100644 --- a/app/src/config/search.ts +++ b/app/src/config/search.ts @@ -24,8 +24,9 @@ export const initConfigSearch = (element: HTMLElement, app: App) => { "onlySearchForDoc", "onlySearchForDocTip", "dynamicLoadBlocks", "dynamicLoadBlocksTip", "fontSizeScrollZoom", "fontSizeScrollZoomTip", "listItemDotNumberClickFocus", "listItemDotNumberClickFocusTip", "editorMarkdownInlineAsterisk", "editorMarkdownInlineUnderscore", "editorMarkdownInlineSup", "editorMarkdownInlineSupTip", "editorMarkdownInlineSub", "editorMarkdownInlineSubTip", - "editorMarkdownInlineTag", "editorMarkdownInlineTagTip", "editorMarkdownInlineMath", "editorMarkdownInlineMathTip", - "allowHTMLBLockScript", "allowHTMLBLockScriptTip", + "editorMarkdownInlineTag", "editorMarkdownInlineTagTip", "editorMarkdownInlineMath", "editorMarkdownInlineMathTip", "editorMarkdownInlineStrikethrough", "editorMarkdownInlineStrikethroughTip", + "allowHTMLBLockScript", "allowHTMLBLockScriptTip", "backlinkExpandCount", "backlinkExpandTip", "backmentionExpandCount", "backmentionExpandTip", + "backlinkContainChildren", "backlinkContainChildrenTip" ]), // 文档树 diff --git a/app/src/layout/dock/Backlink.ts b/app/src/layout/dock/Backlink.ts index 9590fccf1..08f316b7f 100644 --- a/app/src/layout/dock/Backlink.ts +++ b/app/src/layout/dock/Backlink.ts @@ -437,7 +437,6 @@ export class Backlink extends Model { defID: this.blockId, refTreeID: docId, keyword: isMention ? this.inputsElement[1].value : this.inputsElement[0].value, - containChildren: false }, (response) => { svgElement.removeAttribute("disabled"); svgElement.classList.add("b3-list-item__arrow--open"); diff --git a/app/src/mobile/settings/editor.ts b/app/src/mobile/settings/editor.ts index 1db63aa33..32e56c654 100644 --- a/app/src/mobile/settings/editor.ts +++ b/app/src/mobile/settings/editor.ts @@ -45,6 +45,7 @@ const setEditor = (modelMainElement: Element) => { window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen = parseInt((modelMainElement.querySelector("#blockRefDynamicAnchorTextMaxLen") as HTMLInputElement).value); window.siyuan.config.editor.backlinkExpandCount = parseInt((modelMainElement.querySelector("#backlinkExpandCount") as HTMLInputElement).value); window.siyuan.config.editor.backmentionExpandCount = parseInt((modelMainElement.querySelector("#backmentionExpandCount") as HTMLInputElement).value); + window.siyuan.config.editor.backlinkContainChildren = (modelMainElement.querySelector("#backlinkContainChildren") as HTMLInputElement).checked; window.siyuan.config.editor.codeLigatures = (modelMainElement.querySelector("#codeLigatures") as HTMLInputElement).checked; window.siyuan.config.editor.codeTabSpaces = parseInt((modelMainElement.querySelector("#codeTabSpaces") as HTMLInputElement).value); window.siyuan.config.editor.fontSize = parseInt((modelMainElement.querySelector("#fontSize") as HTMLInputElement).value); @@ -220,6 +221,14 @@ export const initEditor = () => {
${window.siyuan.languages.backmentionExpandTip}
+
${window.siyuan.languages.generateHistory} diff --git a/app/src/protyle/util/reload.ts b/app/src/protyle/util/reload.ts index 47b699a61..b39fd91a4 100644 --- a/app/src/protyle/util/reload.ts +++ b/app/src/protyle/util/reload.ts @@ -44,7 +44,6 @@ export const reloadProtyle = (protyle: IProtyle, focus: boolean, updateReadonly? defID: protyle.element.getAttribute("data-defid"), refTreeID: protyle.block.rootID, keyword: isMention ? inputsElement[1].value : inputsElement[0].value, - containChildren: false }, response => { protyle.options.backlinkData = isMention ? response.data.backmentions : response.data.backlinks; renderBacklink(protyle, protyle.options.backlinkData); diff --git a/app/src/types/config.d.ts b/app/src/types/config.d.ts index 14c34d48b..9bebba93f 100644 --- a/app/src/types/config.d.ts +++ b/app/src/types/config.d.ts @@ -341,6 +341,10 @@ declare namespace Config { * The default number of backlinks to mention */ backmentionExpandCount: number; + /** + * Whether the backlink contains children + */ + backlinkContainChildren: boolean; /** * The maximum length of the dynamic anchor text for block references */ diff --git a/kernel/api/ref.go b/kernel/api/ref.go index 24939b7e9..a912ce561 100644 --- a/kernel/api/ref.go +++ b/kernel/api/ref.go @@ -51,7 +51,7 @@ func getBackmentionDoc(c *gin.Context) { defID := arg["defID"].(string) refTreeID := arg["refTreeID"].(string) keyword := arg["keyword"].(string) - containChildren := false + containChildren := model.Conf.Editor.BacklinkContainChildren if val, ok := arg["containChildren"]; ok { containChildren = val.(bool) } @@ -73,7 +73,7 @@ func getBacklinkDoc(c *gin.Context) { defID := arg["defID"].(string) refTreeID := arg["refTreeID"].(string) keyword := arg["keyword"].(string) - containChildren := false + containChildren := model.Conf.Editor.BacklinkContainChildren if val, ok := arg["containChildren"]; ok { containChildren = val.(bool) } @@ -109,7 +109,7 @@ func getBacklink2(c *gin.Context) { if nil != mentionSortArg { mentionSort, _ = strconv.Atoi(mentionSortArg.(string)) } - containChildren := false + containChildren := model.Conf.Editor.BacklinkContainChildren if val, ok := arg["containChildren"]; ok { containChildren = val.(bool) } @@ -145,7 +145,7 @@ func getBacklink(c *gin.Context) { if nil != arg["beforeLen"] { beforeLen = int(arg["beforeLen"].(float64)) } - containChildren := false + containChildren := model.Conf.Editor.BacklinkContainChildren if val, ok := arg["containChildren"]; ok { containChildren = val.(bool) } diff --git a/kernel/conf/editor.go b/kernel/conf/editor.go index 71a567966..607a0e912 100644 --- a/kernel/conf/editor.go +++ b/kernel/conf/editor.go @@ -51,6 +51,7 @@ type Editor struct { OnlySearchForDoc bool `json:"onlySearchForDoc"` // 是否启用 [[ 仅搜索文档块 BacklinkExpandCount int `json:"backlinkExpandCount"` // 反向链接默认展开数量 BackmentionExpandCount int `json:"backmentionExpandCount"` // 反链提及默认展开数量 + BacklinkContainChildren bool `json:"backlinkContainChildren"` // 反向链接是否包含子块进行计算 Markdown *util.Markdown `json:"markdown"` // Markdown 配置 } @@ -86,6 +87,7 @@ func NewEditor() *Editor { RTL: false, BacklinkExpandCount: 8, BackmentionExpandCount: -1, + BacklinkContainChildren: false, Markdown: util.MarkdownSettings, } } diff --git a/kernel/model/backlink.go b/kernel/model/backlink.go index 9d8af1af3..461294716 100644 --- a/kernel/model/backlink.go +++ b/kernel/model/backlink.go @@ -96,7 +96,9 @@ func GetBackmentionDoc(defID, refTreeID, keyword string, containChildren bool) ( trees := filesys.LoadTrees(mentionBlockIDs) for id, tree := range trees { backlink := buildBacklink(id, tree, mentionKeywords, luteEngine) - ret = append(ret, backlink) + if nil != backlink { + ret = append(ret, backlink) + } } return } @@ -133,7 +135,9 @@ func GetBacklinkDoc(defID, refTreeID, keyword string, containChildren bool) (ret keywords = append(keywords, keyword) } backlink := buildBacklink(linkRef.ID, refTree, keywords, luteEngine) - ret = append(ret, backlink) + if nil != backlink { + ret = append(ret, backlink) + } } return }