From a06e50418339caac71284bfc9fbb17ad0a705f56 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Sun, 24 May 2026 00:52:48 +0200 Subject: [PATCH] Fix: StripOverlayLayer initialization timing issue Moved StripOverlayLayer and ConfirmationBar initialization to occur AFTER ScryingPoolStrip is created (via roleRenderer.openStrip()). This fixes the console warning: 'StripOverlayLayer: ScryingPoolStrip not found, appending to body' The issue was that StripOverlayLayer.init() was trying to find .scrying-pool__roster-strip before it was created. ScryingPoolStrip is created lazily when roleRenderer.openStrip() is called. Additionally, made both components GM-only since: - ConfirmationBar is in src/ui/gm/ and is only useful for GMs - StripOverlayLayer is currently only used by ConfirmationBar - ScryingPoolStrip is only created for GMs This ensures proper positioning of ConfirmationBar relative to ScryingPoolStrip. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- module.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/module.js b/module.js index 1d91a10..97e67e8 100644 --- a/module.js +++ b/module.js @@ -199,14 +199,6 @@ Hooks.once("ready", () => { portraitFallbackHandler = new PortraitFallbackHandler(adapter, playerPrivacyManager); portraitFallbackHandler.init(); - // Story 3.2: Create StripOverlayLayer (shared infrastructure for UI components) - stripOverlayLayer = new StripOverlayLayer(adapter); - stripOverlayLayer.init(); - - // Story 3.2: Create ConfirmationBar for preset apply feedback - confirmationBar = new ConfirmationBar(adapter, visibilityManager, socketHandler, stripOverlayLayer); - confirmationBar.init(); - // Story 3.2: Register updateScene hook for auto-apply adapter.hooks.on('updateScene', (scene) => { if (adapter.users.isGM()) { @@ -239,7 +231,17 @@ Hooks.once("ready", () => { roleRenderer.init(); if (adapter.users.isGM() && game.webrtc !== null) { roleRenderer.openStrip(); + + // Story 3.2: Create StripOverlayLayer AFTER ScryingPoolStrip is created + // (ScryingPoolStrip is created lazily in roleRenderer.openStrip() above) + stripOverlayLayer = new StripOverlayLayer(adapter); + stripOverlayLayer.init(); + + // Story 3.2: Create ConfirmationBar for preset apply feedback (GM only) + confirmationBar = new ConfirmationBar(adapter, visibilityManager, socketHandler, stripOverlayLayer); + confirmationBar.init(); } + if (!adapter.users.isGM()) { visibilityBadge = new VisibilityBadge(stateStore, scryingPoolController, avTileAdapter, adapter); visibilityBadge.init();