From 8ba322b838c6537d35d04748174b829f7eb50526 Mon Sep 17 00:00:00 2001 From: DigiLive Date: Fri, 2 May 2025 10:02:32 +0200 Subject: [PATCH] Refactor column count of person cards in Home view Having many persons, the cards would take up a lot of space in the Home view. Now, a horizontal stack allows up to 8 cards. --- src/Registry.ts | 2 +- src/views/HomeView.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Registry.ts b/src/Registry.ts index 052d8fa..6552eeb 100644 --- a/src/Registry.ts +++ b/src/Registry.ts @@ -265,7 +265,7 @@ class Registry { * Each horizontal stack contains a specified number of cards. * * @param {LovelaceCardConfig[]} cardConfigurations - Array of card configurations to be stacked. - * @param {number} columnCount - Number of cards per horizontal stack. + * @param {number} columnCount - Maximal number of cards per horizontal stack. */ static stackHorizontal(cardConfigurations: LovelaceCardConfig[], columnCount: number): StackCardConfig[] { const stackedCardConfigurations: StackCardConfig[] = []; diff --git a/src/views/HomeView.ts b/src/views/HomeView.ts index fbad6b2..64f7c92 100644 --- a/src/views/HomeView.ts +++ b/src/views/HomeView.ts @@ -207,10 +207,9 @@ class HomeView extends AbstractView { .map((person) => new PersonCard(person).getCard()), ); - // FIXME: The columns are too narrow when having many persons. return { type: 'vertical-stack', - cards: Registry.stackHorizontal(cardConfigurations, 2), + cards: Registry.stackHorizontal(cardConfigurations, 8), }; }