Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/8341 3

Vanessa228da65358da
diff --git a/app/src/layout/dock/index.ts b/app/src/layout/dock/index.ts
index cb5584bee0..8eed41c5a3 100644
--- a/app/src/layout/dock/index.ts
+++ b/app/src/layout/dock/index.ts
@@ -75,7 +75,7 @@ export class Dock {
}
})
}
- if (!showDock) {
+ if (!showDock && options.data.data[1]) {
options.data.data[1].find(item => {
if (TYPES.includes(item.type)) {
showDock = true
@@ -664,5 +664,12 @@ export class Dock {
this.element.lastElementChild.innerHTML = html;
}
}
+
+ if (typeof tabIndex === "number") {
+ this.element.classList.remove("fn__none");
+ if (data[0].show) {
+ this.toggleModel(data[0].type, true);
+ }
+ }
}
}
diff --git a/app/src/plugin/loader.ts b/app/src/plugin/loader.ts
index 830ef60d21..3fe968eb26 100644
--- a/app/src/plugin/loader.ts
+++ b/app/src/plugin/loader.ts
@@ -91,6 +91,7 @@ const updateDock = (dockItem: IDockTab[], index: number, plugin: Plugin, type: s
plugin.docks[tabItem.type].config.position = index === 0 ? "BottomLeft" : "BottomRight";
}
plugin.docks[tabItem.type].config.index = tabIndex;
+ plugin.docks[tabItem.type].config.show = tabItem.show;
plugin.docks[tabItem.type].config.size = tabItem.size;
}
})
@@ -126,7 +127,7 @@ export const afterLoadPlugin = (plugin: Plugin) => {
window.siyuan.layout.leftDock.genButton([{
type: key,
size: dock.config.size,
- show: false,
+ show: dock.config.show,
icon: dock.config.icon,
title: dock.config.title,
hotkey: dock.config.hotkey
@@ -135,7 +136,7 @@ export const afterLoadPlugin = (plugin: Plugin) => {
window.siyuan.layout.bottomDock.genButton([{
type: key,
size: dock.config.size,
- show: false,
+ show: dock.config.show,
icon: dock.config.icon,
title: dock.config.title,
hotkey: dock.config.hotkey
@@ -144,7 +145,7 @@ export const afterLoadPlugin = (plugin: Plugin) => {
window.siyuan.layout.rightDock.genButton([{
type: key,
size: dock.config.size,
- show: false,
+ show: dock.config.show,
icon: dock.config.icon,
title: dock.config.title,
hotkey: dock.config.hotkey
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index de7afc384c..649922edf2 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -314,6 +314,7 @@ declare interface IPluginDockTab {
hotkey?: string,
title: string,
index?: number
+ show?: boolean
}
declare interface IOpenFileOptions {