An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:sparkles: fix https://github.com/siyuan-note/siyuan/issues/6053
Vanessa4f9c1cb5269f
diff --git a/app/src/editor/rename.ts b/app/src/editor/rename.tsindex 928fd3b025..b97ab73318 100644--- a/app/src/editor/rename.ts+++ b/app/src/editor/rename.ts@@ -161,14 +161,14 @@ export const newFileContentBySelect = (protyle: IProtyle) => {};export const newFileBySelect = (fileName: string, protyle: IProtyle) => {- fileName = replaceFileName(fileName);+ const newName = replaceFileName(fileName) || "Untitled";const id = Lute.NewNodeID();fetchPost("/api/filetree/createDoc", {notebook: protyle.notebookId,path: pathPosix().join(getDisplayName(protyle.path, false, true), id + ".sy"),- title: fileName,+ title: newName,md: ""}, () => {- insertHTML(genEmptyBlock(false, false, `<span data-type="block-ref" data-id="${id}" data-subtype="d">${escapeHtml(fileName)}</span>`), protyle);+ insertHTML(genEmptyBlock(false, false, `<span data-type="block-ref" data-id="${id}" data-subtype="d">${escapeHtml(newName)}</span>`), protyle);});};diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.tsindex fb45f61163..72f9f3b70d 100644--- a/app/src/protyle/wysiwyg/keydown.ts+++ b/app/src/protyle/wysiwyg/keydown.ts@@ -996,8 +996,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {return;}- if (selectText.trim() && matchHotKey(window.siyuan.config.keymap.editor.general.newNameFile.custom, event)) {- newFileBySelect(selectText, protyle);+ if (matchHotKey(window.siyuan.config.keymap.editor.general.newNameFile.custom, event)) {+ newFileBySelect(selectText.trim() ? selectText.trim() : protyle.lute.BlockDOM2Content(nodeElement.outerHTML), protyle);event.preventDefault();event.stopPropagation();return;