From 560527159abd3c6f83a76b35301be87a642644e0 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Fri, 26 Jun 2026 16:01:32 -0400 Subject: [PATCH] Navigation reflects plugin enable/disable immediately The nav endpoint now skips disabled plugins (checks the registry), so disabling a plugin removes it from the menu right away without a restart. Its API routes remain registered until the next restart (Flask cannot unregister a blueprint at runtime), but users no longer see links to it. Co-Authored-By: Claude Opus 4.8 --- shopdb/core/api/dashboard.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shopdb/core/api/dashboard.py b/shopdb/core/api/dashboard.py index 52c48a4..7ed5610 100644 --- a/shopdb/core/api/dashboard.py +++ b/shopdb/core/api/dashboard.py @@ -120,9 +120,14 @@ def get_navigation(): {'name': 'Map', 'icon': 'map', 'route': '/map', 'position': 4}, ]) - # Collect navigation items from all plugins + # Collect navigation items from enabled plugins. Disabling persists to the + # registry immediately, so a disabled plugin drops out of the menu right + # away (its routes stay registered until the next restart - Flask cannot + # unregister a blueprint at runtime). for name, plugin in pm.get_all_plugins().items(): try: + if not pm.registry.is_enabled(name): + continue items = plugin.get_navigation_items() for item in items: item['plugin'] = name