An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Support `Jump to the next block in the parent level` on focus status https://github.com/siyuan-note/siyuan/issues/9527
Daniele54641f2c149
diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.jsonindex 667fbf74d2..c28e6a64fb 100644--- a/app/appearance/langs/en_US.json+++ b/app/appearance/langs/en_US.json@@ -342,7 +342,7 @@"syncConfGuide5": "If the amount of data is large, the first sync will be slow, please wait patiently<br>Do not switch apps and keep the screen bright while the iOS/iPad is syncing","copyPlainText": "Copy plain text","findInDoc": "Match ${y} items in ${x} docs",- "jumpToParentNext": "Jump to the next block in the previous level",+ "jumpToParentNext": "Jump to the next block in the parent level","initRepoKeyTip": "If the key has been initialized on other devices, please use [Import Key] or generate the key with the same passphrase, otherwise the data cannot be synced to the cloud, so be sure to use the same key on all devices","crossKeepLazyLoad": "Cross-page multi-selection needs to select [Keep Loaded Content] in the more menu","keepLazyLoad": "Keep loaded content",diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.jsonindex 7676fcaf71..0c67a444f5 100644--- a/app/appearance/langs/es_ES.json+++ b/app/appearance/langs/es_ES.json@@ -342,7 +342,7 @@"syncConfGuide5": "Si la cantidad de datos es grande, la primera sincronización será lenta, espere pacientemente<br>No cambie de aplicación y mantenga la pantalla brillante mientras iOS/iPad se sincroniza","copyPlainText": "Copiar texto sin formato","findInDoc": "Hacer coincidir ${y} elementos en ${x} documentos",- "jumpToParentNext": "Saltar al siguiente bloque en el nivel anterior",+ "jumpToParentNext": "Saltar al siguiente bloque en el nivel principal","initRepoKeyTip": "Si la clave se ha inicializado en otros dispositivos, use [Importar la clave] o genere la clave con la misma contraseña; de lo contrario, los datos no se pueden sincronizar con la nube, así que asegúrese de usar la misma clave en todos los dispositivos.","crossKeepLazyLoad": "La selección múltiple entre páginas debe seleccionar [Mantener contenido cargado] en el menú más","keepLazyLoad": "Mantener el contenido cargado",diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.jsonindex 7369e140b2..e79f2a488a 100644--- a/app/appearance/langs/fr_FR.json+++ b/app/appearance/langs/fr_FR.json@@ -342,7 +342,7 @@"syncConfGuide5": "Si la quantité de données est importante, la première synchronisation sera lente, veuillez patienter<br> Ne changez pas d'application et gardez l'écran lumineux pendant la synchronisation de l'iOS/iPad","copyPlainText": "Copier du texte brut","findInDoc": "Faire correspondre les éléments ${y} dans les documents ${x}",- "jumpToParentNext": "Aller au bloc suivant du niveau précédent",+ "jumpToParentNext": "Passer au bloc suivant du niveau parent","initRepoKeyTip": "Si la clé a été initialisée sur d'autres appareils, veuillez utiliser [Importer la clé] ou générer la clé avec le même mot de passe, sinon les données ne peuvent pas être synchronisées avec le cloud, alors assurez-vous d'utiliser la même clé sur tous les appareils","crossKeepLazyLoad": "La multi-sélection sur plusieurs pages doit sélectionner [Conserver le contenu chargé] dans le menu plus","keepLazyLoad": "Conserver le contenu chargé",diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.jsonindex 6fa374544c..7309ede3c6 100644--- a/app/appearance/langs/zh_CHT.json+++ b/app/appearance/langs/zh_CHT.json@@ -342,7 +342,7 @@"syncConfGuide5": "如果資料量較大,第一次同步會比較慢,請耐心等待<br>iOS/iPad 端在同步時請勿切換應用並保持螢幕恆亮","copyPlainText": "複製純文字","findInDoc": "${x} 個文檔中匹配 ${y} 項",- "jumpToParentNext": "跳轉到上一層級的下一個塊",+ "jumpToParentNext": "跳轉到父級的下一個塊","initRepoKeyTip": "如果其他設備上已經初始化過密鑰,請使用 [導入密鑰] 或者通過相同的密碼生成密鑰,否則無法雲端同步資料,所以請務必在所有設備上使用相同的密鑰","crossKeepLazyLoad": "跨頁多選需在更多菜單中選中【保持已載入內容】","keepLazyLoad": "保持已載入的內容",diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.jsonindex 3b83dc3f72..1138486a66 100644--- a/app/appearance/langs/zh_CN.json+++ b/app/appearance/langs/zh_CN.json@@ -342,7 +342,7 @@"syncConfGuide5": "如果数据量较大,第一次同步会比较慢,请耐心等待<br>iOS/iPad 端在同步时请勿切换应用并保持亮屏","copyPlainText": "复制纯文本","findInDoc": "${x} 个文档中匹配 ${y} 项",- "jumpToParentNext": "跳转到上一层级的下一个块",+ "jumpToParentNext": "跳转到父级的下一个块","initRepoKeyTip": "如果其他设备上已经初始化过密钥,请使用 [导入密钥] 或者通过相同的密码生成密钥,否则无法云端同步数据,所以请务必在所有设备上使用相同的密钥","crossKeepLazyLoad": "跨页多选需在更多菜单中选中 [保持已加载内容]","keepLazyLoad": "保持已加载的内容",diff --git a/kernel/api/block.go b/kernel/api/block.goindex 90e79b50ae..4ef021bd17 100644--- a/kernel/api/block.go+++ b/kernel/api/block.go@@ -29,6 +29,21 @@ import ("github.com/siyuan-note/siyuan/kernel/util")+func getParentNextChildID(c *gin.Context) {+ ret := gulu.Ret.NewResult()+ defer c.JSON(http.StatusOK, ret)++ arg, ok := util.JsonArg(c, ret)+ if !ok {+ return+ }++ id := arg["id"].(string)+ ret.Data = map[string]string{+ "id": model.GetParentNextChildID(id),+ }+}+func transferBlockRef(c *gin.Context) {ret := gulu.Ret.NewResult()defer c.JSON(http.StatusOK, ret)diff --git a/kernel/api/router.go b/kernel/api/router.goindex e74ef56ac1..8c73771f6e 100644--- a/kernel/api/router.go+++ b/kernel/api/router.go@@ -181,6 +181,7 @@ func ServeAPI(ginServer *gin.Engine) {ginServer.Handle("POST", "/api/block/getHeadingChildrenDOM", model.CheckAuth, getHeadingChildrenDOM)ginServer.Handle("POST", "/api/block/swapBlockRef", model.CheckAuth, model.CheckReadonly, swapBlockRef)ginServer.Handle("POST", "/api/block/transferBlockRef", model.CheckAuth, model.CheckReadonly, transferBlockRef)+ ginServer.Handle("POST", "/api/block/getParentNextChildID", model.CheckAuth, model.CheckReadonly, getParentNextChildID)ginServer.Handle("POST", "/api/file/getFile", model.CheckAuth, getFile)ginServer.Handle("POST", "/api/file/putFile", model.CheckAuth, model.CheckReadonly, putFile)diff --git a/kernel/model/block.go b/kernel/model/block.goindex 4b57815620..46633c04f5 100644--- a/kernel/model/block.go+++ b/kernel/model/block.go@@ -89,6 +89,25 @@ type Path struct {Created string `json:"created"` // 创建时间}+func GetParentNextChildID(id string) string {+ tree, err := loadTreeByBlockID(id)+ if nil != err {+ return ""+ }++ node := treenode.GetNodeInTree(tree, id)+ if nil == node {+ return ""+ }++ for p := node.Parent; nil != p; p = p.Parent {+ if nil != p.Next {+ return p.Next.ID+ }+ }+ return ""+}+func IsBlockFolded(id string) bool {for i := 0; i < 32; i++ {b, _ := getBlock(id, nil)