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
+3
View File
@@ -12,6 +12,9 @@
that switch a new line tells whether the moon is shown right now and, if not,
why — daytime, the moon below 3°, new moon or no home location in Home
Assistant ([#718](https://github.com/Matysh/houseplan-card/issues/718)).
- General settings restored after the card reloads — for example on returning
to the tab — now show the moon's "Now: …" line too, worked out afresh at that
moment ([#731](https://github.com/Matysh/houseplan-card/issues/731)).
## v1.79.0-beta.1 — 2026-09-30
+4
View File
@@ -18,6 +18,10 @@
появилась строка: видна ли луна сейчас, а если нет — почему (день, луна ниже
3°, новолуние или в Home Assistant не заданы координаты дома)
([#718](https://github.com/Matysh/houseplan-card/issues/718)).
- Общие настройки, восстановленные после перезагрузки карточки — например, при
возврате на вкладку, — тоже показывают строку луны «Сейчас: …», рассчитанную
заново на этот момент
([#731](https://github.com/Matysh/houseplan-card/issues/731)).
## v1.79.0-beta.1 — 2026-09-30
+4 -1
View File
@@ -494,7 +494,10 @@ do not change it. `moonStatus` in `src/moon.ts` decides «shown» with the same
month), rounds to whole numbers and keeps a hidden reason's number below its
threshold (2.6° reads «2°»). The status lives beside the draft, never in it:
the line arriving leaves «Save» disabled. While the chunk loads, or when it
failed, there is no line; a closed opening's result is dropped. The line
failed, there is no line; a closed opening's result is dropped. A warm revive
of the dialog (the card replaced, `docs/WARM-REMOUNT.md`) is an opening too:
its own snapshot, asked through the lazy editor runtime once it is there;
nothing is carried over from the replaced card (#731). The line
belongs to the browser the dialog is open in — a wall tablet with another
clock or time zone may differ.
+4
View File
@@ -231,6 +231,10 @@ hover. После долгого сна общий `VisualContinuityController`
обвязкой (`_roomEditId`, `_roomFill`, источники температуры и влажности,
масштабы подписей, `_areaSel`/`_nameSel`, `_pendingSplit`, `_path`).
Строка статуса луны в общих настройках (#718 K7) живёт вне черновика и не
переносится: восстановление — новое открытие, статус снимается заново, как
только у нового экземпляра есть ленивый рантайм редактора (#731).
Информационные попапы — `_infoCard` (карточка устройства) и `_openingInfo` —
восстанавливаются **по id**, а не по объекту: конфиг мог перезагрузиться под
нами, и карточка, отрисованная из устаревшего объекта, была бы враньём. Если