mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
fix: give static Glow the full card's cache hierarchy (#375)
V6a: pass the stable devices array to resolvedLightSources — the WeakMap cache is keyed by array identity, a spread guaranteed a miss on every render in BOTH cards (full-card regression since beta.4). V6b: the static wall geometry now carries the same non-enumerable sourceFingerprint tag the full card attaches, so buildLightBarrierScene takes the fast recutWallBodiesGeometry path on door state changes. V6c: the static barrier-scene cache is an LRU of 8 per space (parity with _lightBarrierPool) — a flipping door reuses both of its scenes. V6d: enabledClip is cached by geometry fingerprint + disabled-room set, with the full card's bbox prefilter for decor bodies. User-Visible: yes Issue: #375
This commit is contained in:
@@ -691,6 +691,28 @@ const MUTANT_DEFINITIONS = [
|
||||
replace: " : await import(/* @vite-ignore */ new URL(`${FRENCH_RETRY_ASSET}?retry`, import.meta.url).href);\n void module.dictionary;\n return { dictionary: en, fingerprint: module.fingerprint };",
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'static-glow-light-cache-spread',
|
||||
guard: 'node --test test/space-render-caches.test.mjs',
|
||||
because: 'a fresh spread on the devices array silently defeats RESOLVED_LIGHT_CACHE '
|
||||
+ '(WeakMap by array identity) in BOTH cards — invisible to CI perf profiles (#375 V6a)',
|
||||
patches: [{
|
||||
file: 'src/glow-scene.ts',
|
||||
find: " input.hass, input.devices, null, input.virtualLights,",
|
||||
replace: " input.hass, [...input.devices], null, input.virtualLights,",
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'static-glow-scene-lru-single',
|
||||
guard: 'node --test test/space-render-caches.test.mjs',
|
||||
because: 'a single-entry scene cache makes a door ping-pong rebuild the barrier scene '
|
||||
+ 'on every flip — the LRU capacity is the contract, parity with the full card (#375 V6c)',
|
||||
patches: [{
|
||||
file: 'src/space-render.ts',
|
||||
find: "const STATIC_LIGHT_BARRIER_LRU = 8;",
|
||||
replace: "const STATIC_LIGHT_BARRIER_LRU = 1;",
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'opening-light-quantum-identity',
|
||||
guard: 'node --test --test-name-pattern="#366" test/logic.test.mjs',
|
||||
|
||||
Reference in New Issue
Block a user