fix: mount the House Plan panel the way Home Assistant does

HA assigns panel/hass/narrow/route before the top-level-await entry has
defined the element, so the values landed as own properties that shadowed
the accessors and the card never received hass. And <ha-panel-custom> has
no height, so the percentage host height collapsed the stage to 0 px.
Adopt pre-upgrade properties through the accessors and size the panel from
the viewport minus HA's safe-area padding. The smoke now reproduces HA's
real mount order and container; two mutants guard both contracts. The
bundle is rebuilt from these sources.

Issue: #488
User-Visible: yes
This commit is contained in:
Codex
2026-09-08 10:05:45 +03:00
parent 9750330d77
commit 471527c474
41 changed files with 461 additions and 311 deletions
+23
View File
@@ -732,6 +732,29 @@ const MUTANT_DEFINITIONS = [
replace: ' if (this._serverCanWrite !== null) return true; // mutant: read-only becomes writer',
}],
},
{
id: 'panel-ignores-pre-upgrade-properties',
guard: 'node demo/smoke_houseplan_panel.mjs',
because: 'HA assigns hass/narrow/route/panel before the top-level-await entry defines the '
+ 'element; values left as own data properties shadow the accessors and the card never '
+ 'receives hass, so /houseplan stays blank on first open (#488)',
patches: [{
file: 'src/houseplan-panel.ts',
find: ' if (!Object.prototype.hasOwnProperty.call(this, key)) continue;',
replace: ' continue; // mutant: pre-upgrade properties are left shadowing the accessors',
}],
},
{
id: 'panel-host-height-from-parent',
guard: 'node demo/smoke_houseplan_panel.mjs',
because: '<ha-panel-custom> has no height, so a percentage host height resolves to auto and '
+ 'the stage collapses to 0 px; the panel must size itself from the viewport (#488)',
patches: [{
file: 'src/houseplan-panel.ts',
find: ' height: calc(100dvh - var(--safe-area-inset-top, 0px) - var(--safe-area-inset-bottom, 0px));',
replace: ' height: 100%; /* mutant: back to the parent-relative height */',
}],
},
{
id: 'version-recovery-treats-unknown-as-mismatch',
guard: 'node --test --test-name-pattern="malformed values stay unknown" '