fix: the summary panel settings dialog scrolls in Home Assistant

In HA hp-dialog renders ha-dialog, whose own `.body` is the scroller and
is not a flex container; `.summary-editor` (overflow:auto,
overscroll-behavior:contain, min-height:0) therefore grew to its content
and became a scroll container that never scrolls — Chromium stops wheel
and touch scroll chaining at such a child, so nothing moved (reproduced
on ha.jbstudio.pro, HA 2026.9.1, and in an isolated Playwright page).
hp-dialog gains an opt-in `flex-content` attribute forwarded as
ha-dialog's `flexcontent`, which lays the body out as a flex column: the
editor is height-bound again and scrolls itself, header and footer stay,
exactly as the native branch already did. Only the summary dialog opts in.

Smoke demo/smoke_summary_dialog_scroll.mjs stubs ha-dialog after the HA
2026.9 contract: wheel on desktop, touch swipe on a phone, dialog within
the viewport, and a witness that the stub reproduces the bug without
flexcontent. Docs screenshots: 11/11 pixel-identical (docs:accept
--identical, #512), fingerprint refreshed.

Mutants: summary-dialog-drops-flex-content, hp-dialog-ignores-flex-content.

Issue: #508
User-Visible: yes
This commit is contained in:
Codex
2026-09-09 19:49:18 +00:00
committed by claude[bot]
parent 6b592c13c0
commit e38beed796
53 changed files with 659 additions and 427 deletions
+22
View File
@@ -8110,6 +8110,28 @@ const MUTANT_DEFINITIONS = [
replace: " return relevant.sort((a, b) => stamp(a) - stamp(b) || Number(a.id || 0) - Number(b.id || 0))[0] || null; // mutant: oldest",
}],
},
{
id: 'summary-dialog-drops-flex-content',
guard: 'node demo/smoke_summary_dialog_scroll.mjs',
because: 'in Home Assistant the settings dialog scrolls only because ha-dialog lays its body out as a '
+ 'flex column; without flex-content the editor is unbounded and wheel/touch die at it (#508 AC1)',
patches: [{
file: 'src/summary-panel-editor.ts',
find: " .title=${t('summary.settings')} wide flex-content",
replace: " .title=${t('summary.settings')} wide",
}],
},
{
id: 'hp-dialog-ignores-flex-content',
guard: 'node demo/smoke_summary_dialog_scroll.mjs',
because: 'the attribute is only a promise until hp-dialog forwards it to ha-dialog; a shell that '
+ 'swallows flex-content leaves the HA branch exactly as broken as before (#508 AC1)',
patches: [{
file: 'src/hp-dialog.ts',
find: " ?flexcontent=${this.flexContent}\n .preventScrimClose=${!this.dismissOnScrim}\n .ariaLabelledBy=${this._titleId}\n @opened=${this._focusInitial}",
replace: " .preventScrimClose=${!this.dismissOnScrim}\n .ariaLabelledBy=${this._titleId}\n @opened=${this._focusInitial}",
}],
},
{
id: 'version-seam-ignores-override',
guard: 'npx tsc -p tsconfig.test.json && node scripts/fix-test-build.mjs && node --test test/card-version.test.mjs',