Skip to content

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

:sparkles: https://github.com/siyuan-note/siyuan/issues/2955

Vanessa6bbb679cd234
diff --git a/app/.eslintrc.js b/app/.eslintrc.js
index 48cf5feab3..5540969ada 100644
--- a/app/.eslintrc.js
+++ b/app/.eslintrc.js
@@ -14,7 +14,6 @@ module.exports = {
'no-prototype-builtins': 'off',
'no-useless-escape': 'off',
'no-irregular-whitespace': 'off',
- '@typescript-eslint/no-this-alia': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
diff --git a/app/src/assets/scss/_reset.scss b/app/src/assets/scss/_reset.scss
index c0687c61e5..8999634707 100644
--- a/app/src/assets/scss/_reset.scss
+++ b/app/src/assets/scss/_reset.scss
@@ -83,7 +83,7 @@ body {
}
&.body--blur .layout-tab-bar {
- background-color: var(--b3-toolbar-blur-background);
+ opacity: .38;
}
}
}
diff --git a/app/src/layout/Tab.ts b/app/src/layout/Tab.ts
index c9318d8b2d..9f8598bbf8 100644
--- a/app/src/layout/Tab.ts
+++ b/app/src/layout/Tab.ts
@@ -10,7 +10,6 @@ import {fetchPost} from "../util/fetch";
import {showTooltip} from "../dialog/tooltip";
import {isTouchDevice} from "../util/functions";
/// #if !BROWSER
-import {getCurrentWindow} from "@electron/remote";
import {openNewWindow} from "../window/openNewWindow";
/// #endif
import {layoutToJSON} from "./util";
@@ -100,11 +99,9 @@ export class Tab {
/// #if !BROWSER
// 拖拽到屏幕外
setTimeout(() => {
- if (!this.headElement.style.maxWidth) {
- const windowBounds = getCurrentWindow().getBounds();
- if (event.clientX < 0 || event.clientY < 0 || event.clientX > windowBounds.width || event.clientY > windowBounds.height) {
- openNewWindow(this);
- }
+ if (document.body.contains(this.panelElement) &&
+ (event.clientX < 0 || event.clientY < 0 || event.clientX > window.innerWidth || event.clientY > window.innerHeight)) {
+ openNewWindow(this);
}
}, Constants.TIMEOUT_BLOCKLOAD); // 等待主进程发送关闭消息
/// #endif
diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts
index 3eb8014eef..52388056da 100644
--- a/app/src/layout/Wnd.ts
+++ b/app/src/layout/Wnd.ts
@@ -161,7 +161,7 @@ export class Wnd {
return true;
}
});
- if (!newTabHeaderElement && oldTabHeaderElement && !oldTabHeaderElement.classList.contains("item--pin")) {
+ if (!newTabHeaderElement && oldTabHeaderElement && !oldTabHeaderElement.classList.contains("item--pin")) {
it.classList.add("layout-tab-bar--drag");
}
if (!exitDrag && oldTabHeaderElement) {
@@ -206,7 +206,6 @@ export class Wnd {
});
it.style.opacity = "";
});
- const that = this;
this.headersElement.addEventListener("drop", function (event: DragEvent & { target: HTMLElement }) {
const it = this as HTMLElement;
if (event.dataTransfer.types.includes(Constants.SIYUAN_DROP_FILE)) {
@@ -228,11 +227,14 @@ export class Wnd {
let oldTab = getInstanceById(tabId) as Tab;
/// #if !BROWSER
if (!oldTab) { // 从主窗口拖拽到页签新窗口
- JSONToCenter(JSON.parse(event.dataTransfer.getData(Constants.SIYUAN_DROP_TABTOWINDOW)), that);
- oldTab = that.children[that.children.length - 1];
- ipcRenderer.send(Constants.SIYUAN_CLOSETAB, tabId);
- it.querySelector("li[data-clone='true']").remove();
- that.switchTab(oldTab.headElement);
+ const wnd = getInstanceById(this.parentElement.parentElement.getAttribute("data-id"));
+ if (wnd instanceof Wnd) {
+ JSONToCenter(JSON.parse(event.dataTransfer.getData(Constants.SIYUAN_DROP_TABTOWINDOW)), wnd);
+ oldTab = wnd.children[wnd.children.length - 1];
+ ipcRenderer.send(Constants.SIYUAN_CLOSETAB, tabId);
+ it.querySelector("li[data-clone='true']").remove();
+ wnd.switchTab(oldTab.headElement);
+ }
}
/// #endif
if (!oldTab) {