From 60deee2f7523ab7014454b16b554de3243cff230 Mon Sep 17 00:00:00 2001 From: Chuck Date: Mon, 16 Feb 2026 21:42:37 -0500 Subject: [PATCH] fix(store): semver-aware update badge and add missing gap-1.5 utility - Replace naive version !== comparison with isNewerVersion() that does semver greater-than check, preventing false "Update" badges on same-version or downgrade scenarios - Add missing .gap-1.5 CSS utility used by category pills and tag lists Co-Authored-By: Claude Opus 4.6 --- web_interface/static/v3/app.css | 1 + web_interface/static/v3/plugins_manager.js | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/web_interface/static/v3/app.css b/web_interface/static/v3/app.css index b22a179f..38036194 100644 --- a/web_interface/static/v3/app.css +++ b/web_interface/static/v3/app.css @@ -204,6 +204,7 @@ body { .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } +.gap-1\.5 { gap: 0.375rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; } .gap-4 { gap: 1rem; } diff --git a/web_interface/static/v3/plugins_manager.js b/web_interface/static/v3/plugins_manager.js index f7a677ce..cd290093 100644 --- a/web_interface/static/v3/plugins_manager.js +++ b/web_interface/static/v3/plugins_manager.js @@ -5593,7 +5593,7 @@ function renderPluginStore(plugins) { container.innerHTML = plugins.map(plugin => { const isInstalled = installedMap.has(plugin.id); const installedVersion = installedMap.get(plugin.id); - const hasUpdate = isInstalled && plugin.version && installedVersion && plugin.version !== installedVersion; + const hasUpdate = isInstalled && plugin.version && installedVersion && isNewerVersion(plugin.version, installedVersion); return `
@@ -6354,6 +6354,20 @@ function formatCommit(commit, branch) { return 'Latest'; } +// Check if storeVersion is strictly newer than installedVersion (semver-aware) +function isNewerVersion(storeVersion, installedVersion) { + const parse = (v) => (v || '').replace(/^v/, '').split('.').map(n => parseInt(n, 10) || 0); + const a = parse(storeVersion); + const b = parse(installedVersion); + const len = Math.max(a.length, b.length); + for (let i = 0; i < len; i++) { + const diff = (a[i] || 0) - (b[i] || 0); + if (diff > 0) return true; + if (diff < 0) return false; + } + return false; +} + // Check if plugin is new (updated within last 7 days) function isNewPlugin(lastUpdated) { if (!lastUpdated) return false;