Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/8644

Vanessa4c7a01a91166
diff --git a/app/src/config/keymap.ts b/app/src/config/keymap.ts
index 29378196ae..cdc7d6e37e 100644
--- a/app/src/config/keymap.ts
+++ b/app/src/config/keymap.ts
@@ -56,7 +56,7 @@ export const keymap = {
<span class="b3-list-item__toggle b3-list-item__toggle--hl">
<svg class="b3-list-item__arrow"><use xlink:href="#iconRight"></use></svg>
</span>
- <span class="b3-list-item__text ft__on-surface">${item.name}</span>
+ <span class="b3-list-item__text ft__on-surface">${item.displayName}</span>
</div>
<div class="fn__none b3-list__panel">
${commandHTML}
diff --git a/app/src/layout/topBar.ts b/app/src/layout/topBar.ts
index 0d48e56187..2eb76da59f 100644
--- a/app/src/layout/topBar.ts
+++ b/app/src/layout/topBar.ts
@@ -375,7 +375,7 @@ const openPlugin = (app: App, target: Element) => {
hasPlugin = true;
menu.addItem({
icon: "iconSettings",
- label: plugin.name,
+ label: plugin.displayName,
click() {
plugin.openSetting();
}
diff --git a/app/src/plugin/commandPanel.ts b/app/src/plugin/commandPanel.ts
index 17354035a8..a6b5b20f5b 100644
--- a/app/src/plugin/commandPanel.ts
+++ b/app/src/plugin/commandPanel.ts
@@ -23,7 +23,7 @@ export const commandPanel = (app: App) => {
plugin.commands.forEach(command => {
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>
+ liElement.innerHTML = `<span class="b3-list-item__text">${plugin.displayName}: ${command.langText || plugin.i18n[command.langKey]}</span>
<span class="b3-list-item__meta">${updateHotkeyTip(command.customHotkey)}</span>`;
liElement.addEventListener("click", () => {
command.callback();
diff --git a/app/src/plugin/index.ts b/app/src/plugin/index.ts
index 0721db4748..17e6f88a1d 100644
--- a/app/src/plugin/index.ts
+++ b/app/src/plugin/index.ts
@@ -16,6 +16,7 @@ export class Plugin {
public i18n: IObject;
public eventBus: EventBus;
public data: any = {};
+ public displayName: string;
public name: string;
public protyleSlash: {
filter: string[],
@@ -53,11 +54,13 @@ export class Plugin {
constructor(options: {
app: App,
name: string,
+ displayName: string,
i18n: IObject
}) {
this.app = options.app;
this.i18n = options.i18n;
this.name = options.name;
+ this.displayName = options.displayName;
this.eventBus = new EventBus(options.name);
}
diff --git a/app/src/plugin/loader.ts b/app/src/plugin/loader.ts
index e31d3ab06e..bf578f9790 100644
--- a/app/src/plugin/loader.ts
+++ b/app/src/plugin/loader.ts
@@ -54,6 +54,7 @@ const loadPluginJS = async (app: App, item: IPluginData) => {
}
const plugin = new pluginClass({
app,
+ displayName: item.displayName,
name: item.name,
i18n: item.i18n
});
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index 787b500c6c..bd37e33a8c 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -341,6 +341,7 @@ interface ICommand {
}
interface IPluginData {
+ displayName: string,
name: string,
js: string,
css: string,