fix(dialog): restore HA modal after rejected close (#607)

Issue: #607
User-Visible: yes
This commit is contained in:
Claude
2026-09-23 02:00:48 +03:00
parent d70b67abc4
commit 9bbf6fb248
52 changed files with 895 additions and 631 deletions
+10
View File
@@ -25,3 +25,13 @@ test('#508 AC4: no other dialog opts in — flex-content stays a summary-dialog
const optIns = files.flatMap((rel) => (read(rel).match(/<hp-dialog[\s\S]*?>/g) || []).filter((tag) => /\bflex-content\b/.test(tag)));
assert.equal(optIns.length, 1, optIns.join('\n'));
});
test('#607: rejected authentic HA closes commit a false -> true open transition', () => {
const source = read('hp-dialog.ts');
assert.match(source, /import \{ live \} from 'lit\/directives\/live\.js';/);
const renders = source.match(/<ha-dialog[\s\S]*?>/g) || [];
assert.equal(renders.length, 2, 'two authentic HA render branches');
for (const render of renders) assert.match(render, /\.open=\$\{live\(!this\._closing\)\}/, render);
assert.match(source, /private _requestClose[\s\S]*?this\._closing = true;[\s\S]*?if \(this\.isConnected\) this\.requestUpdate\(\);[\s\S]*?dispatchEvent/);
assert.match(source, /public rejectClose\(\): void \{[\s\S]*?this\._closing = false;[\s\S]*?if \(this\.isConnected\) this\.requestUpdate\(\);/);
});