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/8526
Vanessa72d0b6409b2d
diff --git a/app/src/boot/globalShortcut.ts b/app/src/boot/globalShortcut.tsindex 6f83816c33..1887684261 100644--- a/app/src/boot/globalShortcut.ts+++ b/app/src/boot/globalShortcut.ts@@ -54,6 +54,7 @@ import {fullscreen} from "../protyle/breadcrumb/action";import {setPadding} from "../protyle/ui/initUI";import {openRecentDocs} from "../business/openRecentDocs";import {App} from "../index";+import {commandPanel} from "../plugin/commandPanel";const getRightBlock = (element: HTMLElement, x: number, y: number) => {let index = 1;@@ -602,6 +603,11 @@ export const globalShortcut = (app: App) => {syncGuide(app);return;}+ if (matchHotKey(window.siyuan.config.keymap.general.commandPanel.custom, event)) {+ event.preventDefault();+ commandPanel(app);+ return;+ }if (matchHotKey(window.siyuan.config.keymap.general.editMode.custom, event)) {event.preventDefault();editor.setReadonly();diff --git a/app/src/constants.ts b/app/src/constants.tsindex 221f8e015c..f59ba26074 100644--- a/app/src/constants.ts+++ b/app/src/constants.ts@@ -211,6 +211,7 @@ export abstract class Constants {// "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦" 不可自定义public static readonly SIYUAN_KEYMAP: IKeymap = {general: {+ commandPanel: {default: "⌥⇧P", custom: "⌥⇧P"},editMode: {default: "⇧⌘G", custom: "⇧⌘G"},syncNow: {default: "F9", custom: "F9"},enterBack: {default: "⌥←", custom: "⌥←"},diff --git a/app/src/layout/topBar.ts b/app/src/layout/topBar.tsindex 7e3d12beb6..e8c21c21d5 100644--- a/app/src/layout/topBar.ts+++ b/app/src/layout/topBar.ts@@ -313,6 +313,7 @@ const openPlugin = (app: App, target: Element) => {});menu.addItem({icon: "iconLayoutBottom",+ accelerator: window.siyuan.config.keymap.general.commandPanel.custom,label: window.siyuan.languages.commandPanel,click() {commandPanel(app);diff --git a/app/src/plugin/commandPanel.ts b/app/src/plugin/commandPanel.tsindex 967018a9c7..0f27c7ac72 100644--- a/app/src/plugin/commandPanel.ts+++ b/app/src/plugin/commandPanel.ts@@ -2,6 +2,7 @@ import {Dialog} from "../dialog";import {App} from "../index";import {upDownHint} from "../util/upDownHint";import {openSetting} from "../config";+import {updateHotkeyTip} from "../protyle/util/compatibility";export const commandPanel = (app: App) => {const dialog = new Dialog({@@ -23,7 +24,7 @@ export const commandPanel = (app: App) => {const liElement = document.createElement("li");liElement.classList.add("b3-list-item")liElement.innerHTML = `<span class="b3-list-item__text">${command.langText || plugin.i18n[command.langKey]}</span>-<span class="b3-list-item__meta">${command.customHotkey}</span>`;+<span class="b3-list-item__meta">${updateHotkeyTip(command.customHotkey)}</span>`;liElement.addEventListener("click", () => {command.callback();dialog.destroy();@@ -46,6 +47,7 @@ export const commandPanel = (app: App) => {}const inputElement = dialog.element.querySelector(".b3-text-field") as HTMLInputElement;+ inputElement.focus();inputElement.addEventListener("keydown", (event: KeyboardEvent) => {event.stopPropagation();if (event.isComposing) {