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/pull/13999

Vanessae5867b0c2e72
diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts
index 782e9b7227..a9dc61af62 100644
--- a/app/src/layout/dock/Files.ts
+++ b/app/src/layout/dock/Files.ts
@@ -518,16 +518,17 @@ export class Files extends Model {
) &&
// 防止文档拖拽到笔记本外
!(!sourceOnlyRoot && targetType === "navigation-root")) {
- const nodeRect = (liElement as HTMLElement).getBoundingClientRect();
+ const nodeRect = liElement.getBoundingClientRect();
+ const dragHeight = nodeRect.height * .36;
if (targetType === "navigation-root" && sourceOnlyRoot) {
if (event.clientY > nodeRect.top + nodeRect.height / 2) {
(liElement as HTMLElement).classList.add("dragover__bottom");
} else {
(liElement as HTMLElement).classList.add("dragover__top");
}
- } else if (event.clientY > nodeRect.top + nodeRect.height * 3 / 4) {
+ } else if (event.clientY > nodeRect.bottom - dragHeight) {
(liElement as HTMLElement).classList.add("dragover__bottom");
- } else if (event.clientY < nodeRect.bottom - nodeRect.height * 3 / 4) {
+ } else if (event.clientY < nodeRect.top + dragHeight) {
(liElement as HTMLElement).classList.add("dragover__top");
}
event.preventDefault();
diff --git a/app/src/layout/dock/Outline.ts b/app/src/layout/dock/Outline.ts
index 95c7133669..77ae5045ab 100644
--- a/app/src/layout/dock/Outline.ts
+++ b/app/src/layout/dock/Outline.ts
@@ -274,9 +274,10 @@ export class Outline extends Model {
return;
}
const selectRect = selectItem.getBoundingClientRect();
- if (moveEvent.clientY > selectRect.top + selectRect.height * 3 / 4) {
+ const dragHeight = selectRect.height * .36;
+ if (moveEvent.clientY > selectRect.bottom - dragHeight) {
selectItem.classList.add("dragover__bottom");
- } else if (moveEvent.clientY < selectRect.bottom - selectRect.height * 3 / 4) {
+ } else if (moveEvent.clientY < selectRect.top + dragHeight) {
selectItem.classList.add("dragover__top");
} else {
selectItem.classList.add("dragover");