From 81525a2b14dfd4f0c718a72bb61a204059477a06 Mon Sep 17 00:00:00 2001 From: Marcin Bauer Date: Thu, 12 Feb 2026 09:23:45 +0100 Subject: [PATCH] Hide actions in attributes view (#29580) * Hide actions in attributes view Simplify the isDefaultView condition to hide actions when child views are shown in the more-info dialog. Co-Authored-By: Claude Sonnet 4.5 (1M context) * Remove keepHeader option from ChildView interface Completely removes the keepHeader property which was used to keep the header visible in child views. This simplifies the logic and ensures actions are consistently hidden across all child views, including the attributes view. Co-Authored-By: Claude Sonnet 4.5 (1M context) --------- Co-authored-by: Claude Sonnet 4.5 (1M context) --- src/dialogs/more-info/ha-more-info-dialog.ts | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index 81d5777a45..b3a19a341d 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -96,7 +96,6 @@ interface ChildView { viewTitle?: string; viewImport?: () => Promise; viewParams?: any; - keepHeader?: boolean; } declare global { @@ -350,7 +349,6 @@ export class MoreInfoDialog extends ScrollableFadeMixin(LitElement) { this._childView = { viewTag: "ha-more-info-attributes", viewParams: { entityId: this._entityId }, - keepHeader: true, }; } @@ -406,12 +404,9 @@ export class MoreInfoDialog extends ScrollableFadeMixin(LitElement) { const deviceType = (deviceId && this.hass.devices[deviceId].entry_type) || "device"; - const isDefaultView = - this._currView === DEFAULT_VIEW && - (!this._childView || this._childView.keepHeader); + const isDefaultView = this._currView === DEFAULT_VIEW && !this._childView; const isSpecificInitialView = - this._initialView !== DEFAULT_VIEW && - (!this._childView || this._childView.keepHeader); + this._initialView !== DEFAULT_VIEW && !this._childView; const showCloseIcon = (isDefaultView && this._parentEntityIds.length === 0 && @@ -450,12 +445,7 @@ export class MoreInfoDialog extends ScrollableFadeMixin(LitElement) { const breadcrumb = [areaName, deviceName, entityName].filter( (v): v is string => Boolean(v) ); - const title = - (this._childView && !this._childView.keepHeader - ? this._childView.viewTitle - : undefined) || - breadcrumb.pop() || - entityId; + const title = this._childView?.viewTitle || breadcrumb.pop() || entityId; const isRTL = computeRTL(this.hass);