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。

feat(updates): show shared changelog in update center (#13810)

雨下的樱花丷fb1144286ed1
diff --git a/apps/desktop/src/App.vue b/apps/desktop/src/App.vue
index 1c02b93345..76eaf9cfe0 100644
--- a/apps/desktop/src/App.vue
+++ b/apps/desktop/src/App.vue
@@ -5980,6 +5980,7 @@ onUnmounted(() => {
:component-updates-updating="componentUpdates.updating.value"
:updating-component="componentUpdates.updatingCategory.value"
:is-updating-all="updatingAllUpdates || componentUpdates.updating.value"
+ @check-updates="checkAllUpdates"
@open-latest-release="openLatestRelease"
@change-download-source="changeUpdateDownloadSource"
@download-in-background="downloadUpdateInBackground"
diff --git a/apps/desktop/src/components/layout/UpdateDialog.spec.ts b/apps/desktop/src/components/layout/UpdateDialog.spec.ts
index 404d96e83a..8c1482f407 100644
--- a/apps/desktop/src/components/layout/UpdateDialog.spec.ts
+++ b/apps/desktop/src/components/layout/UpdateDialog.spec.ts
@@ -447,6 +447,43 @@ describe("UpdateDialog release notes safety", () => {
});
});
+describe("UpdateDialog changelog", () => {
+ it("shows the shared changelog even when the current version has no update", async () => {
+ const checkUpdates = vi.fn();
+ updateMocks.fetchChangelog.mockResolvedValue({
+ updatedAt: "2026-10-28",
+ releases: [{ tag: "v0.5.60", name: "DBX v0.5.60", date: "2026-10-28", sections: [{ type: "fixed", title: "Fixed", items: [{ title: "A useful fix", desc: "Details of the fix" }] }] }],
+ });
+ await mountDialog(0, {}, undefined, { updateInfo: null, "onCheck-updates": checkUpdates });
+
+ const changelogTab = document.body.querySelector<HTMLButtonElement>('[data-update-tab="changelog"]');
+ expect(changelogTab).not.toBeNull();
+ changelogTab?.click();
+ await flushDialog();
+ buttonWithText("0.5.60")?.click();
+ await flushDialog();
+
+ expect(document.body.textContent).toContain("A useful fix");
+ expect(document.body.textContent).toContain("Details of the fix");
+ expect(downloadButton()).toBeUndefined();
+ const checkButton = buttonWithText(i18n.global.t("updates.check"));
+ expect(checkButton).toBeDefined();
+ checkButton?.click();
+ expect(checkUpdates).toHaveBeenCalledOnce();
+ });
+
+ it("keeps client update actions available after returning from the changelog", async () => {
+ const { downloadInBackground } = await mountDialog(0);
+ document.body.querySelector<HTMLButtonElement>('[data-update-tab="changelog"]')?.click();
+ await flushDialog();
+ expect(downloadButton()).toBeUndefined();
+ document.body.querySelector<HTMLButtonElement>('[data-update-tab="app"]')?.click();
+ await flushDialog();
+ downloadButton()?.click();
+ expect(downloadInBackground).toHaveBeenCalledOnce();
+ });
+});
+
describe("UpdateDialog older versions", () => {
const release = (tag: string, date: string) => ({ tag, name: `DBX ${tag}`, date, sections: [] });
const upToDateInfo = {
diff --git a/apps/desktop/src/components/layout/UpdateDialog.vue b/apps/desktop/src/components/layout/UpdateDialog.vue
index a57ce3ea05..37cb3547e2 100644
--- a/apps/desktop/src/components/layout/UpdateDialog.vue
+++ b/apps/desktop/src/components/layout/UpdateDialog.vue
@@ -17,9 +17,10 @@ import type { ComponentUpdateCategory } from "@/composables/useComponentUpdates"
import { currentLocale } from "@/i18n";
import { changelogLangFromLocale, createLatestRequestGuard, fetchChangelog, type ChangelogRelease } from "@/lib/app/changelog";
import DriverInstallProgressCircle from "@/components/config/DriverInstallProgressCircle.vue";
+import ChangelogPanel from "@/components/settings/ChangelogPanel.vue";
import { driverInstallProgressPercent, formatDriverInstallProgressText, type DriverInstallProgress } from "@/lib/connection/driverInstallProgressUi";
-type UpdateTab = "app" | ComponentUpdateCategory;
+type UpdateTab = "app" | "changelog" | ComponentUpdateCategory;
const open = defineModel<boolean>("open", { required: true });
@@ -70,6 +71,7 @@ const props = withDefaults(
);
const emit = defineEmits<{
+ "check-updates": [];
"open-latest-release": [];
"download-in-background": [];
"cancel-download": [];
@@ -126,11 +128,12 @@ 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 });
+ available.push({ id: "changelog", label: t("settings.changelogTitle"), 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);
-const selectedCategory = computed<ComponentUpdateCategory | null>(() => (selectedTab.value === "app" ? null : selectedTab.value));
+const selectedCategory = computed<ComponentUpdateCategory | null>(() => (selectedTab.value === "app" || selectedTab.value === "changelog" ? null : selectedTab.value));
const selectedCategoryHasUpdate = computed(() => {
if (selectedTab.value === "drivers") return props.driverUpdates.length > 0;
if (selectedTab.value === "jdbc") return props.jdbcUpdate?.update_available === true;
@@ -343,7 +346,7 @@ watch(
<div class="flex min-h-0 flex-1 flex-col">
<div v-if="tabs.length" class="px-5 pb-2.5 pt-1.5">
- <div role="tablist" :aria-label="t('updates.centerTitle')" class="inline-flex h-9 w-full items-center gap-1">
+ <div role="tablist" :aria-label="t('updates.centerTitle')" class="inline-flex h-9 w-full items-center gap-1 overflow-x-auto">
<button
v-for="tab in tabs"
:key="tab.id"
@@ -363,7 +366,8 @@ watch(
</div>
<div data-update-scroll-region class="min-h-0 flex-1 overflow-auto px-5 py-4 text-sm">
- <template v-if="selectedTab === 'app'">
+ <ChangelogPanel v-if="selectedTab === 'changelog'" :checking-updates="checkingUpdates || isInstallingUpdate" @check-updates="emit('check-updates')" />
+ <template v-else-if="selectedTab === 'app'">
<div class="space-y-3">
<p v-if="updateInfo?.update_available">
{{
@@ -552,7 +556,7 @@ watch(
</template>
</DialogFooter>
- <DialogFooter v-else data-update-footer class="mx-0 mb-0 min-w-0 rounded-none border-t px-[22px] pb-2.5 pt-2.5 sm:items-center sm:justify-end">
+ <DialogFooter v-else-if="selectedCategory" data-update-footer class="mx-0 mb-0 min-w-0 rounded-none border-t px-[22px] pb-2.5 pt-2.5 sm:items-center sm:justify-end">
<template v-if="isAnyComponentUpdating">
<Button variant="ghost" class="shrink-0" @click="handleOpenChange(false)">{{ t("updates.updateInBackground") }}</Button>
<Button class="shrink-0" disabled>