Improve scene editor UI (#22910)

This commit is contained in:
Wendelin 2024-11-20 15:53:49 +01:00 committed by GitHub
parent 7996f4e0b2
commit 995155696f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 16 deletions

View File

@ -74,7 +74,7 @@ export class HaConfigSection extends LitElement {
}
.together {
margin-top: 32px;
margin-top: var(--config-section-content-together-margin-top, 32px);
}
.intro {
@ -110,7 +110,10 @@ export class HaConfigSection extends LitElement {
max-width: 640px;
}
.narrow .together {
margin-top: 20px;
margin-top: var(
--config-section-narrow-content-together-margin-top,
var(--config-section-content-together-margin-top, 20px)
);
}
.narrow .intro {
padding-bottom: 20px;

View File

@ -454,10 +454,10 @@ export class HaSceneEditor extends SubscribeMixin(
"ui.panel.config.scene.editor.devices.header"
)}
</div>
${this._mode === "live"
? html` <div slot="introduction">
${this._mode === "live" || devices.length === 0
? html`<div slot="introduction">
${this.hass.localize(
"ui.panel.config.scene.editor.devices.introduction"
`ui.panel.config.scene.editor.devices.introduction${this._mode === "review" ? "_review" : ""}`
)}
</div>`
: nothing}
@ -536,22 +536,16 @@ export class HaSceneEditor extends SubscribeMixin(
"ui.panel.config.scene.editor.entities.header"
)}
</div>
${this._mode === "live"
? html` <div slot="introduction">
${this._mode === "live" || entities.length === 0
? html`<div slot="introduction">
${this.hass.localize(
"ui.panel.config.scene.editor.entities.introduction"
`ui.panel.config.scene.editor.entities.introduction${this._mode === "review" ? "_review" : ""}`
)}
</div>`
: nothing}
${entities.length
? html`
<ha-card
outlined
class="entities"
.header=${this.hass.localize(
"ui.panel.config.scene.editor.entities.without_device"
)}
>
<ha-card outlined class="entities">
<mwc-list>
${entities.map((entityId) => {
const entityStateObj = this.hass.states[entityId];
@ -1248,6 +1242,7 @@ export class HaSceneEditor extends SubscribeMixin(
css`
ha-card {
overflow: hidden;
margin-top: 8px;
}
.container {
padding: 28px 20px 0;
@ -1262,6 +1257,9 @@ export class HaSceneEditor extends SubscribeMixin(
font-weight: bold;
color: var(--error-color);
}
ha-config-section {
--config-section-content-together-margin-top: 8px;
}
ha-config-section:last-child {
padding-bottom: 20px;
}

View File

@ -3856,7 +3856,6 @@
"only_editable": "Only scenes defined in scenes.yaml are editable.",
"edit_scene": "Edit scene",
"show_info": "[%key:ui::panel::config::automation::editor::show_info%]",
"activate": "Activate",
"apply": "Apply",
"delete_scene": "Delete scene",
"delete": "[%key:ui::common::delete%]",
@ -3900,12 +3899,14 @@
"devices": {
"header": "Devices",
"introduction": "Add the devices that you want to be included in your scene. Set all entities in each device to the state you want for this scene.",
"introduction_review": "To add the devices that you want to be included in your scene turn on the Live Preview mode.",
"add": "Add a device",
"delete": "Delete device"
},
"entities": {
"header": "Entities",
"introduction": "Individual entities can be added here.",
"introduction_review": "To add individual entities to your scene turn on the Live Preview mode.",
"without_device": "Entities",
"add": "Add an entity",
"delete": "Delete entity"