Skip to content

armgit / dbx

Public Imported from GitHub
0

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。

improve(updates): hide client tab when no component updates

zipg140d4870b261
diff --git a/apps/desktop/src/components/layout/UpdateDialog.spec.ts b/apps/desktop/src/components/layout/UpdateDialog.spec.ts
index 79b060b0c2..aa97c51e59 100644
--- a/apps/desktop/src/components/layout/UpdateDialog.spec.ts
+++ b/apps/desktop/src/components/layout/UpdateDialog.spec.ts
@@ -380,6 +380,26 @@ describe("UpdateDialog release notes safety", () => {
});
describe("UpdateDialog aggregate update center", () => {
+ it("hides the tab bar when no updates are available", async () => {
+ await mountDialog(0, {}, undefined, {
+ updateInfo: {
+ current_version: "0.5.60",
+ latest_version: "0.5.60",
+ update_available: false,
+ portable_mode: false,
+ manual_update_only: false,
+ release_name: "",
+ release_url: "",
+ release_notes: "",
+ },
+ updateCheckMessage: "DBX is up to date (0.5.60).",
+ });
+
+ expect(document.body.querySelector('[role="tablist"]')).toBeNull();
+ expect(document.body.querySelector('[data-update-tab="app"]')).toBeNull();
+ expect(document.body.textContent).toContain("DBX is up to date (0.5.60).");
+ });
+
it("keeps the client restart gated while update all is still updating components", async () => {
await mountDialog(0, { updateDownloaded: true, downloadProgress: 100 }, undefined, { isUpdatingAll: true });
diff --git a/apps/desktop/src/components/layout/UpdateDialog.vue b/apps/desktop/src/components/layout/UpdateDialog.vue
index 346c175e00..2e9c12bb2c 100644
--- a/apps/desktop/src/components/layout/UpdateDialog.vue
+++ b/apps/desktop/src/components/layout/UpdateDialog.vue
@@ -83,7 +83,7 @@ const tabs = computed(() => {
if (props.jdbcUpdate?.update_available) available.push({ id: "jdbc", label: t("settings.updateJdbc"), count: 1 });
if (mcpAvailable.value) available.push({ id: "mcp", label: t("settings.updateMcp"), count: 1 });
if (props.pluginUpdates.length) available.push({ id: "plugins", label: t("settings.updatePlugins"), count: props.pluginUpdates.length });
- return available.length ? available : [{ id: "app" as const, label: t("settings.updateClient"), count: 0 }];
+ return available;
});
const totalUpdateCount = computed(() => tabs.value.reduce((total, tab) => total + tab.count, 0));
const hasComponentUpdates = computed(() => props.driverUpdates.length > 0 || props.jdbcUpdate?.update_available === true || mcpAvailable.value || props.pluginUpdates.length > 0);
@@ -193,7 +193,7 @@ watch(
</DialogHeader>
<div class="flex min-h-0 flex-1 flex-col">
- <div class="border-b px-4 py-2">
+ <div v-if="tabs.length" class="border-b px-4 py-2">
<div role="tablist" :aria-label="t('updates.centerTitle')" class="inline-flex h-9 w-full items-center justify-center rounded-md bg-muted p-[3px] text-muted-foreground">
<button
v-for="tab in tabs"