From b123ab3258924cd6c7d9792832893f7e05c69a7e Mon Sep 17 00:00:00 2001 From: Byron Gamatos Date: Tue, 23 Jun 2026 16:30:00 +0200 Subject: [PATCH] fix(minigames): drain legacy slopsmith pending queue + alias SDK (#578) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After the slopsmith→feedBack rename (#537) the minigames SDK publishes window.feedBackMinigames and only drains window.__feedBackMinigamesPending. Minigame plugins that still use the pre-rename shim register against window.slopsmithMinigames and queue to window.__slopsmithMinigamesPending when the SDK isn't up yet, so their specs are stranded in the legacy queue and never register. In v3, FeedBarcade renders those games as non-launchable "Loading…" tiles that do nothing on click (the tile itself comes from the server registry, so it appears even though the JS spec never registered). Publish window.slopsmithMinigames as an alias and drain the legacy pending queue too (register() is keyed on spec.id, so double-queued specs register once). Also fire the legacy slopsmith-minigames-ready event. Bump the plugin version so the desktop renderer cache-busts the updated screen.js. This rescues every not-yet-migrated minigame plugin, including community ones we don't control. Co-authored-by: Claude Opus 4.8 (1M context) --- plugins/minigames/plugin.json | 2 +- plugins/minigames/screen.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/plugins/minigames/plugin.json b/plugins/minigames/plugin.json index 0bc80ad..d142040 100644 --- a/plugins/minigames/plugin.json +++ b/plugins/minigames/plugin.json @@ -1,7 +1,7 @@ { "id": "minigames", "name": "Minigames", - "version": "0.1.0", + "version": "0.1.1", "bundled": true, "private": false, "screen": "screen.html", diff --git a/plugins/minigames/screen.js b/plugins/minigames/screen.js index 5e6016c..66bbb00 100644 --- a/plugins/minigames/screen.js +++ b/plugins/minigames/screen.js @@ -961,7 +961,25 @@ // Drain queue of plugins that loaded before us. (window.__feedBackMinigamesPending || []).forEach(register); window.__feedBackMinigamesPending = null; + + // ── Back-compat for pre-rename minigame plugins ─────────────────────── + // Minigame plugins published before the slopsmith→feedBack rename (#537) + // register against `window.slopsmithMinigames` and, when the SDK isn't up + // yet, queue to `window.__slopsmithMinigamesPending`. The rename moved the + // SDK to `window.feedBackMinigames` and only drains the feedBack queue, so + // those plugins' specs — including community ones we don't control — get + // stranded in the legacy queue and never register. Their FeedBarcade tiles + // then render as dead "Loading…" placeholders that do nothing on click. + // Alias the SDK under the old name and drain the legacy pending queue too. + // register() is keyed on spec.id, so a plugin that queued under both names + // still registers exactly once. + window.slopsmithMinigames = sdk; + (window.__slopsmithMinigamesPending || []).forEach(register); + window.__slopsmithMinigamesPending = null; + window.dispatchEvent(new CustomEvent('feedBack-minigames-ready')); + // Legacy event name for any pre-rename listener still bound to it. + window.dispatchEvent(new CustomEvent('slopsmith-minigames-ready')); // ── Wire hub render to screen lifecycle ─────────────────────────────── // FeedBack mounts plugin screens with id "plugin-" and