mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-05-01 13:03:01 +00:00
HTMX's `revealed` trigger fires each time the plugins tab becomes visible (Alpine's x-show toggles display:none which re-triggers the IntersectionObserver). Each re-reveal fetches a fresh empty HTML skeleton via hx-swap="innerHTML". The htmx:afterSwap handler reset window.pluginManager.initialized/initializing but not pluginsInitialized, so initializePlugins() hit its guard and skipped loadInstalledPlugins() and searchPluginStore() — leaving the fresh empty DOM unpopulated. Fix: also reset pluginsInitialized = false in the afterSwap handler. Existing caches (3s for installed plugins, 5min for store) mean tab revisits within the TTL render from cache instantly with no extra API traffic. Also change refreshPlugins() to call refreshInstalledPlugins() (which already exists and explicitly invalidates the cache) instead of the bare loadInstalledPlugins() call that could silently skip the fetch if the 3-second cache happened to still be valid. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>