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。

fix(plugins): scroll marketplace detail and collapse history

弈秋2ea94eaad05e
diff --git a/apps/desktop/src/components/plugins/PluginContributionsPanel.vue b/apps/desktop/src/components/plugins/PluginContributionsPanel.vue
index 8eb03fbc50..08b9a7a238 100644
--- a/apps/desktop/src/components/plugins/PluginContributionsPanel.vue
+++ b/apps/desktop/src/components/plugins/PluginContributionsPanel.vue
@@ -1,6 +1,36 @@
<script setup lang="ts">
import { computed, defineComponent, h, nextTick, onBeforeUnmount, onMounted, ref, watch, TransitionGroup } from "vue";
-import { ArrowUp, BadgeCheck, Check, ChevronRight, CircleAlert, Download, ExternalLink, FileUp, FolderTree, Globe, Info, LayoutGrid, Link2, List, Loader2, PackageCheck, Pencil, Pin, PinOff, Plus, RefreshCw, RotateCcw, Search, Settings2, ShieldCheck, Store, Trash2, X } from "@lucide/vue";
+import {
+ ArrowUp,
+ BadgeCheck,
+ Check,
+ ChevronDown,
+ ChevronRight,
+ CircleAlert,
+ Download,
+ ExternalLink,
+ FileUp,
+ FolderTree,
+ Globe,
+ Info,
+ LayoutGrid,
+ Link2,
+ List,
+ Loader2,
+ PackageCheck,
+ Pencil,
+ Pin,
+ PinOff,
+ Plus,
+ RefreshCw,
+ RotateCcw,
+ Search,
+ Settings2,
+ ShieldCheck,
+ Store,
+ Trash2,
+ X,
+} from "@lucide/vue";
import { Badge } from "@/components/ui/badge";
import { isSensitivePluginPermission } from "@/lib/plugins/pluginPermissions";
import { Button } from "@/components/ui/button";
@@ -46,7 +76,7 @@ import type { PluginCenterFocus } from "@/lib/plugins/pluginCenterNavigation";
import { useConnectionStore } from "@/stores/connectionStore";
import { useQueryStore } from "@/stores/queryStore";
import { useSettingsStore } from "@/stores/settingsStore";
-import type { ConnectionConfig, InstalledPlugin, PluginInstallResult, PluginRepository, PluginRepositoryCatalogResult, PluginTrustedKey } from "@/types/database";
+import type { ConnectionConfig, InstalledPlugin, PluginInstallResult, PluginMarketplaceVersion, PluginRepository, PluginRepositoryCatalogResult, PluginTrustedKey } from "@/types/database";
import { useI18n } from "vue-i18n";
import { safeLocalStorageGet, safeLocalStorageSet } from "@/lib/backend/safeStorage";
import { translateBackendError } from "@/i18n/backend-errors";
@@ -276,6 +306,38 @@ const selectedMarketplaceVersions = computed(() => {
const versions = selectedMarketplaceListing.value?.plugin.versions || [];
return [...versions].sort((left, right) => compareVersions(right.version, left.version));
});
+// Update history keeps every release collapsed by default so a long history stays
+// scannable: only the newest release starts expanded, and users can expand any
+// version's notes. Switching to another plugin re-expands that plugin's newest one.
+const expandedMarketplaceVersions = ref<Set<string>>(new Set());
+watch(
+ selectedMarketplaceVersions,
+ (versions) => {
+ expandedMarketplaceVersions.value = new Set(versions.length ? [versions[0].version] : []);
+ },
+ { immediate: true },
+);
+function isMarketplaceVersionExpanded(version: string): boolean {
+ return expandedMarketplaceVersions.value.has(version);
+}
+function toggleMarketplaceVersion(version: string): void {
+ const next = new Set(expandedMarketplaceVersions.value);
+ if (next.has(version)) next.delete(version);
+ else next.add(version);
+ expandedMarketplaceVersions.value = next;
+}
+function marketplaceVersionPublishedLabel(version: PluginMarketplaceVersion): string {
+ const date = formatMarketplaceReleasedDate(version.releasedAt, appLocale.value);
+ return date ? t("pluginPlatform.pluginDetailsPublishedOn", { date }) : "";
+}
+// The expanded entry links to the release page for that exact version in the
+// plugin's source repository, mirroring the 更新管理 panel's GitHub Release button.
+function marketplaceVersionReleaseUrl(version: PluginMarketplaceVersion): string {
+ const source = selectedMarketplaceListing.value?.plugin.source?.trim();
+ if (!source) return "";
+ const tag = version.version.startsWith("v") ? version.version : `v${version.version}`;
+ return `${source.replace(/\/+$/, "")}/releases/tag/${encodeURIComponent(tag)}`;
+}
const batchUpdatableListings = computed(() => filteredMarketplaceListings.value.filter((listing) => listing.status === "update"));
const batchSelectedListings = computed(() => filteredMarketplaceListings.value.filter((listing) => isBatchSelectableListing(listing.status) && selectedListingKeys.value.has(listing.key)));
const batchSelectedInstalled = computed(() => definitions.value.filter((definition) => selectedInstalledIds.value.has(definition.plugin.manifest.id)));
@@ -2003,7 +2065,7 @@ onBeforeUnmount(() => {
</Tabs>
<Dialog :open="marketplaceDetailOpen" @update:open="(open: boolean) => (open ? (marketplaceDetailOpen = true) : closeMarketplaceDetails())">
- <DialogContent class="max-h-[min(90vh,52rem)] max-w-3xl gap-0 overflow-hidden p-0" @close-auto-focus="restoreMarketplaceDetailFocus">
+ <DialogContent class="max-h-[min(90vh,52rem)] max-w-3xl gap-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden p-0" @close-auto-focus="restoreMarketplaceDetailFocus">
<template v-if="selectedMarketplaceListing">
<DialogHeader class="@container border-b px-6 py-3 pr-14 text-left">
<div class="grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-3 gap-y-4 @min-[34rem]:grid-cols-[auto_minmax(0,1fr)_auto]">
@@ -2101,14 +2163,26 @@ onBeforeUnmount(() => {
<TabsContent value="updates" class="mt-0 space-y-3">
<div v-if="!selectedMarketplaceVersions.length" class="rounded-lg border border-dashed p-6 text-center text-xs text-muted-foreground">{{ t("pluginPlatform.noVersionHistory") }}</div>
- <div v-for="version in selectedMarketplaceVersions" :key="version.version" class="rounded-lg border p-3">
- <div class="flex flex-wrap items-baseline justify-between gap-2">
- <span class="font-medium">v{{ version.version }}</span
- ><span class="text-xs text-muted-foreground">{{ formatMarketplaceReleasedDate(version.releasedAt, appLocale) || "—" }}</span>
- </div>
- <p class="mt-2 whitespace-pre-wrap text-xs leading-5 text-muted-foreground">{{ version.releaseNotes || t("pluginPlatform.noReleaseNotes") }}</p>
- <div v-if="version.artifacts.length" class="mt-2 flex flex-wrap gap-1.5">
- <Badge v-for="artifact in version.artifacts" :key="artifact.target" variant="secondary" class="font-mono text-[10px]">{{ artifact.target }}</Badge>
+ <div v-for="version in selectedMarketplaceVersions" :key="version.version" class="overflow-hidden rounded-lg border">
+ <button
+ type="button"
+ class="flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ :aria-expanded="isMarketplaceVersionExpanded(version.version)"
+ @click="toggleMarketplaceVersion(version.version)"
+ >
+ <span class="shrink-0 font-medium text-xs">v{{ version.version }}</span>
+ <span class="min-w-0 flex-1 truncate text-xs text-muted-foreground">{{ marketplaceVersionPublishedLabel(version) || "—" }}</span>
+ <ChevronDown class="size-4 shrink-0 text-muted-foreground transition-transform" :class="isMarketplaceVersionExpanded(version.version) ? 'rotate-180' : ''" />
+ </button>
+ <div v-if="isMarketplaceVersionExpanded(version.version)" class="border-t px-3 py-2.5">
+ <p class="whitespace-pre-wrap text-xs leading-5 text-muted-foreground">{{ version.releaseNotes || t("pluginPlatform.noReleaseNotes") }}</p>
+ <div v-if="version.artifacts.length" class="mt-2 flex flex-wrap gap-1.5">
+ <Badge v-for="artifact in version.artifacts" :key="artifact.target" variant="secondary" class="font-mono text-[10px]">{{ artifact.target }}</Badge>
+ </div>
+ <Button v-if="marketplaceVersionReleaseUrl(version)" type="button" variant="ghost" size="sm" class="mt-3 h-7 gap-1.5 px-2 text-xs" @click.stop="openExternal(marketplaceVersionReleaseUrl(version))">
+ <ExternalLink class="size-3" />
+ {{ t("pluginPlatform.pluginDetailsOpenRelease") }}
+ </Button>
</div>
</div>
</TabsContent>
diff --git a/apps/desktop/src/components/plugins/__tests__/PluginContributionsPanelBatch.spec.ts b/apps/desktop/src/components/plugins/__tests__/PluginContributionsPanelBatch.spec.ts
index 3cada889aa..2201a852a7 100644
--- a/apps/desktop/src/components/plugins/__tests__/PluginContributionsPanelBatch.spec.ts
+++ b/apps/desktop/src/components/plugins/__tests__/PluginContributionsPanelBatch.spec.ts
@@ -1639,6 +1639,69 @@ describe("marketplace detail launch", () => {
});
});
+describe("marketplace detail update history", () => {
+ function multiVersionCatalog(): PluginRepositoryCatalogResult {
+ const result = catalog("repo", ["a"]);
+ const plugin = result.catalog!.plugins[0];
+ plugin.latestVersion = "3.0.0";
+ plugin.source = "https://github.com/jinpy/dbx-ssh-plugin";
+ const artifact = { target: "darwin-arm64", url: "https://example.invalid/plugin.dbxp", sha256: "a".repeat(64), signingKeyId: "test.key" };
+ plugin.versions = [
+ { version: "3.0.0", releasedAt: "2026-10-14T00:00:00.000Z", releaseNotes: "Third release notes", artifacts: [artifact] },
+ { version: "2.0.0", releasedAt: "2026-10-13T00:00:00.000Z", releaseNotes: "Second release notes", artifacts: [] },
+ { version: "1.0.0", releasedAt: "", releaseNotes: "", artifacts: [] },
+ ];
+ return result;
+ }
+
+ it("starts with only the newest release expanded and toggles notes per version", async () => {
+ state.catalogResults = [multiVersionCatalog()];
+ await flushUi();
+ state.openMarketplaceDetails(state.marketplaceListings[0]);
+ await flushUi();
+ const dialog = document.querySelector('[role="dialog"]')!;
+ const headers = [...dialog.querySelectorAll("button[aria-expanded]")];
+ expect(headers.length).toBe(3);
+ // Newest release starts expanded; older versions stay collapsed so a long
+ // history remains scannable.
+ expect(headers.map((header) => header.getAttribute("aria-expanded"))).toEqual(["true", "false", "false"]);
+ expect(dialog.textContent).toContain("Third release notes");
+ expect(dialog.textContent).not.toContain("Second release notes");
+
+ // Expanding an older version reveals its notes; collapsing hides them again.
+ headers[1].click();
+ await flushUi();
+ expect(headers[1].getAttribute("aria-expanded")).toBe("true");
+ expect(dialog.textContent).toContain("Second release notes");
+
+ headers[1].click();
+ await flushUi();
+ expect(headers[1].getAttribute("aria-expanded")).toBe("false");
+ expect(dialog.textContent).not.toContain("Second release notes");
+
+ // The auto-expanded newest release can be collapsed too.
+ headers[0].click();
+ await flushUi();
+ expect(headers[0].getAttribute("aria-expanded")).toBe("false");
+ expect(dialog.textContent).not.toContain("Third release notes");
+ });
+
+ it("links each expanded version to its GitHub release page", async () => {
+ const openSpy = vi.spyOn(window, "open").mockImplementation(() => null);
+ state.catalogResults = [multiVersionCatalog()];
+ await flushUi();
+ state.openMarketplaceDetails(state.marketplaceListings[0]);
+ await flushUi();
+ const dialog = document.querySelector('[role="dialog"]')!;
+ const releaseButton = [...dialog.querySelectorAll("button")].find((element) => element.textContent?.includes("pluginPlatform.pluginDetailsOpenRelease"))!;
+ expect(releaseButton).toBeDefined();
+ releaseButton.click();
+ await flushUi();
+ expect(openSpy).toHaveBeenCalledWith("https://github.com/jinpy/dbx-ssh-plugin/releases/tag/v3.0.0", "_blank", "noopener,noreferrer");
+ openSpy.mockRestore();
+ });
+});
+
describe("marketplace author filtering", () => {
it("shows exact author matches across repositories and clears prior filters", async () => {
const first = catalog("first", ["a", "b", "c"]);
diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.ts
index b66cc69a91..d9ecc63719 100644
--- a/apps/desktop/src/i18n/locales/en.ts
+++ b/apps/desktop/src/i18n/locales/en.ts
@@ -570,6 +570,8 @@ export default {
pluginDetailsReleaseDate: "Release date",
noVersionHistory: "No version history available.",
noReleaseNotes: "No release notes provided.",
+ pluginDetailsPublishedOn: "Released {date}",
+ pluginDetailsOpenRelease: "GitHub Release",
noPermissions: "No special permissions declared.",
pluginDetailsCompatibility: "Compatibility",
pluginDetailsCurrentTarget: "Current target",
diff --git a/apps/desktop/src/i18n/locales/es.ts b/apps/desktop/src/i18n/locales/es.ts
index b096ce59af..b009c85a61 100644
--- a/apps/desktop/src/i18n/locales/es.ts
+++ b/apps/desktop/src/i18n/locales/es.ts
@@ -423,6 +423,8 @@ export default withEnglishFallback({
pluginDetailsReleaseDate: "Release date",
noVersionHistory: "No version history available.",
noReleaseNotes: "No release notes provided.",
+ pluginDetailsPublishedOn: "Released {date}",
+ pluginDetailsOpenRelease: "GitHub Release",
noPermissions: "No special permissions declared.",
pluginDetailsCompatibility: "Compatibility",
pluginDetailsCurrentTarget: "Current target",
diff --git a/apps/desktop/src/i18n/locales/id.ts b/apps/desktop/src/i18n/locales/id.ts
index 4ba25b16b9..b9d1129ead 100644
--- a/apps/desktop/src/i18n/locales/id.ts
+++ b/apps/desktop/src/i18n/locales/id.ts
@@ -203,6 +203,8 @@ export default withEnglishFallback({
pluginDetailsReleaseDate: "Release date",
noVersionHistory: "No version history available.",
noReleaseNotes: "No release notes provided.",
+ pluginDetailsPublishedOn: "Released {date}",
+ pluginDetailsOpenRelease: "GitHub Release",
noPermissions: "No special permissions declared.",
pluginDetailsCompatibility: "Compatibility",
pluginDetailsCurrentTarget: "Current target",
diff --git a/apps/desktop/src/i18n/locales/it.ts b/apps/desktop/src/i18n/locales/it.ts
index b2cd8933e8..d9d68e713f 100644
--- a/apps/desktop/src/i18n/locales/it.ts
+++ b/apps/desktop/src/i18n/locales/it.ts
@@ -421,6 +421,8 @@ export default withEnglishFallback({
pluginDetailsReleaseDate: "Release date",
noVersionHistory: "No version history available.",
noReleaseNotes: "No release notes provided.",
+ pluginDetailsPublishedOn: "Released {date}",
+ pluginDetailsOpenRelease: "GitHub Release",
noPermissions: "No special permissions declared.",
pluginDetailsCompatibility: "Compatibility",
pluginDetailsCurrentTarget: "Current target",
diff --git a/apps/desktop/src/i18n/locales/ja.ts b/apps/desktop/src/i18n/locales/ja.ts
index 2f30cf2121..9643044e05 100644
--- a/apps/desktop/src/i18n/locales/ja.ts
+++ b/apps/desktop/src/i18n/locales/ja.ts
@@ -422,6 +422,8 @@ export default withEnglishFallback({
pluginDetailsReleaseDate: "Release date",
noVersionHistory: "No version history available.",
noReleaseNotes: "No release notes provided.",
+ pluginDetailsPublishedOn: "Released {date}",
+ pluginDetailsOpenRelease: "GitHub Release",
noPermissions: "No special permissions declared.",
pluginDetailsCompatibility: "Compatibility",
pluginDetailsCurrentTarget: "Current target",
diff --git a/apps/desktop/src/i18n/locales/ko.ts b/apps/desktop/src/i18n/locales/ko.ts
index a7811e97bc..359a5281cc 100644
--- a/apps/desktop/src/i18n/locales/ko.ts
+++ b/apps/desktop/src/i18n/locales/ko.ts
@@ -425,6 +425,8 @@ export default withEnglishFallback({
pluginDetailsReleaseDate: "Release date",
noVersionHistory: "No version history available.",
noReleaseNotes: "No release notes provided.",
+ pluginDetailsPublishedOn: "Released {date}",
+ pluginDetailsOpenRelease: "GitHub Release",
noPermissions: "No special permissions declared.",
pluginDetailsCompatibility: "Compatibility",
pluginDetailsCurrentTarget: "Current target",
diff --git a/apps/desktop/src/i18n/locales/pt-BR.ts b/apps/desktop/src/i18n/locales/pt-BR.ts
index 5ad6774d7c..930ebd8b44 100644
--- a/apps/desktop/src/i18n/locales/pt-BR.ts
+++ b/apps/desktop/src/i18n/locales/pt-BR.ts
@@ -422,6 +422,8 @@ export default withEnglishFallback({
pluginDetailsReleaseDate: "Release date",
noVersionHistory: "No version history available.",
noReleaseNotes: "No release notes provided.",
+ pluginDetailsPublishedOn: "Released {date}",
+ pluginDetailsOpenRelease: "GitHub Release",
noPermissions: "No special permissions declared.",
pluginDetailsCompatibility: "Compatibility",
pluginDetailsCurrentTarget: "Current target",
diff --git a/apps/desktop/src/i18n/locales/ru.ts b/apps/desktop/src/i18n/locales/ru.ts
index 1ccb386377..95cb7b224d 100644
--- a/apps/desktop/src/i18n/locales/ru.ts
+++ b/apps/desktop/src/i18n/locales/ru.ts
@@ -393,6 +393,8 @@ export default withEnglishFallback({
pluginDetailsReleaseDate: "Release date",
noVersionHistory: "No version history available.",
noReleaseNotes: "No release notes provided.",
+ pluginDetailsPublishedOn: "Released {date}",
+ pluginDetailsOpenRelease: "GitHub Release",
noPermissions: "No special permissions declared.",
pluginDetailsCompatibility: "Compatibility",
pluginDetailsCurrentTarget: "Current target",
diff --git a/apps/desktop/src/i18n/locales/th.ts b/apps/desktop/src/i18n/locales/th.ts
index 56ca825411..24242e4362 100644
--- a/apps/desktop/src/i18n/locales/th.ts
+++ b/apps/desktop/src/i18n/locales/th.ts
@@ -530,6 +530,8 @@ export default withEnglishFallback({
pluginDetailsReleaseDate: "วันที่เผยแพร่",
noVersionHistory: "ไม่มีประวัติเวอร์ชัน",
noReleaseNotes: "ไม่มีบันทึกการเผยแพร่",
+ pluginDetailsPublishedOn: "เผยแพร่เมื่อ {date}",
+ pluginDetailsOpenRelease: "รุ่น GitHub",
noPermissions: "ไม่มีการประกาศสิทธิ์พิเศษ",
pluginDetailsCompatibility: "ความเข้ากันได้",
pluginDetailsCurrentTarget: "เป้าหมายปัจจุบัน",
diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.ts
index 0cd33cea1f..37e0da08ba 100644
--- a/apps/desktop/src/i18n/locales/zh-CN.ts
+++ b/apps/desktop/src/i18n/locales/zh-CN.ts
@@ -510,6 +510,8 @@ export default withEnglishFallback({
pluginDetailsReleaseDate: "发布日期",
noVersionHistory: "暂无版本历史。",
noReleaseNotes: "开发者未提供更新说明。",
+ pluginDetailsPublishedOn: "发布于 {date}",
+ pluginDetailsOpenRelease: "GitHub Release",
noPermissions: "未声明特殊权限。",
pluginDetailsCompatibility: "兼容性",
pluginDetailsCurrentTarget: "当前目标平台",
diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.ts
index 2d0b29bfb3..95206a2173 100644
--- a/apps/desktop/src/i18n/locales/zh-TW.ts
+++ b/apps/desktop/src/i18n/locales/zh-TW.ts
@@ -423,6 +423,8 @@ export default withEnglishFallback({
pluginDetailsReleaseDate: "Release date",
noVersionHistory: "No version history available.",
noReleaseNotes: "No release notes provided.",
+ pluginDetailsPublishedOn: "Released {date}",
+ pluginDetailsOpenRelease: "GitHub Release",
noPermissions: "No special permissions declared.",
pluginDetailsCompatibility: "Compatibility",
pluginDetailsCurrentTarget: "Current target",