From d779dd102b10789937e15247de90571ee7beea55 Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Tue, 14 Oct 2025 15:26:06 -0500 Subject: [PATCH] Refactor Git Management Dialog with proper flex-based scrolling architecture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Completely refactored the Git Management Dialog to use a robust flex layout that prevents overflow and enables proper scrolling regardless of content size. Architecture Changes: - Changed from max-h-[90vh] to h-[90vh] for consistent height - Implemented proper flex container hierarchy with min-h-0 to prevent overflow - Fixed header and tab list are non-scrollable (shrink-0) - Tab content areas take remaining space and scroll independently - Used data-[state=active]:flex to properly show/hide tabs in flex layout Layout Structure: DialogContent (h-[90vh], flex flex-col) ├── DialogHeader (shrink-0, border-b) ← Fixed └── Tabs Container (flex-1, min-h-0) ├── TabsList (shrink-0, border-b) ← Fixed └── TabsContent (flex-1, scrollable) ← Scrolls Key Techniques: - min-h-0: Allows flex children to shrink below content size - flex-1: Takes all available space - shrink-0: Prevents elements from shrinking - ScrollArea wrapping for Branches and Compare tabs - Direct height inheritance for DiffViewer (has internal layout) This architecture is future-proof and will handle any additional content or fields added to any tab without overflow issues. --- src/components/git/GitManagementDialog.tsx | 110 ++++++++++++--------- 1 file changed, 62 insertions(+), 48 deletions(-) diff --git a/src/components/git/GitManagementDialog.tsx b/src/components/git/GitManagementDialog.tsx index 4c26875d..a5848d3f 100644 --- a/src/components/git/GitManagementDialog.tsx +++ b/src/components/git/GitManagementDialog.tsx @@ -7,6 +7,7 @@ import { DialogTrigger, } from '@/components/ui/dialog'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; +import { ScrollArea } from '@/components/ui/scroll-area'; import { GitBranch, GitCompare, @@ -45,63 +46,76 @@ export function GitManagementDialog({ <> {children && {children}} - - + + {/* Fixed Header */} + Git Management - -
- - - - Branches - - - - Changes - - - - Compare - - -
+ {/* Tabs Container - takes remaining space */} +
+ + {/* Fixed Tab List */} +
+ + + + Branches + + + + Changes + + + + Compare + + +
- {/* Branches Tab */} - - - + {/* Scrollable Tab Content */} + + +
+ +
+
+
- {/* Changes Tab */} - - - + +
+ +
+
- {/* Compare Tab */} - - - -
+ + +
+ +
+
+
+ +