From fdb34732cc64812c9068c07172072bd20f30084c Mon Sep 17 00:00:00 2001 From: InfinityPacer <160988576+InfinityPacer@users.noreply.github.com> Date: Thu, 18 Jun 2026 18:52:54 +0800 Subject: [PATCH] fix(plugin): refine release version history UI (#495) --- .../dialog/PluginMarketDetailDialog.vue | 32 ++++- .../dialog/PluginVersionHistoryDialog.vue | 119 +++++++++--------- src/components/misc/VersionHistory.vue | 108 ++++++++++++---- 3 files changed, 173 insertions(+), 86 deletions(-) diff --git a/src/components/dialog/PluginMarketDetailDialog.vue b/src/components/dialog/PluginMarketDetailDialog.vue index 2ad9e358..c4fb2616 100644 --- a/src/components/dialog/PluginMarketDetailDialog.vue +++ b/src/components/dialog/PluginMarketDetailDialog.vue @@ -227,12 +227,11 @@ onUnmounted(() => { class="mb-3" :text="props.plugin?.system_version_message || t('plugin.incompatibleSystemVersion')" /> -
+
{{ t('plugin.versionHistory') }} @@ -244,7 +243,7 @@ onUnmounted(() => { > {{ t('plugin.installToLocal') }} -
+
{{ t('plugin.totalDownloads', { count: formatDownloadCount(props.count) }) }}
@@ -257,3 +256,30 @@ onUnmounted(() => { + + diff --git a/src/components/dialog/PluginVersionHistoryDialog.vue b/src/components/dialog/PluginVersionHistoryDialog.vue index 437dbeec..900fb0e0 100644 --- a/src/components/dialog/PluginVersionHistoryDialog.vue +++ b/src/components/dialog/PluginVersionHistoryDialog.vue @@ -67,6 +67,8 @@ const latestActionText = computed(() => props.actionMode === 'install' ? t('plug const releaseItems = computed(() => releaseDetail.value?.items || []) +const shouldShowUpdatePanel = computed(() => props.showUpdateAction) + const releaseByHistoryVersion = computed(() => { const releaseMap = new Map() releaseItems.value.forEach(item => { @@ -90,6 +92,11 @@ function releaseItemByHistoryVersion(version: string) { return releaseByHistoryVersion.value.get(version) } +function shouldShowReleaseButton(item?: PluginReleaseVersion) { + if (!item || item.is_current) return false + return !(item.is_latest && shouldShowUpdatePanel.value && props.actionMode === 'update') +} + async function loadPluginHistory() { if (!props.plugin?.id) { pluginDetail.value = null @@ -130,7 +137,7 @@ async function loadPluginHistory() { } async function loadPluginReleases(plugin: Plugin | null | undefined = resolvedPlugin.value, force = false) { - if (!plugin?.id || !plugin?.repo_url) { + if (!plugin?.id || !plugin?.repo_url || !plugin.release) { releaseDetail.value = null releaseError.value = '' return @@ -190,47 +197,47 @@ watch( - - -