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: Prevent selecting editor content from the top bar https://github.com/siyuan-note/siyuan/issues/18524
Daniel4b154bddd053
diff --git a/app/src/boot/globalEvent/event.ts b/app/src/boot/globalEvent/event.tsindex 162a28971c..ba05814696 100644--- a/app/src/boot/globalEvent/event.ts+++ b/app/src/boot/globalEvent/event.ts@@ -5,7 +5,7 @@ import {windowKeyDown} from "./keydown";import {globalClick} from "./click";import {goBack, goForward} from "../../util/backForward";import {Constants} from "../../constants";-import {hasClosestByClassName, isInEmbedBlock} from "../../protyle/util/hasClosest";+import {hasClosestByAttribute, hasClosestByClassName, isInEmbedBlock} from "../../protyle/util/hasClosest";import {hideTooltip} from "../../dialog/tooltip";import {hideAllElements} from "../../protyle/ui/hideElements";import {dragOverScroll, stopScrollAnimation} from "./dragover";@@ -209,7 +209,18 @@ export const initWindowEvent = (app: App) => {}});- window.addEventListener("mousedown", (event) => {+ window.addEventListener("mousedown", (event: MouseEvent & { target: HTMLElement }) => {+ const tabBarElement = hasClosestByClassName(event.target, "layout-tab-bar", true);+ const isWindowTabBar = tabBarElement && Array.from(tabBarElement.parentElement.children).some((item) =>+ item.classList.contains("layout-tab-bar--readonly"));+ // 避免从融合顶栏或页签空白处拖动时跨区域选中编辑器内容+ if (event.button === 0 && (+ hasClosestByClassName(event.target, "toolbar", true) ||+ hasClosestByClassName(event.target, "toolbar__window", true) ||+ (isWindowTabBar && !hasClosestByAttribute(event.target, "data-type", "tab-header", true))+ )) {+ event.preventDefault();+ }// protyle.toolbar 点击空白处时进行隐藏if (!hasClosestByClassName(event.target as Element, "protyle-toolbar")) {hideAllElements(["toolbar"]);