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): stop marketplace card version badge clipping in narrow panel

弈秋8da0c59f4273
diff --git a/apps/desktop/src/components/plugins/PluginContributionsPanel.vue b/apps/desktop/src/components/plugins/PluginContributionsPanel.vue
index e61bfdee1f..521a2a08fe 100644
--- a/apps/desktop/src/components/plugins/PluginContributionsPanel.vue
+++ b/apps/desktop/src/components/plugins/PluginContributionsPanel.vue
@@ -1022,7 +1022,7 @@ onBeforeUnmount(() => {
</div>
<div v-else-if="marketplaceViewMode === 'grid'" class="grid w-full grid-cols-1 gap-3 md:grid-cols-3">
<article v-for="listing in sortedMarketplaceListings" :key="listing.key" class="group flex min-w-0 min-h-48 flex-col rounded-xl border bg-card p-4 transition-colors hover:border-primary/40">
- <div class="flex items-start gap-3">
+ <div class="flex flex-wrap items-start gap-3">
<button
v-if="batchMode && isBatchSelectableListing(listing.status)"
type="button"
@@ -1067,7 +1067,7 @@ onBeforeUnmount(() => {
<Globe class="size-3.5" />
</button>
<span v-if="listing.latestVersionReleasedAt" class="shrink-0 text-[10px] text-muted-foreground">{{ formatMarketplaceReleasedDate(listing.latestVersionReleasedAt, appLocale) }}</span>
- <Badge variant="outline" class="h-5 px-1.5 text-[10px]">v{{ listing.plugin.latestVersion }}</Badge>
+ <Badge variant="outline" class="h-5 shrink-0 px-1.5 text-[10px]">v{{ listing.plugin.latestVersion }}</Badge>
</div>
</div>
<div class="mt-3 flex flex-wrap gap-1.5">
diff --git a/apps/desktop/src/components/plugins/__tests__/PluginContributionsPanelBatch.spec.ts b/apps/desktop/src/components/plugins/__tests__/PluginContributionsPanelBatch.spec.ts
index 61994220b9..cd77abf7d1 100644
--- a/apps/desktop/src/components/plugins/__tests__/PluginContributionsPanelBatch.spec.ts
+++ b/apps/desktop/src/components/plugins/__tests__/PluginContributionsPanelBatch.spec.ts
@@ -855,6 +855,28 @@ describe("PluginContributionsPanel marketplace sort", () => {
});
});
+describe("PluginContributionsPanel marketplace card layout", () => {
+ it("wraps the grid card header and pins the version badge so it never clips in a narrow panel", async () => {
+ state.batchMode = false;
+ state.marketplaceViewMode = "grid";
+ await nextTick();
+
+ const card = host.querySelector("article");
+ expect(card, "a marketplace grid card should render").not.toBeNull();
+
+ // The header row (icon + name + github/globe/date/version cluster) must be allowed to wrap,
+ // otherwise the non-shrinkable right cluster overflows the narrow column and the version
+ // badge is clipped (e.g. "v0.1.C") when the plugin center shares width with the AI panel.
+ const header = card!.querySelector(":scope > div");
+ expect(header?.classList.contains("flex-wrap"), "grid card header row should wrap").toBe(true);
+
+ // The version badge must not shrink, so it is never squished even when it stays on one line.
+ const versionBadge = [...host.querySelectorAll<HTMLElement>("[data-stub='Badge']")].find((element) => element.textContent?.trim() === "v3.0.0");
+ expect(versionBadge, "version badge should render").toBeDefined();
+ expect(versionBadge!.classList.contains("shrink-0"), "version badge should be shrink-0").toBe(true);
+ });
+});
+
describe("PluginContributionsPanel single uninstall outcomes", () => {
it("re-reads the installed list and notifies listeners when a single uninstall fails", async () => {
const changed = vi.fn();