Skip to content

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

:sparkles: Support configuring plugin docks https://github.com/siyuan-note/siyuan/issues/18935

Daniel41cc5440f760
diff --git a/app/src/config/entryVisibility/catalog.test.ts b/app/src/config/entryVisibility/catalog.test.ts
index 81f8f92eb0..a632e16f1a 100644
--- a/app/src/config/entryVisibility/catalog.test.ts
+++ b/app/src/config/entryVisibility/catalog.test.ts
@@ -18,9 +18,11 @@ import {
getEntryParentPath,
getEntryOrderParents,
getEntryPaths,
+ getPluginDockEntryKey,
getPluginSlashEntryKey,
getSlashMenuEntryPath,
isEntryOrderSortable,
+ refreshDockCatalog,
refreshSlashMenuCatalog,
refreshToolbarCatalog,
SLASH_MENU_ROOT_PATH,
@@ -149,6 +151,47 @@ test("toolbar catalog follows plugin insertion slots and removes unloaded plugin
assert.equal(getEntryCatalogNode(`${TOOLBAR_ENTRY_ROOT_PATH}.${pluginKey}`), undefined);
});
+test("dock catalog refreshes unique plugin docks and removes unloaded entries", () => {
+ const firstKey = getPluginDockEntryKey("plugin.one", "shared.id");
+ const secondKey = getPluginDockEntryKey("plugin.two", "shared.id");
+ try {
+ refreshDockCatalog([{
+ name: "plugin.one",
+ displayName: "Plugin One",
+ docks: {
+ first: {id: "shared.id", config: {title: "First Dock"}},
+ duplicate: {id: "shared.id", config: {title: "Duplicate Dock"}},
+ },
+ }, {
+ name: "plugin.two",
+ displayName: "Plugin Two",
+ docks: {
+ second: {id: "shared.id", config: {title: "Second Dock"}},
+ },
+ }]);
+
+ const children = getEntryCatalogChildren("dock");
+ assert.deepEqual(children.slice(-2).map((item) => item.key), [firstKey, secondKey]);
+ assert.equal(children.filter((item) => item.key === firstKey).length, 1);
+ assert.equal(getEntryCatalogNode(`dock.${firstKey}`)?.label(), "Plugin One - First Dock");
+ assert.equal(getEntryCatalogNode(`dock.${secondKey}`)?.label(), "Plugin Two - Second Dock");
+ assert.equal(getEntryParentPath(`dock.${firstKey}`), "dock");
+ } finally {
+ refreshDockCatalog([]);
+ }
+ assert.equal(getEntryCatalogNode(`dock.${firstKey}`), undefined);
+});
+
+test("plugin dock keys encode dotted names and IDs without ambiguity", () => {
+ const dottedPlugin = getPluginDockEntryKey("plugin.name", "entry");
+ const dottedEntry = getPluginDockEntryKey("plugin", "name.entry");
+ assert.equal(dottedPlugin, "plugin:plugin%2Ename:entry");
+ assert.equal(dottedEntry, "plugin:plugin:name%2Eentry");
+ assert.notEqual(dottedPlugin, dottedEntry);
+ assert.equal(dottedPlugin.includes("."), false);
+ assert.equal(dottedEntry.includes("."), false);
+});
+
test("slash menu catalog follows the built-in hint order", () => {
const section = getEntryCatalogSection("editor.slash");
assert.deepEqual(section?.children.map((item) => item.key), ["menu"]);
diff --git a/app/src/config/entryVisibility/catalog.ts b/app/src/config/entryVisibility/catalog.ts
index 9dddb2279e..32de85d91b 100644
--- a/app/src/config/entryVisibility/catalog.ts
+++ b/app/src/config/entryVisibility/catalog.ts
@@ -531,23 +531,27 @@ const toolbarCatalogSection: IEntryCatalogSection = {
children: toolbarBuiltinChildren,
};
+const dockBuiltinChildren = [
+ node("file", lang("fileTree")),
+ node("outline", lang("outline")),
+ node("bookmark", lang("bookmark")),
+ node("tag", lang("tag")),
+ node("backlink", lang("backlinks")),
+ node("agentChat", lang("ai")),
+ node("inbox", lang("inbox"), false),
+ node("graph", lang("graphView"), false),
+ node("globalGraph", lang("globalGraph"), false),
+];
+
+const dockCatalogSection: IEntryCatalogSection = {
+ key: "dock",
+ label: lang("toggleDock"),
+ sortable: false,
+ children: dockBuiltinChildren,
+};
+
export const entryCatalog: IEntryCatalogSection[] = [
- {
- key: "dock",
- label: lang("toggleDock"),
- sortable: false,
- children: [
- node("file", lang("fileTree")),
- node("outline", lang("outline")),
- node("bookmark", lang("bookmark")),
- node("tag", lang("tag")),
- node("backlink", lang("backlinks")),
- node("agentChat", lang("ai")),
- node("inbox", lang("inbox"), false),
- node("graph", lang("graphView"), false),
- node("globalGraph", lang("globalGraph"), false),
- ],
- },
+ dockCatalogSection,
{
key: "docTree.panel",
label: location(lang("entryDocPanel"), lang("more")),
@@ -973,6 +977,52 @@ export const getEntryCatalogPathChain = (sectionKey: string, path: string) => {
return current === sectionKey ? chain : [];
};
+interface IDockCatalogPlugin {
+ name: string;
+ displayName?: string;
+ docks: Record<string, {
+ id: string;
+ config: Pick<IPluginDockTab, "title">;
+ }>;
+}
+
+const encodeDockEntryKeyPart = (value: string) => encodeURIComponent(value).replace(/\./g, "%2E");
+
+export const getPluginDockEntryKey = (pluginName: string, dockID: string) =>
+ `plugin:${encodeDockEntryKeyPart(pluginName)}:${encodeDockEntryKeyPart(dockID)}`;
+
+let dockCatalogSignature = "[]";
+
+export const refreshDockCatalog = (plugins: IDockCatalogPlugin[]) => {
+ const signature = JSON.stringify(plugins.map((plugin) => ({
+ name: plugin.name,
+ displayName: plugin.displayName,
+ docks: Object.values(plugin.docks).map((dock) => ({
+ id: dock.id,
+ title: dock.config.title,
+ })),
+ })));
+ if (signature === dockCatalogSignature) {
+ return;
+ }
+ const pluginNodes: IEntryCatalogNode[] = [];
+ const pluginKeys = new Set<string>();
+ plugins.forEach((plugin) => {
+ Object.values(plugin.docks).forEach((dock) => {
+ const key = getPluginDockEntryKey(plugin.name, dock.id);
+ if (pluginKeys.has(key)) {
+ return;
+ }
+ pluginKeys.add(key);
+ const pluginName = plugin.displayName?.trim() || plugin.name;
+ pluginNodes.push(node(key, literal(`${pluginName} - ${dock.config.title}`)));
+ });
+ });
+ dockCatalogSection.children = [...dockBuiltinChildren, ...pluginNodes];
+ dockCatalogSignature = signature;
+ rebuildCatalogIndexes();
+};
+
const normalizeToolbarCatalogSeparators = (nodes: IEntryCatalogNode[]) => {
const result: IEntryCatalogNode[] = [];
nodes.forEach((item) => {
diff --git a/app/src/config/entryVisibility/runtime.ts b/app/src/config/entryVisibility/runtime.ts
index 1335d87dd5..08bffa232a 100644
--- a/app/src/config/entryVisibility/runtime.ts
+++ b/app/src/config/entryVisibility/runtime.ts
@@ -233,7 +233,7 @@ export const applyDockEntryVisibility = () => {
/// #if !MOBILE
document.querySelectorAll<HTMLElement>(".dock__item[data-type]").forEach((item) => {
const type = item.dataset.type;
- const path = `dock.${type}`;
+ const path = `dock.${item.dataset.entryId || type}`;
if (!getEntryCatalogNode(path)) {
return;
}
diff --git a/app/src/config/entryVisibility/ui.ts b/app/src/config/entryVisibility/ui.ts
index 5ea7bdaf66..2004ec9d9b 100644
--- a/app/src/config/entryVisibility/ui.ts
+++ b/app/src/config/entryVisibility/ui.ts
@@ -10,6 +10,7 @@ import {
IEntryCatalogNode,
IEntryCatalogSection,
isEntryOrderSortable,
+ refreshDockCatalog,
refreshSlashMenuCatalog,
} from "./catalog";
import {
@@ -365,7 +366,9 @@ const getEntrySearchFilter = (query: string) => {
};
const openProfileEditor = (root: HTMLElement, profileID?: string) => {
- refreshSlashMenuCatalog(window.siyuan.ws?.app?.plugins || []);
+ const plugins = window.siyuan.ws?.app?.plugins || [];
+ refreshDockCatalog(plugins);
+ refreshSlashMenuCatalog(plugins);
const builtin = profileID === ENTRY_PROFILE_SIMPLE || profileID === ENTRY_PROFILE_FULL;
let selectedTemplate: TEntryVisibilityTemplate | "current" = ENTRY_PROFILE_SIMPLE;
const existing = profileID
@@ -696,7 +699,9 @@ export const genEntryVisibilityHtml = () => `<div class="b3-label config-item" d
</div>`;
export const mountEntryVisibility = (root: HTMLElement) => {
- refreshSlashMenuCatalog(window.siyuan.ws?.app?.plugins || []);
+ const plugins = window.siyuan.ws?.app?.plugins || [];
+ refreshDockCatalog(plugins);
+ refreshSlashMenuCatalog(plugins);
renderProfileCards(root);
root.querySelector("[data-action='create']")?.addEventListener("click", () => openProfileEditor(root));
root.querySelector("[data-action='export-all']")?.addEventListener("click", exportBundle);
diff --git a/app/src/layout/dock/index.ts b/app/src/layout/dock/index.ts
index f35f926b26..fe550d8a8a 100644
--- a/app/src/layout/dock/index.ts
+++ b/app/src/layout/dock/index.ts
@@ -30,6 +30,7 @@ import {
import {getDockHotkey} from "./hotkey";
const TYPES = ["file", "outline", "inbox", "bookmark", "tag", "graph", "globalGraph", "backlink", "agentChat"];
+type TDockTabData = Config.IUILayoutDockTab & {entryId?: string};
export class Dock {
public elements: HTMLElement[];
@@ -919,7 +920,7 @@ export class Dock {
return max;
}
- public genButton(data: Config.IUILayoutDockTab[], index: number, tabIndex?: number) {
+ public genButton(data: TDockTabData[], index: number, tabIndex?: number) {
let html = "";
const tooltipPosition = this.getTooltipPosition(index);
data.forEach(item => {
@@ -933,7 +934,7 @@ export class Dock {
item.icon = "iconTag";
}
const hotkey = getDockHotkey(item);
- html += `<span data-height="${item.size.height}" data-width="${item.size.width}" data-type="${item.type}" data-index="${index}" data-hotkeylangid="${item.hotkeyLangId || ""}" data-title="${item.title}" data-position="${tooltipPosition}" class="dock__item${item.show ? " dock__item--active" : ""} ariaLabel" aria-label="<span style='white-space:pre'>${item.title} ${hotkey ? updateHotkeyTip(hotkey) : ""}${window.siyuan.languages.dockTip}</span>">
+ html += `<span data-height="${item.size.height}" data-width="${item.size.width}" data-type="${item.type}"${item.entryId ? ` data-entry-id="${item.entryId}"` : ""} data-index="${index}" data-hotkeylangid="${item.hotkeyLangId || ""}" data-title="${item.title}" data-position="${tooltipPosition}" class="dock__item${item.show ? " dock__item--active" : ""} ariaLabel" aria-label="<span style='white-space:pre'>${item.title} ${hotkey ? updateHotkeyTip(hotkey) : ""}${window.siyuan.languages.dockTip}</span>">
<svg><use xlink:href="#${item.icon}"></use></svg>
</span>`;
this.data[item.type] = true;
diff --git a/app/src/mobile/dock/pluginDockState.test.ts b/app/src/mobile/dock/pluginDockState.test.ts
new file mode 100644
index 0000000000..7ff89efe12
--- /dev/null
+++ b/app/src/mobile/dock/pluginDockState.test.ts
@@ -0,0 +1,51 @@
+import * as assert from "node:assert/strict";
+import test from "node:test";
+import {openMobilePluginDock, removeMobilePluginDock} from "./pluginDockState";
+
+test("mobile plugin docks replace and remove the active model", () => {
+ const windowDescriptor = Object.getOwnPropertyDescriptor(globalThis, "window");
+ const docks: Record<string, unknown> = {};
+ Object.defineProperty(globalThis, "window", {
+ configurable: true,
+ value: {siyuan: {mobile: {docks}}},
+ });
+ let firstDestroyed = 0;
+ let secondDestroyed = 0;
+ let duplicateCreated = false;
+ const first = {
+ type: "first",
+ element: {innerHTML: "first"},
+ destroy: () => firstDestroyed++,
+ };
+ const second = {
+ type: "second",
+ element: {innerHTML: "second"},
+ destroy: () => secondDestroyed++,
+ };
+ try {
+ openMobilePluginDock("first", () => first as never);
+ openMobilePluginDock("first", () => {
+ duplicateCreated = true;
+ return first as never;
+ });
+ openMobilePluginDock("second", () => second as never);
+
+ assert.equal(duplicateCreated, false);
+ assert.equal(firstDestroyed, 1);
+ assert.equal(docks.first, undefined);
+ assert.equal(docks.second, second);
+
+ removeMobilePluginDock("second");
+ assert.equal(secondDestroyed, 1);
+ assert.equal(second.element.innerHTML, "");
+ assert.equal(docks.second, undefined);
+ } finally {
+ removeMobilePluginDock("first");
+ removeMobilePluginDock("second");
+ if (windowDescriptor) {
+ Object.defineProperty(globalThis, "window", windowDescriptor);
+ } else {
+ Reflect.deleteProperty(globalThis, "window");
+ }
+ }
+});
diff --git a/app/src/mobile/dock/pluginDockState.ts b/app/src/mobile/dock/pluginDockState.ts
new file mode 100644
index 0000000000..f4ddcdf19b
--- /dev/null
+++ b/app/src/mobile/dock/pluginDockState.ts
@@ -0,0 +1,30 @@
+import {MobileCustom} from "./MobileCustom";
+
+let custom: MobileCustom | undefined;
+
+export const getMobilePluginDock = () => custom;
+
+export const openMobilePluginDock = (type: string, create: () => MobileCustom) => {
+ if (custom?.type === type) {
+ return;
+ }
+ const previousType = custom?.type;
+ custom?.destroy?.();
+ if (previousType) {
+ delete window.siyuan.mobile.docks[previousType];
+ }
+ custom = create();
+ window.siyuan.mobile.docks[type] = custom;
+};
+
+export const removeMobilePluginDock = (type: string) => {
+ const dock = window.siyuan.mobile.docks[type] as MobileCustom;
+ if (custom?.type === type) {
+ custom.destroy?.();
+ custom.element.innerHTML = "";
+ custom = undefined;
+ } else {
+ dock?.destroy?.();
+ }
+ delete window.siyuan.mobile.docks[type];
+};
diff --git a/app/src/mobile/util/initFramework.ts b/app/src/mobile/util/initFramework.ts
index 59f92f257a..4fbe4061ef 100644
--- a/app/src/mobile/util/initFramework.ts
+++ b/app/src/mobile/util/initFramework.ts
@@ -21,7 +21,6 @@ import {syncGuide} from "../../sync/syncGuide";
import {Inbox} from "../../layout/dock/Inbox";
import type {App} from "../../index";
import {checkFold} from "../../util/noRelyPCFunction";
-import {MobileCustom} from "../dock/MobileCustom";
import {Menu} from "../../plugin/Menu";
import {showMessage} from "../../dialog/message";
import {setTitle} from "../../util/processTitle";
@@ -36,8 +35,7 @@ import {
type MobileSidePanelDockId,
} from "./mobileSidePanelConfig";
import {getMobileSidePanelConfig} from "./mobileSidePanelSetting";
-
-let custom: MobileCustom;
+import {getMobilePluginDock, openMobilePluginDock} from "../dock/pluginDockState";
const getDockTabElement = (type: MobileSidePanelDockId) => {
return document.querySelector(`[data-type="sidebar-${type}-tab"]`) as HTMLElement;
};
@@ -97,17 +95,7 @@ const openDockMenu = (app: App, element: HTMLElement) => {
label: plugin.docks[dockId].config.title,
icon: plugin.docks[dockId].config.icon,
click() {
- if (custom?.type === dockId) {
- return;
- } else {
- if (custom) {
- if (custom.destroy) {
- custom.destroy();
- }
- }
- custom = plugin.docks[dockId].mobileModel(element);
- window.siyuan.mobile.docks[dockId] = custom;
- }
+ openMobilePluginDock(dockId, () => plugin.docks[dockId].mobileModel(element));
}
});
});
@@ -156,6 +144,7 @@ const updateDock = (app: App, type: MobileSidePanelDockId, element: HTMLElement,
activateMobileAgent(app, element);
});
} else if (type === "plugin") {
+ const custom = getMobilePluginDock();
if (!custom || openPluginMenu) {
if (!custom) {
element.innerHTML = `<div class="b3-list--empty">${window.siyuan.languages.emptyContent}</div>`;
diff --git a/app/src/plugin/index.ts b/app/src/plugin/index.ts
index c5ca482efa..de321940b3 100644
--- a/app/src/plugin/index.ts
+++ b/app/src/plugin/index.ts
@@ -20,7 +20,7 @@ import {BlockPanel} from "../block/Panel";
import {Setting} from "./Setting";
import {Constants} from "../constants";
import {uninstall} from "./uninstall";
-import {addPluginDock, afterLoadPlugin, loadPlugins} from "./loader";
+import {addPluginDock, afterLoadPlugin, loadPlugins, removePluginDock} from "./loader";
import {normalizeStoragePath} from "../util/pathName";
import {Kernel} from "./kernel";
import {IAgentCapabilityEffects, registerCapability} from "../layout/dock/agent/frontendCapabilities";
@@ -89,6 +89,7 @@ export class Plugin {
} = {};
public docks: {
[key: string]: {
+ id: string,
config: IPluginDockTab,
/// #if !MOBILE
model: (options: { tab: Tab }) => Custom
@@ -518,6 +519,7 @@ export class Plugin {
}
public addDock(options: {
+ id?: string,
config: IPluginDockTab,
data: any,
type: string,
@@ -526,11 +528,18 @@ export class Plugin {
update?: () => void,
init: () => void
}) {
+ const id = options.id || options.type;
const type2 = this.name + options.type;
+ const existingID = this.docks[type2]?.id;
+ if (existingID && existingID !== id) {
+ removePluginDock(this, existingID);
+ }
+ removePluginDock(this, id);
if (typeof options.config.index === "undefined") {
options.config.index = 1000;
}
this.docks[type2] = {
+ id,
config: options.config,
/// #if MOBILE
mobileModel: (element) => {
@@ -572,6 +581,10 @@ export class Plugin {
return this.docks[type2];
}
+ public removeDock(id: string) {
+ removePluginDock(this, id);
+ }
+
public addFloatLayer = (options: {
refDefs: IRefDefs[],
x?: number,
diff --git a/app/src/plugin/loader.ts b/app/src/plugin/loader.ts
index 8b5da4ff6b..781ea68e5e 100644
--- a/app/src/plugin/loader.ts
+++ b/app/src/plugin/loader.ts
@@ -3,6 +3,9 @@ import type {App} from "../index";
import {Plugin} from "./index";
/// #if !MOBILE
import {resizeTopBar, saveLayout} from "../layout/util";
+import {getDockByType} from "../layout/tabUtil";
+/// #else
+import {removeMobilePluginDock} from "../mobile/dock/pluginDockState";
/// #endif
import {API} from "./API";
import {getFrontend, isMobile, isWindow} from "../util/functions";
@@ -10,6 +13,8 @@ import {Constants} from "../constants";
import {uninstall} from "./uninstall";
import {setStorageVal} from "../protyle/util/compatibility";
import {getAllEditor} from "../layout/getAll";
+import {getPluginDockEntryKey, refreshDockCatalog} from "../config/entryVisibility/catalog";
+import {applyDockEntryVisibility, isEntryVisible} from "../config/entryVisibility/runtime";
const requireFunc = (key: string) => {
const modules = {
@@ -198,7 +203,33 @@ export const afterLayoutReady = (app: App) => {
});
};
+const getPluginCatalogPlugins = (plugin: Plugin) => window.siyuan.ws?.app?.plugins || [plugin];
+
+export const removePluginDock = (plugin: Plugin, id: string) => {
+ const key = Object.keys(plugin.docks).find((dockType) => plugin.docks[dockType].id === id);
+ if (!key) {
+ return;
+ }
+ /// #if MOBILE
+ removeMobilePluginDock(key);
+ /// #else
+ getDockByType(key)?.remove(key);
+ saveLayout();
+ /// #endif
+ delete plugin.docks[key];
+ const plugins = getPluginCatalogPlugins(plugin);
+ refreshDockCatalog(plugins);
+ applyDockEntryVisibility();
+ /// #if MOBILE
+ if (plugins.every((item) => Object.keys(item.docks).length === 0)) {
+ document.querySelector("[data-type='sidebar-plugin-tab']")?.classList.add("fn__none");
+ }
+ /// #endif
+};
+
export const addPluginDock = (plugin: Plugin) => {
+ const plugins = getPluginCatalogPlugins(plugin);
+ refreshDockCatalog(plugins);
/// #if MOBILE
// 移动端只有存在插件 dock 时才显示插件入口图标
if (Object.keys(plugin.docks).length > 0) {
@@ -229,32 +260,28 @@ export const addPluginDock = (plugin: Plugin) => {
plugin.docks[key].config = window.siyuan.storage[Constants.LOCAL_PLUGIN_DOCKS][plugin.name][key];
}
const dock = plugin.docks[key];
+ const entryId = getPluginDockEntryKey(plugin.name, dock.id);
+ const show = dock.config.show && isEntryVisible(`dock.${entryId}`);
+ const dockTab: Config.IUILayoutDockTab & {entryId: string} = {
+ type: key,
+ size: dock.config.size,
+ show,
+ icon: dock.config.icon,
+ title: dock.config.title,
+ entryId,
+ };
if (dock.config.position.startsWith("Left")) {
- window.siyuan.layout.leftDock.genButton([{
- type: key,
- size: dock.config.size,
- show: dock.config.show,
- icon: dock.config.icon,
- title: dock.config.title,
- }], dock.config.position === "LeftBottom" ? 1 : 0, dock.config.index);
+ window.siyuan.layout.leftDock.genButton([dockTab], dock.config.position === "LeftBottom" ? 1 : 0,
+ dock.config.index);
} else if (dock.config.position.startsWith("Bottom")) {
- window.siyuan.layout.bottomDock.genButton([{
- type: key,
- size: dock.config.size,
- show: dock.config.show,
- icon: dock.config.icon,
- title: dock.config.title,
- }], dock.config.position === "BottomRight" ? 1 : 0, dock.config.index);
+ window.siyuan.layout.bottomDock.genButton([dockTab], dock.config.position === "BottomRight" ? 1 : 0,
+ dock.config.index);
} else if (dock.config.position.startsWith("Right")) {
- window.siyuan.layout.rightDock.genButton([{
- type: key,
- size: dock.config.size,
- show: dock.config.show,
- icon: dock.config.icon,
- title: dock.config.title,
- }], dock.config.position === "RightBottom" ? 1 : 0, dock.config.index);
+ window.siyuan.layout.rightDock.genButton([dockTab], dock.config.position === "RightBottom" ? 1 : 0,
+ dock.config.index);
}
});
+ applyDockEntryVisibility();
/// #endif
};
diff --git a/app/src/plugin/uninstall.ts b/app/src/plugin/uninstall.ts
index f6c8506d09..0009a725cc 100644
--- a/app/src/plugin/uninstall.ts
+++ b/app/src/plugin/uninstall.ts
@@ -14,6 +14,7 @@ import {getAllEditor} from "../layout/getAll";
import {unregisterCapability} from "../layout/dock/agent/frontendCapabilities";
import {cancelAssetUploadsByPlugin} from "../protyle/upload/pluginEvent";
import {removeBreadcrumbButtons} from "./breadcrumbButton";
+import {refreshDockCatalog} from "../config/entryVisibility/catalog";
export const uninstall = (app: App, name: string, isReload: boolean) => {
app.plugins.find((plugin: Plugin, index) => {
@@ -91,6 +92,7 @@ export const uninstall = (app: App, name: string, isReload: boolean) => {
});
// rm plugin
app.plugins.splice(index, 1);
+ refreshDockCatalog(app.plugins);
/// #if MOBILE
// 移动端卸载插件后,若无任何插件 dock 则隐藏插件入口图标
if (app.plugins.every(p => Object.keys(p.docks).length === 0)) {