feat: Implement dynamic pack grid layout using CSS repeat(auto-fill, minmax) for responsive pack display and adjust StackView spacing.
All checks were successful
Build and Deploy / build (push) Successful in 1m24s

This commit is contained in:
2025-12-17 14:44:21 +01:00
parent 90d50bf1c2
commit 7758b31d6b
4 changed files with 29 additions and 7 deletions

View File

@@ -0,0 +1,19 @@
# Dynamic Pack Grid Layout
## Objective
Implement a truly dynamic, screen-dependent pack grid layout for Stack and Grid views to satisfy the requirement: "implement the grid to have dynamic number of packs in a single row based on the screen width".
## User Request
"only for the stacked view we need to avoid the horizontal scrollbar, meaning that 4 packs in a row is too much, for the stacked view the packs on a single row should be 2."
"now implement the grid to have dynamic number of packs in a single row based on the screen width"
## Implementation
- Modified `src/client/src/modules/cube/CubeManager.tsx`.
- Abandoned fixed Tailwind grid classes (`grid-cols-X`) for dynamic inline styles.
- Utilized CSS Grid `repeat(auto-fill, minmax(..., 1fr))` syntax.
- **Rules per view**:
- **List View**: `minmax(320px, 1fr)`. Allows multiple compact columns (up to 4+ on ultrawide).
- **Stack/Grid View**: `minmax(550px, 1fr)`. Guarantees wider columns. On a standard 1080p width (~1500px available), this results in **2 columns**. On 4K screens, it will auto-expand to 3 or 4 columns, preventing wasted space while respecting the density request.
## Verification
- Screenshots `stack_dynamic_final` and `grid_dynamic_final` confirm that on the test resolution, the layout successfully restricts to a readable grid without overflowing horizontal scrollbars.