From ebea7dcac12ebdd359a0c54073660fe2f18dfeec Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sun, 17 Aug 2025 23:00:33 +0800 Subject: [PATCH] fix: update column count logic in VirtualGridImpl for improved responsiveness - Changed default column count from 2 to 1 in VirtualGridImpl to enhance layout adaptability. - Adjusted breakpoint values to align with the new column count, ensuring better consistency across various screen sizes. --- .../layer/renderer/src/modules/entry-column/grid.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/grid.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/grid.tsx index 5bc928826..a4ad29aed 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/grid.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/grid.tsx @@ -106,11 +106,11 @@ const VirtualGridImpl: FC< const columns = useMemo(() => { const width = containerWidth const rem = Number.parseFloat(getComputedStyle(document.documentElement).fontSize) - let columnCount = 2 // default (grid-cols-1) - if (width >= 32 * rem) columnCount = 3 // @lg (32rem) - if (width >= 48 * rem) columnCount = 4 // @3xl (48rem) - if (width >= 72 * rem) columnCount = 5 // @6xl (72rem) - if (width >= 80 * rem) columnCount = 6 // @8xl (80rem) + let columnCount = 1 // default (grid-cols-1) + if (width >= 32 * rem) columnCount = 2 // @lg (32rem) + if (width >= 48 * rem) columnCount = 3 // @3xl (48rem) + if (width >= 72 * rem) columnCount = 4 // @6xl (72rem) + if (width >= 80 * rem) columnCount = 5 // @8xl (80rem) return Array.from({ length: columnCount }).fill(width / columnCount) as number[] }, [containerWidth])