Fix: StripOverlayLayer initialization timing - proper architecture
Resolved the 'ScryingPoolStrip not found, appending to body' warning by restructuring the initialization flow: 1. ScryingPoolStrip now creates its own StripOverlayLayer lazily via getter 2. ScryingPoolStrip.stripOverlayLayer returns the layer instance 3. ConfirmationBar accepts ScryingPoolStrip/RoleRenderer and extracts stripOverlayLayer 4. RoleRenderer exposes public .strip getter for ScryingPoolStrip access 5. All components only initialized for GM users (where ScryingPoolStrip exists) This ensures: - StripOverlayLayer is created AFTER ScryingPoolStrip DOM element exists - ConfirmationBar renders correctly positioned within the strip - No fallback to document.body needed - Proper separation of concerns (strip owns its overlay layer) Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// @ts-nocheck
|
||||
/* global Application, directorsBoard */
|
||||
import { generateOpId } from '../../utils/uuid.js';
|
||||
import { StripOverlayLayer } from '../shared/StripOverlayLayer.js';
|
||||
|
||||
/**
|
||||
* Canonical action labels — never use inline string literals.
|
||||
@@ -117,6 +118,20 @@ export class ScryingPoolStrip extends _AppBase {
|
||||
this._isExpanded = true;
|
||||
/** @type {ActionPopover|null} */
|
||||
this._activePopover = null;
|
||||
/** @type {StripOverlayLayer|null} */
|
||||
this._stripOverlayLayer = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the StripOverlayLayer instance, creating it lazily if needed.
|
||||
* @returns {StripOverlayLayer} The overlay layer instance.
|
||||
*/
|
||||
get stripOverlayLayer() {
|
||||
if (!this._stripOverlayLayer) {
|
||||
this._stripOverlayLayer = new StripOverlayLayer(this._adapter);
|
||||
this._stripOverlayLayer.init();
|
||||
}
|
||||
return this._stripOverlayLayer;
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
|
||||
Reference in New Issue
Block a user