Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/12109

Vanessa346479a9e8b3
diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts
index 7373d3a698..56ab755885 100644
--- a/app/src/layout/dock/Files.ts
+++ b/app/src/layout/dock/Files.ts
@@ -308,7 +308,8 @@ export class Files extends Model {
app: options.app,
notebookId,
currentPath: pathString,
- useSavePath: false
+ useSavePath: false,
+ pushCreateEvt: true,
});
} else if (type === "more-root") {
initNavigationMenu(options.app, target.parentElement).popup({
diff --git a/app/src/menus/navigation.ts b/app/src/menus/navigation.ts
index ebcb0130d7..95ecd2d6ce 100644
--- a/app/src/menus/navigation.ts
+++ b/app/src/menus/navigation.ts
@@ -458,7 +458,8 @@ export const initFileMenu = (app: App, notebookId: string, pathString: string, l
notebookId,
currentPath: pathPosix().dirname(pathString),
paths,
- useSavePath: false
+ useSavePath: false,
+ pushCreateEvt: true,
});
}
}).element);
@@ -481,7 +482,8 @@ export const initFileMenu = (app: App, notebookId: string, pathString: string, l
notebookId,
currentPath: pathPosix().dirname(pathString),
paths,
- useSavePath: false
+ useSavePath: false,
+ pushCreateEvt: true,
});
}
}).element);
diff --git a/app/src/mobile/dock/MobileFiles.ts b/app/src/mobile/dock/MobileFiles.ts
index 80c8a4b564..9edd5ee377 100644
--- a/app/src/mobile/dock/MobileFiles.ts
+++ b/app/src/mobile/dock/MobileFiles.ts
@@ -205,7 +205,8 @@ export class MobileFiles extends Model {
app,
notebookId,
currentPath: pathString,
- useSavePath: false
+ useSavePath: false,
+ pushCreateEvt: true,
});
} else if (type === "more-root") {
initNavigationMenu(app, target.parentElement);
diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.ts
index 2b010c40ff..1738fd8248 100644
--- a/app/src/util/newFile.ts
+++ b/app/src/util/newFile.ts
@@ -81,6 +81,7 @@ export const newFile = (optios: {
useSavePath: boolean,
name?: string,
afterCB?: (id: string, title: string) => void
+ pushCreateEvt?: boolean
}) => {
if (getOpenNotebookCount() === 0) {
showMessage(window.siyuan.languages.newFileTip);
@@ -102,7 +103,8 @@ export const newFile = (optios: {
notebook: data.data.box,
path: createPath,
// 根目录时无法确定 parentID
- markdown: ""
+ markdown: "",
+ pushCreateEvt: optios.pushCreateEvt
}, response => {
if (optios.afterCB) {
optios.afterCB(response.data, pathPosix().basename(createPath));
@@ -127,7 +129,8 @@ export const newFile = (optios: {
notebook: data.data.box,
path: createPath,
parentID: getDisplayName(optios.currentPath, true, true),
- markdown: ""
+ markdown: "",
+ pushCreateEvt: optios.pushCreateEvt
}, response => {
if (optios.afterCB) {
optios.afterCB(response.data, pathPosix().basename(createPath));
@@ -154,7 +157,8 @@ export const newFile = (optios: {
fetchPost("/api/filetree/createDocWithMd", {
notebook: data.data.box,
path: createPath,
- markdown: ""
+ markdown: "",
+ pushCreateEvt: optios.pushCreateEvt
}, response => {
if (optios.afterCB) {
optios.afterCB(response.data, pathPosix().basename(createPath));
@@ -182,7 +186,8 @@ export const newFile = (optios: {
path: newPath,
title,
md: "",
- sorts: optios.paths
+ sorts: optios.paths,
+ pushCreateEvt: optios.pushCreateEvt
}, () => {
if (optios.afterCB) {
optios.afterCB(id, title);