diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index ccd4ee08fb..d2c2a1a6b7 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -276,137 +276,153 @@ class HUIRoot extends LitElement { > ` : ""} - - - ${this.narrow && - this._conversation(this.hass.config.components) - ? html` - + - ${this.hass!.localize( - "ui.panel.lovelace.menu.start_conversation" - )} - - - ` - : ""} - ${this._yamlMode - ? html` - - ${this.hass!.localize("ui.common.refresh")} - - - - ${this.hass!.localize( - "ui.panel.lovelace.unused_entities.title" - )} - - - ` - : ""} - ${(this.hass.panels.lovelace?.config as LovelacePanelConfig) - ?.mode === "yaml" - ? html` - - ${this.hass!.localize( - "ui.panel.lovelace.menu.reload_resources" - )} - - - ` - : ""} - ${this.hass!.user?.is_admin && !this.hass!.config.safe_mode - ? html` - - ${this.hass!.localize( - "ui.panel.lovelace.menu.configure_ui" - )} - - - ` - : ""} - ${this._editMode - ? html` - - - ${this.hass!.localize( - "ui.panel.lovelace.menu.help" - )} - - - - ` - : ""} - + .path=${mdiDotsVertical} + > + ${this.narrow && + this._conversation(this.hass.config.components) + ? html` + + ${this.hass!.localize( + "ui.panel.lovelace.menu.start_conversation" + )} + + + ` + : ""} + ${this._yamlMode + ? html` + + ${this.hass!.localize( + "ui.common.refresh" + )} + + + + ${this.hass!.localize( + "ui.panel.lovelace.unused_entities.title" + )} + + + ` + : ""} + ${( + this.hass.panels.lovelace + ?.config as LovelacePanelConfig + )?.mode === "yaml" + ? html` + + ${this.hass!.localize( + "ui.panel.lovelace.menu.reload_resources" + )} + + + ` + : ""} + ${this.hass!.user?.is_admin && + !this.hass!.config.safe_mode + ? html` + + ${this.hass!.localize( + "ui.panel.lovelace.menu.configure_ui" + )} + + + ` + : ""} + ${this._editMode + ? html` + + + ${this.hass!.localize( + "ui.panel.lovelace.menu.help" + )} + + + + ` + : ""} + + ` + : ""} `} ${this._editMode @@ -621,6 +637,17 @@ class HUIRoot extends LitElement { return this.shadowRoot!.getElementById("view") as HTMLDivElement; } + private get _showButtonMenu(): boolean { + return ( + (this.narrow && this._conversation(this.hass.config.components)) || + this._editMode || + (this.hass!.user?.is_admin && !this.hass!.config.safe_mode) || + (this.hass.panels.lovelace?.config as LovelacePanelConfig)?.mode === + "yaml" || + this._yamlMode + ); + } + private _handleRefresh(ev: CustomEvent): void { if (!shouldHandleRequestSelectedEvent(ev)) { return;