From 8aa620a7daed29cf0a285474a20045234634e8de Mon Sep 17 00:00:00 2001 From: lzt404 <2596933790@qq.com> Date: Mon, 24 Aug 2026 22:25:06 +0800 Subject: [PATCH] refactor: reduce persistent status noise on version management - Hide the core running PID badge during normal operation - Remove redundant up-to-date indicators - Hide the model catalog status badge when idle - Show status badges only for updates, progress, missing installations, or errors - Preserve one-time feedback after manual model catalog synchronization --- src/pages/VersionManagementPage.tsx | 87 ++++++++++++----------------- 1 file changed, 37 insertions(+), 50 deletions(-) diff --git a/src/pages/VersionManagementPage.tsx b/src/pages/VersionManagementPage.tsx index 955e420..751244c 100644 --- a/src/pages/VersionManagementPage.tsx +++ b/src/pages/VersionManagementPage.tsx @@ -423,51 +423,36 @@ export function VersionManagementPage() { const latestAppVersion = appUpdate?.latestVersion ? displayAppVersion(appUpdate.latestVersion) : ''; const appHasUpdate = Boolean(appUpdate?.updateAvailable); - const appVersionStatusTone = appUpdateError - ? 'error' - : appUpdateTask.running - ? 'update' - : appHasUpdate - ? 'update' - : appUpdate - ? 'success' - : ''; - - const appVersionStatusLabel = appUpdateTask.running + const appVersionStatusLabel: string | null = appUpdateTask.running ? t(`appUpdate.phase.${appUpdateTask.phase}` as Parameters[0]) : appUpdateError ? t('kernel.update.failed') : appHasUpdate ? t('appUpdate.available', { version: latestAppVersion }) - : appUpdate - ? t('appUpdate.upToDate') - : t('appUpdate.phase.checking'); + : checkingAppUpdate || !appUpdate + ? t('appUpdate.phase.checking') + : null; + const appVersionStatusTone = appUpdateError ? 'error' : 'update'; const coreHasUpdate = Boolean(latestVersion && currentVersion && currentVersion !== latestVersion); const coreVersionStatusTone = installing || progress?.running ? 'info' - : coreRunning - ? 'success' - : latestError - ? 'error' - : coreHasUpdate - ? 'update' - : coreInstalled - ? 'success' - : 'neutral'; + : latestError + ? 'error' + : coreHasUpdate + ? 'update' + : 'neutral'; - const coreVersionStatusLabel = installing || progress?.running + const coreVersionStatusLabel: string | null = installing || progress?.running ? (cancellingInstall ? t('kernel.install.cancelling') : progress?.phase ? localizeInstallPhase(progress.phase, t) : t('kernel.install.inProgress')) - : coreRunning - ? `${t('kernel.status.running')}${coreStatus?.processId ? ` (PID: ${coreStatus.processId})` : ''}` - : latestError - ? t('kernel.update.failed') - : coreHasUpdate - ? t('kernel.update.available') - : coreInstalled - ? t('kernel.status.stopped') - : t('kernel.status.notInstalled'); + : latestError + ? t('kernel.update.failed') + : coreHasUpdate + ? t('kernel.update.available') + : !coreInstalled + ? t('kernel.status.notInstalled') + : null; // Install dialog calculations const computedPercent = progress?.percent ?? (progress?.total && progress.total > 0 ? (progress.downloaded / progress.total) * 100 : null); @@ -583,9 +568,11 @@ export function VersionManagementPage() { {t('appUpdate.title')} - - {appVersionStatusLabel} - + {appVersionStatusLabel ? ( + + {appVersionStatusLabel} + + ) : null}
@@ -602,11 +589,11 @@ export function VersionManagementPage() {
{t('appUpdate.latest')} - {appUpdate ? (latestAppVersion || t('appUpdate.upToDate')) : (checkingAppUpdate ? t('appUpdate.checking') : t('common.detecting'))} + {appUpdate ? (latestAppVersion || currentAppVersion) : (checkingAppUpdate ? t('appUpdate.checking') : t('common.detecting'))} - - {appHasUpdate ? t('kernel.update.available') : t('kernel.update.latest')} - + {appHasUpdate ? ( + {t('kernel.update.available')} + ) : null}
@@ -673,9 +660,11 @@ export function VersionManagementPage() { {t('kernel.versions.title')} - - {coreVersionStatusLabel} - + {coreVersionStatusLabel ? ( + + {coreVersionStatusLabel} + + ) : null}
@@ -763,13 +752,11 @@ export function VersionManagementPage() { {t('appUpdate.catalog.label')}
- - {catalogUpdating - ? t('appUpdate.catalog.updating') - : catalogUpdateError - ? t('kernel.update.failed') - : t('appUpdate.catalog.unchanged')} - + {catalogUpdating || catalogUpdateError ? ( + + {catalogUpdating ? t('appUpdate.catalog.updating') : t('kernel.update.failed')} + + ) : null}