From 31ca9c849acd52c43385e322f2f1531e52eda32d Mon Sep 17 00:00:00 2001 From: Wendelin <12148533+wendevlin@users.noreply.github.com> Date: Tue, 31 Mar 2026 17:42:02 +0200 Subject: [PATCH] Remove target description (#51315) --- gallery/src/pages/components/ha-selector.ts | 8 +++++-- src/components/ha-service-control.ts | 9 +------- src/components/ha-settings-row.ts | 18 +++++++++++++--- .../types/ha-automation-condition-platform.ts | 21 +++++++------------ .../types/ha-automation-trigger-platform.ts | 20 +++++++----------- src/translations/en.json | 1 - 6 files changed, 37 insertions(+), 40 deletions(-) diff --git a/gallery/src/pages/components/ha-selector.ts b/gallery/src/pages/components/ha-selector.ts index 8a212a00b5..8d7c10d04f 100644 --- a/gallery/src/pages/components/ha-selector.ts +++ b/gallery/src/pages/components/ha-selector.ts @@ -1,5 +1,5 @@ import type { TemplateResult } from "lit"; -import { css, html, LitElement } from "lit"; +import { css, html, LitElement, nothing } from "lit"; import { customElement, state } from "lit/decorators"; import { mockAreaRegistry } from "../../../../demo/src/stubs/area_registry"; import { mockConfigEntries } from "../../../../demo/src/stubs/config_entries"; @@ -692,7 +692,11 @@ class DemoHaSelector extends LitElement implements ProvideHassElement { ([key, value]) => html` ${value?.name || key} - ${value?.description} + ${value?.description + ? html`${value?.description}` + : nothing} - ${hasOptional - ? html`
` - : ""} ${this.hass.localize("ui.components.service-control.target")} - ${this.hass.localize( - "ui.components.service-control.target_secondary" - )}
-
+ ${hasDescription + ? html`` + : nothing}
diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-platform.ts b/src/panels/config/automation/condition/types/ha-automation-condition-platform.ts index c091cc5549..ccf9a6c920 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-platform.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-platform.ts @@ -166,19 +166,12 @@ export class HaPlatformCondition extends LitElement {
${conditionDesc && "target" in conditionDesc ? html` - ${hasOptional - ? html`
` - : nothing} ${this.hass.localize( "ui.components.service-control.target" )} - ${this.hass.localize( - "ui.components.service-control.target_secondary" - )} ${!showOptional ? hasOptional @@ -259,11 +256,9 @@ export class HaPlatformCondition extends LitElement { `component.${domain}.conditions.${conditionName}.fields.${fieldName}.name` ) || conditionName} - ${this.hass.localize( - `component.${domain}.conditions.${conditionName}.fields.${fieldName}.description` - )} + ${description + ? html`${description}` + : nothing} ${triggerDesc && "target" in triggerDesc ? html` - ${hasOptional - ? html`
` - : nothing} ${this.hass.localize( "ui.components.service-control.target" )} - ${this.hass.localize( - "ui.components.service-control.target_secondary" - )} ${!showOptional ? hasOptional @@ -295,11 +291,9 @@ export class HaPlatformTrigger extends LitElement { `component.${domain}.triggers.${triggerName}.fields.${fieldName}.name` ) || triggerName} - ${this.hass.localize( - `component.${domain}.triggers.${triggerName}.fields.${fieldName}.description` - )} + ${description + ? html`${description}` + : nothing}