Bug: timeSinceStart only updated when an envelope event fired (combatStart, attack-roll, etc.). If the combat was idle — a player thinking about their turn, between turns — the timer froze. Fix: 1Hz self-rescheduling setTimeout in the constructor that bumps timeSinceStart and triggers a throttled render while _state.isActive is true. Stopped on unwireHooks (combat end). TDD: Section O (5 assertions) added BEFORE the fix. - O.1 initial timeSinceStart reflects _combatStartedAt - O.2 advances without an envelope event - O.3 tick interval is ~1s - O.4 timer does not tick when combat is inactive - O.5 timer resumes when combat becomes active again Tests: 65/65 passing in ~2s. Playwright 31/31.
17 lines
682 B
JSON
17 lines
682 B
JSON
{
|
|
"name": "combat-hud-hub",
|
|
"version": "0.2.5",
|
|
"description": "Foundry VTT v14 module: generic combat HUD host. Other modules register sections via the public API; built-in core sections render round/turn/damage/dice-streak. Soft-dep on foundry-hooks-lib and battle-focus.",
|
|
"type": "module",
|
|
"scripts": {
|
|
"test": "node tests/verify-combat-hud-hub.mjs",
|
|
"test:foundry": "node tests/verify-combat-hud-hub-foundry.mjs",
|
|
"test:matrix": "node tests/verify-hub-e2e-matrix.mjs",
|
|
"test:turn-update-live": "node tests/verify-turn-update-live.mjs"
|
|
},
|
|
"author": "Kaysser Taylor",
|
|
"license": "MIT",
|
|
"devDependencies": {
|
|
"playwright-core": "^1.40.0"
|
|
}
|
|
} |