Save scene before switching to live edit (#23094)

Save scene changes before live edit, align delete icons for entities.
This commit is contained in:
Wendelin 2024-12-02 14:24:03 +01:00 committed by GitHub
parent 96395dd5e1
commit 55b6aa09d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View File

@ -559,6 +559,7 @@ export class HaSceneEditor extends SubscribeMixin(
}
return html`
<ha-list-item
class="entity"
hasMeta
.graphic=${this._mode === "live"
? "icon"
@ -776,13 +777,15 @@ export class HaSceneEditor extends SubscribeMixin(
text: this.hass.localize(
"ui.panel.config.scene.editor.enter_live_mode_unsaved"
),
confirmText: this.hass!.localize("ui.common.continue"),
destructive: true,
confirmText: this.hass!.localize(
"ui.panel.config.scene.editor.save_before_live"
),
dismissText: this.hass!.localize("ui.common.cancel"),
});
if (!result) {
return;
}
await this._saveScene();
}
this._entities.forEach((entity) => this._storeState(entity));
@ -1326,6 +1329,9 @@ export class HaSceneEditor extends SubscribeMixin(
li[role="separator"] {
border-bottom-color: var(--divider-color);
}
ha-list-item.entity {
padding-right: 28px;
}
`,
];
}

View File

@ -3881,7 +3881,8 @@
"review_mode_detail": "You can adjust the scene's details and remove devices or entities. To fully edit, switch to Live Edit, which will apply the scene.",
"live_edit": "Live Edit",
"live_edit_detail": "In Live Edit, all changes to this scene are applied in real-time to your devices and entities.",
"enter_live_mode_unsaved": "You have unsaved changes to this scene. Continuing to live preview will apply the saved scene, which may overwrite your unsaved changes. Consider if you would like to save the scene first before activating it.",
"enter_live_mode_unsaved": "Before proceeding to Live Edit, please save your current changes.",
"save_before_live": "Save and Live Edit",
"switch_to_review_mode": "Switch to review mode",
"default_name": "New scene",
"load_error_not_editable": "Only scenes in scenes.yaml are editable.",