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:
Vanessad214aad78ef5
diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.tsindex 87b12e4de3..30749eb948 100644--- a/app/src/util/newFile.ts+++ b/app/src/util/newFile.ts@@ -22,7 +22,11 @@ export const newFile = (notebookId?: string, currentPath?: string, paths?: strinconst currentElement = item.parent.headElement;if (currentElement.classList.contains("item--focus")) {notebookId = item.editor.protyle.notebookId;- currentPath = pathPosix().dirname(item.editor.protyle.path);+ if (useSavePath) {+ currentPath = item.editor.protyle.path;+ } else {+ currentPath = pathPosix().dirname(item.editor.protyle.path);+ }if (hasClosestByClassName(currentElement, "layout__wnd--active")) {return true;}@@ -38,7 +42,11 @@ export const newFile = (notebookId?: string, currentPath?: string, paths?: strinnotebookId = topElement.getAttribute("data-url");}const selectPath = currentElement.getAttribute("data-path");- currentPath = pathPosix().dirname(selectPath);+ if (useSavePath) {+ currentPath = selectPath;+ } else {+ currentPath = pathPosix().dirname(selectPath);+ }}}}@@ -55,7 +63,7 @@ export const newFile = (notebookId?: string, currentPath?: string, paths?: strin}fetchPost("/api/filetree/getDocCreateSavePath", {notebook: notebookId}, (data) => {if (data.data.path.indexOf("/") > -1 && useSavePath) {- if (data.data.path.startsWith("/")) {+ if (data.data.path.startsWith("/") || currentPath === "/") {fetchPost("/api/filetree/createDocWithMd", {notebook: notebookId,path: data.data.path,