From da58dfe1338bc4ea824c32d9a5c5134ffc50237a Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Wed, 19 Feb 2025 12:50:30 +0100 Subject: [PATCH] Improve new section button --- .../lovelace/views/hui-sections-view.ts | 64 +++++++------------ 1 file changed, 24 insertions(+), 40 deletions(-) diff --git a/src/panels/lovelace/views/hui-sections-view.ts b/src/panels/lovelace/views/hui-sections-view.ts index 21f108aa7e..c9d4e03bca 100644 --- a/src/panels/lovelace/views/hui-sections-view.ts +++ b/src/panels/lovelace/views/hui-sections-view.ts @@ -147,12 +147,13 @@ export class SectionsView extends LitElement implements LovelaceViewElement { if (!this.lovelace) return nothing; const sections = this.sections; - const totalSectionCount = - this._sectionColumnCount + (this.lovelace?.editMode ? 1 : 0); const editMode = this.lovelace.editMode; const maxColumnCount = this._columnsController.value ?? 1; + const totalSectionCount = this._sectionColumnCount; + const showExtraColumn = + totalSectionCount < maxColumnCount && totalSectionCount > 0 && editMode; return html`
-