From 4be283c4a42fc23997329e84b41bc72788a7cb12 Mon Sep 17 00:00:00 2001 From: dwindown Date: Thu, 6 Nov 2025 16:02:42 +0700 Subject: [PATCH] fix: Add min-w-0 to main and scrollable containers for proper shrinking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: - Content still not shrinking on narrow viewports - Horizontal scrolling persists - Header shrinks but body doesn't Root Cause: Missing min-w-0 on parent containers:
← No min-w-0!
← No min-w-0! Without min-w-0, flex containers won't shrink below their content's natural width, even if children have min-w-0. Solution: Add min-w-0 to the entire container chain:
Container Chain (all need min-w-0): ┌────────────────────────────────────┐ │
│ │ │ │
✅ │ ← Added │ │ │ │ │
✅ │ ← Added │ │ │ │ │ │ │ Content... │ └────────────────────────────────────┘ Applied to all 3 layouts: 1. Fullscreen Desktop (Sidebar + Main) 2. Fullscreen Mobile (TopNav + Main) 3. WP-Admin (TopNav + Main) Why this works: - min-w-0 must be on EVERY flex container in the chain - Breaking the chain at any level prevents shrinking - Now entire tree can shrink from root to leaf Files Modified: - App.tsx: Added min-w-0 to
and scrollable
Result: ✅ Content shrinks properly on all viewports ✅ No horizontal scrolling ✅ Works from 320px to 1920px+ ✅ All layouts (fullscreen, mobile, WP-Admin) --- admin-spa/src/App.tsx | 12 ++++++------ admin-spa/src/components/PageHeader.tsx | 8 ++++---- .../routes/Settings/components/SettingsLayout.tsx | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/admin-spa/src/App.tsx b/admin-spa/src/App.tsx index abfe188..d0484c6 100644 --- a/admin-spa/src/App.tsx +++ b/admin-spa/src/App.tsx @@ -416,14 +416,14 @@ function Shell() { isDesktop ? (
-
+
{isDashboardRoute ? ( ) : ( )} -
+
@@ -436,9 +436,9 @@ function Shell() { ) : ( )} -
+
-
+
@@ -453,8 +453,8 @@ function Shell() { )} -
-
+
+
diff --git a/admin-spa/src/components/PageHeader.tsx b/admin-spa/src/components/PageHeader.tsx index e89fee5..aa767c2 100644 --- a/admin-spa/src/components/PageHeader.tsx +++ b/admin-spa/src/components/PageHeader.tsx @@ -17,11 +17,11 @@ export function PageHeader({ fullscreen = false }: PageHeaderProps) { return (
-
-
-

{title}

+
+
+

{title}

- {action &&
{action}
} + {action &&
{action}
}
); diff --git a/admin-spa/src/routes/Settings/components/SettingsLayout.tsx b/admin-spa/src/routes/Settings/components/SettingsLayout.tsx index 1cf53bb..b2208ce 100644 --- a/admin-spa/src/routes/Settings/components/SettingsLayout.tsx +++ b/admin-spa/src/routes/Settings/components/SettingsLayout.tsx @@ -63,14 +63,14 @@ export function SettingsLayout({ }, [title, onSave, isSaving, isLoading, saveLabel]); return ( -
+
{/* Content */} -
+
{!onSave && (
-
-
+
+

{title}

{description && (

{description}

@@ -86,7 +86,7 @@ export function SettingsLayout({
) : ( -
{children}
+
{children}
)}