Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Add notebook document open menu https://github.com/siyuan-note/siyuan/issues/18266

Daniel0f91b0f2c129
diff --git a/app/src/menus/navigation.ts b/app/src/menus/navigation.ts
index ccf025bdb7..46a672f2b9 100644
--- a/app/src/menus/navigation.ts
+++ b/app/src/menus/navigation.ts
@@ -222,6 +222,23 @@ export const initNavigationMenu = (app: App, liElement: HTMLElement) => {
window.siyuan.menus.menu.element.setAttribute("data-from", Constants.MENU_FROM_DOC_TREE_MORE_NOTEBOOK);
const notebookId = liElement.parentElement.getAttribute("data-url");
const name = getNotebookName(notebookId);
+ /// #if !MOBILE
+ const boxDocID = liElement.getAttribute("data-node-id");
+ if (boxDocID && window.siyuan.config.fileTree.parentDocClickExpand) {
+ window.siyuan.menus.menu.append(new MenuItem({
+ id: "openDocument",
+ label: window.siyuan.languages.openDocument,
+ icon: "iconOpen",
+ click: () => {
+ openFileById({
+ app,
+ id: boxDocID,
+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL],
+ });
+ }
+ }).element);
+ }
+ /// #endif
if (!window.siyuan.config.readonly) {
window.siyuan.menus.menu.append(renameMenu({
path: "/",