From 484da1f2638b5fdd678c5431d33abacb274dc18d Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sun, 22 Mar 2026 18:42:50 -0400 Subject: [PATCH] feat: show update available when catalog version differs from installed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Catalog partial now compares catalog version vs installed plugin.yaml version. Gold border + "Update available — installed vX.Y.Z" badge when newer. Update button uses btn-warn styling. Route passes installed_versions dict. Co-Authored-By: Claude Sonnet 4.6 --- fabledscryer/settings/routes.py | 2 ++ .../templates/settings/_catalog_partial.html | 23 +++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/fabledscryer/settings/routes.py b/fabledscryer/settings/routes.py index ad2d4e9..f7af564 100644 --- a/fabledscryer/settings/routes.py +++ b/fabledscryer/settings/routes.py @@ -256,11 +256,13 @@ async def plugins_catalog(): discovered = _discover_plugins() installed_names = {p["_dir"] for p in discovered} + installed_versions = {p["_dir"]: p.get("version", "0.0.0") for p in discovered} return await render_template( "settings/_catalog_partial.html", catalog=catalog, installed_names=installed_names, + installed_versions=installed_versions, loaded_names=_LOADED_PLUGINS, error=error, ) diff --git a/fabledscryer/templates/settings/_catalog_partial.html b/fabledscryer/templates/settings/_catalog_partial.html index cc3afd8..06887ed 100644 --- a/fabledscryer/templates/settings/_catalog_partial.html +++ b/fabledscryer/templates/settings/_catalog_partial.html @@ -12,17 +12,27 @@ {% for plugin in catalog %} {% set is_installed = plugin.name in installed_names %} {% set is_loaded = plugin.name in loaded_names %} -
+ {% set installed_ver = installed_versions.get(plugin.name, "") %} + {# update_available: catalog version is strictly newer than what's on disk #} + {% set update_available = is_installed and installed_ver and installed_ver != plugin.version %} + +
{{ plugin.name }} v{{ plugin.version }} - {% if is_loaded %} + + {% if update_available %} + + Update available — installed v{{ installed_ver }} + + {% elif is_loaded %} Active {% elif is_installed %} Installed {% endif %} + {% for tag in plugin.tags %} {{ tag }} {% endfor %} @@ -46,8 +56,8 @@ class="btn btn-ghost btn-sm" style="font-size:0.78rem;">Source {% endif %} - {% if is_loaded %} - {# Already active — update available if versions differ #} + {% if update_available %} + {# Installed but outdated — offer update (download + restart) #}
- +
+ {% elif is_loaded %} + {# Active and up to date — no action needed #} + {% elif is_installed %} {# Installed but not active — offer hot-reload #}