fix(fe): PageLayout grid-based layout - eliminate flex gap height calculation error
Root cause: PageLayout's flex-direction: column + gap was not counted in flex: 1 height calculations, causing children to overflow and trigger scroll. Solution: Convert PageLayout from flexbox to CSS Grid with explicit grid-template-rows. Grid automatically accounts for gaps in row sizing. Changes: - PageLayout.vue: display: flex → display: grid - grid-template-rows: auto auto auto auto 1fr auto auto - .ks-page__content/.ks-page__aside: height: 100% → flex: 1 - .ks-page__workspace: removed flex: 1 (grid cell, not flex) Impact: - models-master fits viewport without page-level scroll ✓ - All screen-types layouts auto-fit with correct height propagation - Fix applies to all pages using PageLayout AGENTS.md v16.0: Added Layout Rule #7 (PageLayout grid requirement) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -259,6 +259,11 @@ pnpm dev
|
||||
4. **Scrollable containers:** `overflow-y: auto; min-height: 0;` (enables internal scroll without page scroll)
|
||||
5. **Grid layouts:** `align-items: start;` (NOT center/stretch) to prevent column stretching at different heights
|
||||
6. **Max-width constraint:** Wrap pages in `.page-wrapper { max-width: var(--ks-content-max); margin: 0 auto; }` to prevent 2560px+ distortion
|
||||
7. **PageLayout must use CSS Grid (NOT flexbox).** Flex + gap breaks `flex: 1` height propagation in children:
|
||||
- ❌ **DON'T:** `display: flex; flex-direction: column; gap: var(--ks-space-2);` (gap is not counted in flex: 1 calculations)
|
||||
- ✅ **DO:** `display: grid; grid-template-rows: auto auto auto auto 1fr auto auto; gap: var(--ks-space-2);` (gap auto-calculated)
|
||||
- **Reason:** Grid gap is accounted for in row sizing; flex gap is invisible to flex: 1 child height calculations, causing overflow → unwanted scroll
|
||||
- **Template rows:** header (auto) | subtitle (auto) | commandBar (auto) | summary (auto) | filters (auto) | workspace (1fr) | footer (auto)
|
||||
|
||||
#### Page Structure Rule: NO Footers (Global or Page-Level)
|
||||
**CRITICAL:** Footers are EXCLUDED at all levels:
|
||||
|
||||
Reference in New Issue
Block a user