From 2b06742bb9c2a72d7815f78444f25175b23b6318 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Thu, 1 May 2025 09:25:18 +0200 Subject: [PATCH] Hide the tab when view is a subview (#25256) --- src/panels/lovelace/hui-root.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index 883fab5089..8083dd947c 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -300,6 +300,12 @@ class HUIRoot extends LitElement { const background = curViewConfig?.background || this.config.background; + const _isTabHiddenForUser = (view: LovelaceViewConfig) => + view.visible !== undefined && + ((Array.isArray(view.visible) && + !view.visible.some((e) => e.user === this.hass!.user?.id)) || + view.visible === false); + const tabs = html` ${views.map( (view, index) => html` @@ -311,13 +317,7 @@ class HUIRoot extends LitElement { class=${classMap({ icon: Boolean(view.icon), "hide-tab": Boolean( - !this._editMode && - view.visible !== undefined && - ((Array.isArray(view.visible) && - !view.visible.some( - (e) => e.user === this.hass!.user?.id - )) || - view.visible === false) + !this._editMode && (view.subview || _isTabHiddenForUser(view)) ), })} >