fix(moon): the status line after a warm revive of General settings (#731)

#718 K7 takes the moon status once per opening of General settings,
outside the draft. A warm remount revives the open dialog on a new card
instance, but `_warmReviveDialog` restored only the draft: the new
instance had no opening of its own, so the "Now: ..." line never came
back.

A revive is an opening too. The `settings` branch now asks for the
status the way `_openSettingsDialog` does - through the lazy editor
runtime (`_openMoonStatus` -> `openMoonStatus`): at once when the
runtime is there (an editor revives after `_requestMode(..., adopt)`
has installed it), after it loads in View; once per revive and only
while that revived dialog is still open. The snapshot of now,
`hass.config` and `sun.sun` is the revive's own, nothing of the dead
instance's opening is carried over, the draft key and the dirty flag do
not change. The View graph gets no static moon-status import; other
dialog kinds never ask for the moon chunk.

demo/smoke_moon_status.mjs gains the revive scenarios - View, the plan
editor, a revive while the chunk is still loading, a space-dialog
revive that must not load the chunk; the first three are red on dev.
test/moon-settings.test.mjs executes the revive as a new opening; the
wiring itself is proven by the smoke, not by reading the monolith as
text (#624). docs/SUN.md and docs/WARM-REMOUNT.md say a revive is an
opening; scripts/smoke-links.mjs links the two new symbols to the smoke.

Issue: #731
User-Visible: yes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018qZfe7YS4rqEMKoVeS3GKd
This commit is contained in:
Claude
2026-10-01 06:47:05 +00:00
committed by claude[bot]
parent de117d5042
commit 36ebabaaec
9 changed files with 161 additions and 7 deletions
+10 -1
View File
@@ -3497,7 +3497,7 @@ export class HouseplanCard extends LitElement {
switch (d.kind) {
case 'space': this._spaceDialog = { ...d.data, busy: false, savedBusy: false }; break;
case 'marker': this._markerDialog = { ...d.data, busy: false }; break;
case 'settings': this._settingsDialog = { ...d.data, busy: false }; break;
case 'settings': this._settingsDialog = { ...d.data, busy: false }; this._reviveMoonStatus(); break;
case 'rules': this._rulesDialog = { ...d.data, busy: false }; break;
case 'opening': this._openingDialog = { ...d.data }; break;
case 'backdrop': this._backdropDialog = { ...d.data }; break;
@@ -10125,6 +10125,15 @@ export class HouseplanCard extends LitElement {
return this._editorRuntime._openSettingsDialog();
}
/** #731: a warm revive is an opening too (#718 K7) — its own status, asked once the lazy runtime is here. */
private _reviveMoonStatus(dialog = this._settingsDialog): void {
if (!this._editorRuntime) {
void this._ensureEditorRuntime().then((ready) => { if (ready) this._reviveMoonStatus(dialog); });
return;
}
if (dialog && this._settingsDialog === dialog) this._editorRuntime._openMoonStatus();
}
private _openSupportDialog = (): void => {
if (!this._editorRuntime) {
void this._ensureEditorRuntime().then((ready) => {
+3
View File
@@ -8468,6 +8468,9 @@ public _openSettingsDialog = (): void => {
openMoonStatus(this.host); // #718 K7: the status line, outside the draft
};
/** #731: the card revived General settings — a new opening, so a new snapshot. */
public _openMoonStatus(): void { openMoonStatus(this.host); }
public _openSupportDialog = (): void => {
if (!this.host._norm || !this.host._canEdit) return;
clearTimeout(this._supportExpiryTimer);