Основная панель: без счётчика устройств, × редактора в своём слоте — ширина шапки не меняется (#647)

Счётчик «N устр.» и ключ count.devices удалены вместе с правилом
`.head .count` (скрывало счётчик на ≤1100 px). Крестик закрытия редактора
вынесен из активной кнопки режима в отдельный слот `.editor-close-slot`
сразу после группы кнопок режимов: 24 × 24 px (--hp-editor-close-size),
одинаковый в редакторе и вне его; вне редактора слот пуст, aria-hidden,
без фокуса и pointer-events. Кликабельная зона × — весь слот (≥24×24, #195),
глиф 13 px; × виден на любой ширине, где видны кнопки режимов.

Смок smoke_toolbar_stable_width (1400/1000/768/390 px, en/ru): ширина
шапки и отступы кнопок стабильны во всех переходах, × виден, попадание
в край зоны закрывает редактор, нет нового overflow. smoke_editor_tabs,
smoke_edge_cases, smoke_hidden_flag переведены на слот/список устройств.
6 мутантов. docs: UX-MODES.md, STYLING-HOOKS.md, data-hp-contract.json.

Issue: #647
User-Visible: yes
This commit is contained in:
Claude
2026-09-25 08:35:57 +00:00
committed by claude[bot]
parent 632d6a2f8e
commit f0ba7c5da9
88 changed files with 905 additions and 691 deletions
+61
View File
@@ -7281,6 +7281,67 @@ const MUTANT_DEFINITIONS = [
replace: ' if (false) continue;',
}],
},
// #647: шапка — без счётчика, × в собственном слоте постоянного размера.
{
id: 'toolbar-device-count-returns',
guard: 'node demo/smoke_toolbar_stable_width.mjs',
because: '#647 AC1: the header must not show a device count in any mode or locale',
patches: [{
file: 'src/houseplan-card.ts',
find: " <span class=\"editor-close-slot\" aria-hidden=",
replace: " <span class=\"count\">${this._devices.length} dev.</span><span class=\"editor-close-slot\" aria-hidden=",
}],
},
{
id: 'toolbar-close-slot-collapses-outside-editor',
guard: 'node demo/smoke_toolbar_stable_width.mjs',
because: '#647 AC2: an empty slot that collapses outside an editor brings back the header width jump',
patches: [{
file: 'src/styles/chrome.styles.ts',
find: " .editor-close-slot[aria-hidden='true'] { pointer-events: none; }",
replace: " .editor-close-slot[aria-hidden='true'] { pointer-events: none; display: none; }",
}],
},
{
id: 'toolbar-close-back-inside-tab',
guard: 'node demo/smoke_toolbar_stable_width.mjs',
because: '#647 AC3: an X inside the active mode tab widens that tab and moves its neighbours',
patches: [{
file: 'src/houseplan-card.ts',
find: " <ha-icon icon=${ic}></ha-icon><span class=\"ml\">${this._t(('mode.' + m) as any)}</span>\n </button>`,",
replace: " <ha-icon icon=${ic}></ha-icon><span class=\"ml\">${this._t(('mode.' + m) as any)}</span>${this._mode === m ? html`<ha-icon class=\"closex\" icon=\"mdi:close\"></ha-icon>` : nothing}\n </button>`,",
}],
},
{
id: 'toolbar-close-slot-idle-focusable',
guard: 'node demo/smoke_toolbar_stable_width.mjs',
because: '#647 AC4: outside an editor the reserve is inert and hidden from assistive technology',
patches: [{
file: 'src/houseplan-card.ts',
find: " <span class=\"editor-close-slot\" aria-hidden=${this._mode === 'view' ? 'true' : nothing}>",
replace: " <span class=\"editor-close-slot\" tabindex=\"0\">",
}],
},
{
id: 'toolbar-close-target-below-24',
guard: 'node demo/smoke_toolbar_stable_width.mjs',
because: '#647 AC5 / #195: the X keeps a hit target of at least 24 x 24 px around its 13 px glyph',
patches: [{
file: 'src/styles/chrome.styles.ts',
find: " --hp-editor-close-size: 24px;",
replace: " --hp-editor-close-size: 13px;",
}],
},
{
id: 'toolbar-close-hidden-at-medium-width',
guard: 'node demo/smoke_toolbar_stable_width.mjs',
because: '#647 AC6: the X must stay visible on ordinary 721-1100 px windows, where the old count was hidden',
patches: [{
file: 'src/styles/chrome.styles.ts',
find: " .editor-close-slot .closex ha-icon { --mdc-icon-size: 13px; }",
replace: " .editor-close-slot .closex ha-icon { --mdc-icon-size: 13px; }\n @media (max-width: 1100px) { .editor-close-slot .closex { display: none; } }",
}],
},
{
id: 'tab-reorder-not-persisted',
guard: 'node demo/smoke_space_tab_reorder.mjs',
+7
View File
@@ -27,6 +27,13 @@
/** @type {SmokeLink[]} */
export const SMOKE_LINKS = [
{
symbols: ['chromeStyles', 'dialogsStyles'],
smokes: ['smoke_toolbar_stable_width.mjs', 'smoke_editor_tabs.mjs'],
because: '#647: the header X slot (.editor-close-slot) and the removed .head .count rule are '
+ 'CSS in these sheets; the smokes measure the rendered header width, tab offsets, the X '
+ 'hit target and its visibility at 1400/1000/768/390 px — no TS symbol names that layout',
},
{
symbols: ['confirmIcon', 'HpConfirmRequest'],
smokes: ['smoke_discard_copy.mjs', 'smoke_dialog_polish_603.mjs'],