1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-02-15 07:25:54 +00:00

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) <noreply@anthropic.com>

* 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) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Marcin Bauer
2026-02-12 09:23:45 +01:00
committed by GitHub
parent 3b6babe0be
commit 81525a2b14

View File

@@ -96,7 +96,6 @@ interface ChildView {
viewTitle?: string;
viewImport?: () => Promise<unknown>;
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);