25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
fix(plugins): keep the sidebar shortcut list visible beside the endpoint row (#12604)
Terry Yaoe42f3d73074a
diff --git a/apps/desktop/src/composables/__tests__/usePluginShortcutHeight.spec.ts b/apps/desktop/src/composables/__tests__/usePluginShortcutHeight.spec.tsindex 24ddc4c5a3..4d7a4c239b 100644--- a/apps/desktop/src/composables/__tests__/usePluginShortcutHeight.spec.ts+++ b/apps/desktop/src/composables/__tests__/usePluginShortcutHeight.spec.ts@@ -27,7 +27,7 @@ async function setup() {root.innerHTML = '<div data-sidebar-connection-tree></div><div data-sidebar-connection-endpoint></div><nav><div data-shortcut-resize></div><div style="padding:4px"><div style="gap:0px"><span data-shortcut-id="a"></span></div></div></nav>';document.body.append(root);const tree = root.children[0] as HTMLElement;- const section = root.children[2] as HTMLElement;+ const section = root.querySelector("nav") as HTMLElement;const handle = section.children[0] as HTMLElement;const scroll = section.children[1] as HTMLElement;let width = 184;@@ -76,6 +76,15 @@ async function setup() {};}describe("shortcut sidebar height", () => {+ it("measures the tree rather than a fixed sibling like the endpoint bar", async () => {+ const { sizing } = await setup();+ const endpoint = root.querySelector<HTMLElement>("[data-sidebar-connection-endpoint]")!;+ Object.defineProperty(endpoint, "offsetHeight", { get: () => 25 });+ for (let measurement = 0; measurement < 3; measurement++) {+ resizeObserver();+ expect(sizing.height.value).toBe(148);+ }+ });it("reserves the title row as well as 120px for the connection tree", async () => {const { sizing, savedHeight, setTotal } = await setup();const header = document.createElement("div");diff --git a/apps/desktop/src/composables/usePluginShortcutHeight.ts b/apps/desktop/src/composables/usePluginShortcutHeight.tsindex f9662ec468..08da6eb0bf 100644--- a/apps/desktop/src/composables/usePluginShortcutHeight.ts+++ b/apps/desktop/src/composables/usePluginShortcutHeight.ts@@ -25,7 +25,7 @@ export function usePluginShortcutHeight(options: { section: Ref<HTMLElement | nu// The endpoint row may sit between the connection tree and this section.// Resolve the flexible tree wrapper explicitly so its height is not// mistaken for the available space when the shortcut list is refreshed.- const tree = (section.parentElement?.querySelector<HTMLElement>("[data-sidebar-connection-tree]") ?? section.previousElementSibling) as HTMLElement | null;+ const tree = (section.parentElement?.querySelector<HTMLElement>(":scope > [data-sidebar-connection-tree]") ?? section.previousElementSibling) as HTMLElement | null;const divider = section.querySelector<HTMLElement>("[data-shortcut-resize]");const header = section.querySelector<HTMLElement>("[data-shortcut-header]");available.value = (tree?.offsetHeight ?? 0) + section.offsetHeight - (divider?.offsetHeight ?? 0) - (header?.offsetHeight ?? 0);