zinc-ui-async-separation

Enforce strict UI and game state separation in War3Lib components.

11|3|Updated Oct 17, 2024
One-click install
npx skills add https://github.com/Crainax/War3Lib --skill zinc-ui-async-separation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: zinc-ui-async-separation
Source: https://github.com/Crainax/War3Lib/tree/main/.codex/skills/zinc-ui-async-separation
Command: npx skills add https://github.com/Crainax/War3Lib --skill zinc-ui-async-separation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

War3UI logic often intertwines local UI updates with global game state mutations. This skill defines strict separation rules to ensure UI layers remain non-blocking and deterministic, while synchronization with the game state happens through a dedicated bus.

Core Features & Use Cases

  • Enforces a clear boundary between "presentation" and "data/game state" layers in War3Lib UI components.
  • Distinguishes between onClick/onEnter/onLeave (no data binding) and spClick/spEnter/spLeave (binding via eventdata) to manage asynchronous payloads.
  • Provides a safe pattern for bridging local UI events to asynchronous-synchronous transitions using a central sync bus and a mock payload contract.

Quick Start

Implement UI components following the separation rules to ensure local UI changes do not mutate the game state directly.

Frequently Asked Questions about zinc-ui-async-separation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent War3 UI logic from mutating game state directly?

To prevent War3 UI logic from mutating game state, enforce strict separation between presentation and data layers, bridging local UI events to asynchronous syncing via a central bus instead of writing state directly.

What is the difference between onClick and spClick in War3Lib UI components?

onClick/onEnter/onLeave handle local UI interactions without data binding, whereas spClick/spEnter/spLeave manage asynchronous payloads by binding through eventdata to safely sync with the game state.

How do I bridge local UI events to asynchronous game state in War3?

Bridge local UI events to asynchronous game state in War3 by routing them through a central sync bus using a mock payload contract, ensuring validation occurs during the onDataSync transition.

Does War3Lib UI async separation require any external dependencies?

No, War3Lib UI async separation requires no external dependencies. It provides a reusable pattern with static async parameter slots and clear destruction rules built directly into the UI modules.

What are the limitations of mixing UI updates and state mutations in War3?

Mixing UI updates and state mutations in War3 creates blocking and non-deterministic behavior. Strict separation rules are required to keep the UI layer safe and ensure synchronization happens exclusively through a dedicated bus.

When do I need to use onDataSync validation for War3 UI components?

You need onDataSync validation for War3 UI components whenever bridging local events to the asynchronous sync bus, ensuring the payload structure is correct before any game state mutations occur.