Window State-First Content Renderers (March 2026)
@wonderlandlabs-pixi-ux/window now documents a clear state-first pattern for runtime content updates in windows and titlebars.
New recommended pattern
For dynamic content (toolbar actions, async updates, external events), use this flow:
- Mutate window/titlebar state (including custom fields).
- Mark the relevant store dirty (
markDirty()/isDirty). - Upsert display objects from
windowContentRendererand/ortitlebarContentRenderer.
Why this matters
- Avoids Pixi artifacts from direct display-list mutation outside the refresh/ticker path.
- Coalesces multiple state changes between ticks into one final render snapshot.
- Prevents unnecessary add/remove churn when intermediate states cancel out before render.
Refresh-cycle timing
windowContentRendererruns duringWindowStore.resolve()via content refresh.titlebarContentRendererruns duringTitlebarStore.resolve().
This keeps content generation deterministic and aligned with the rest of the monorepo rendering model.