An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:bug: Unify invalid document drag message styling https://github.com/siyuan-note/siyuan/issues/19548
Daniel871b214b5c4b
diff --git a/app/src/layout/dock/Files.drop.test.ts b/app/src/layout/dock/Files.drop.test.tsindex 8d926e4e13..8a6ad4078f 100644--- a/app/src/layout/dock/Files.drop.test.ts+++ b/app/src/layout/dock/Files.drop.test.ts@@ -10,7 +10,7 @@ const dropDocuments = (paths: string[], targetPath: string) => {const start = source.indexOf("const selectRootElements: HTMLElement[] = [];");const end = source.indexOf("if (newElement.classList.contains(\"dragover__bottom\")", start);assert.ok(start >= 0 && end > start);- const messages: string[] = [];+ const messages: {message: string, timeout: number, type: string}[] = [];const requests: {fromPaths: string[], toPath: string}[] = [];const classes = new Set(["dragover"]);const rows = paths.map((path) => ({@@ -33,7 +33,7 @@ const dropDocuments = (paths: string[], targetPath: string) => {toURL: "notebook",toPath: targetPath,window: {siyuan: {languages: {_kernel: {87: "Cannot move to this location"}}}},- showMessage: (message: string) => messages.push(message),+ showMessage: (message: string, timeout: number, type: string) => messages.push({message, timeout, type}),isMoveTargetAllowed: () => true,fetchPost: (_url: string, body: {fromPaths: string[], toPath: string}) => requests.push(body),});@@ -44,7 +44,7 @@ test("dropping a document into itself or descendants reports an invalid target wfor (const target of ["/parent.sy", "/parent/child.sy", "/parent/child/grandchild.sy"]) {for (const sources of [["/parent.sy"], ["/other.sy", "/parent.sy"]]) {const result = dropDocuments(sources, target);- assert.deepEqual(result.messages, ["Cannot move to this location"]);+ assert.deepEqual(result.messages, [{message: "Cannot move to this location", timeout: 7000, type: "error"}]);assert.equal(result.requests.length, 0);assert.equal(result.classes.size, 0);}diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.tsindex d2dc77a62b..4362bb6030 100644--- a/app/src/layout/dock/Files.ts+++ b/app/src/layout/dock/Files.ts@@ -881,7 +881,7 @@ export class Files extends Model {}});if (invalidMoveTarget) {- showMessage(window.siyuan.languages._kernel[87]);+ showMessage(window.siyuan.languages._kernel[87], 7000, "error");newElement.classList.remove("dragover", "dragover__bottom", "dragover__top");return;}