An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: fix https://github.com/siyuan-note/siyuan/issues/9474
Vanessa1922f6fa9d2b
diff --git a/app/electron/main.js b/app/electron/main.jsindex 2bca368a0d..605fd66633 100644--- a/app/electron/main.js+++ b/app/electron/main.js@@ -743,6 +743,9 @@ app.whenReady().then(() => {case "openDevTools":event.sender.openDevTools({mode: "bottom"});break;+ case "unregisterAll":+ globalShortcut.unregisterAll();+ break;case "show":showWindow(currentWindow);break;diff --git a/app/src/config/keymap.ts b/app/src/config/keymap.tsindex 093a470b2d..04a68f7214 100644--- a/app/src/config/keymap.ts+++ b/app/src/config/keymap.ts@@ -1,10 +1,13 @@import {isCtrl, isMac, updateHotkeyTip} from "../protyle/util/compatibility";import {Constants} from "../constants";-import {showMessage} from "../dialog/message";+import {hideMessage, showMessage} from "../dialog/message";import {fetchPost} from "../util/fetch";import {exportLayout} from "../layout/util";import {confirmDialog} from "../dialog/confirmDialog";import {App} from "../index";+/// #if !BROWSER+import {ipcRenderer} from "electron";+/// #endifimport {sendGlobalShortcut} from "../boot/globalEvent/keydown";export const keymap = {@@ -272,6 +275,16 @@ export const keymap = {}keymap.search(searchElement.value, searchKeymapElement.value);});+ /// #if !BROWSER+ searchKeymapElement.addEventListener("focus", () => {+ ipcRenderer.send(Constants.SIYUAN_CMD, {+ cmd: "unregisterAll",+ });+ });+ /// #endif+ searchKeymapElement.addEventListener("blur", () => {+ sendGlobalShortcut(app);+ });searchKeymapElement.addEventListener("keydown", function (event: KeyboardEvent) {event.stopPropagation();event.preventDefault();@@ -373,7 +386,7 @@ export const keymap = {showMessage(`${window.siyuan.languages.invalid} [${adoptKeymapStr}]`);hasConflict = true;}- Array.from(keymap.element.querySelectorAll("label.b3-list-item input")).find((inputItem: HTMLElement) => {+ Array.from(keymap.element.querySelectorAll("label.b3-list-item input")).find((inputItem: HTMLElement) => {if (!inputItem.isSameNode(this) && inputItem.getAttribute("data-value") === keymapStr) {const inputValueList = inputItem.getAttribute("data-key").split(Constants.ZWSP);if (inputValueList[1] === "list") {@@ -391,18 +404,27 @@ export const keymap = {this.value = updateHotkeyTip(this.getAttribute("data-value"));return;}+ hideMessage();this.setAttribute("data-value", keymapStr);this.value = adoptKeymapStr;keymap._setkeymap(app);- }, 1000);+ }, Constants.TIMEOUT_TRANSITION);});item.addEventListener("blur", function () {+ sendGlobalShortcut(app);setTimeout(() => {this.classList.add("fn__none");this.previousElementSibling.textContent = this.value;this.previousElementSibling.classList.remove("fn__none");}, Constants.TIMEOUT_INPUT); // 隐藏的话点击删除无法 target 会为 li});+ /// #if !BROWSER+ item.addEventListener("focus", () => {+ ipcRenderer.send(Constants.SIYUAN_CMD, {+ cmd: "unregisterAll",+ });+ });+ /// #endif});},_getKeymapString(event: KeyboardEvent) {