fix: вернуть paint-server штриховки в defs (#685)

Полный smoke обнаружил нарушение порядка SVG-слоёв и устаревшее ожидание скрытых устройств после #687. Paint-server снова живёт в defs; общий mode-smoke проверяет видимые ориентиры устройств в Plan.

Issue: #685
User-Visible: no
This commit is contained in:
Matysh
2026-09-28 12:04:48 +03:00
parent 005b7c406d
commit 52fe4d6499
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -48,10 +48,11 @@ out.viewHoldInfo = await page.evaluate(() => { const r = !!window.__card._infoCa
await page.evaluate(() => window.__card._setMode('plan'));
await page.waitForFunction(() => window.__card._modeTransitionBusy === false);
out.plan = await st();
out.planIconsHidden = await page.evaluate(() => {
// #687: Plan keeps device markers as translucent, inert landmarks.
out.planIconsVisible = await page.evaluate(() => {
const sr = window.__card.shadowRoot || window.__card.renderRoot;
const dev = sr.querySelector('.dev');
return dev ? getComputedStyle(dev).display === 'none' : 'no-dev';
return dev ? getComputedStyle(dev).display !== 'none' : false;
});
// 4) режим Устройства: drag работает, клик открывает редактор
await page.evaluate(() => window.__card._setMode('devices'));
+2 -2
View File
@@ -10729,9 +10729,9 @@ export class HouseplanCard extends LitElement {
const transitionBrightness = modeVisual?.sceneBrightness ?? 1;
// View owns the eager hatch; 100% stays byte-compatible, scaled views avoid a cached tile.
const hatchStep = wallHatchStepUnits(this._cellCm);
const wallHatch = this._zoom === 1
const wallHatch = svg`<defs>${this._zoom === 1
? svg`<pattern id=hp-wall-hatch patternUnits=userSpaceOnUse width=${hatchStep} height=${hatchStep} patternTransform=rotate(45)><path d="M0 0V${hatchStep}" stroke=${disp.color} stroke-width=${hatchStep / 4}/></pattern>`
: svg`<linearGradient id=hp-wall-hatch gradientUnits=userSpaceOnUse x2=${hatchStep} gradientTransform=rotate(45) spreadMethod=repeat><stop offset=.125 stop-color=${disp.color}/><stop offset=.125 stop-opacity=0 /><stop offset=.875 stop-opacity=0 /><stop offset=.875 stop-color=${disp.color}/></linearGradient>`;
: svg`<linearGradient id=hp-wall-hatch gradientUnits=userSpaceOnUse x2=${hatchStep} gradientTransform=rotate(45) spreadMethod=repeat><stop offset=.125 stop-color=${disp.color}/><stop offset=.125 stop-opacity=0 /><stop offset=.875 stop-opacity=0 /><stop offset=.875 stop-color=${disp.color}/></linearGradient>`}</defs>`;
const editorClose = html`<span class="editor-close-slot" aria-hidden=${this._mode === 'view' ? 'true' : nothing}>${this._mode !== 'view' ? html`<button
class="closex" title=${this._t('title.close_editor')} aria-label=${this._t('title.close_editor')} data-hp="editor-close" data-editor-navigation="view"
@click=${(e: Event) => { e.stopPropagation(); this._setMode('view'); }}><ha-icon icon="mdi:close"></ha-icon></button>`