From 4c517d1173c071f6b5955ab1b9a86c1e0d1fa019 Mon Sep 17 00:00:00 2001 From: Menci Date: Wed, 29 Jul 2026 00:10:06 +0800 Subject: [PATCH] fix(web): floor every dashboard page region at zero width MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each route wraps its content in a single-column grid marked min-w-0, which lets the region itself shrink but leaves its column at `auto` — and an auto column grows to the widest child's min-content. One long error message bar was enough to push a page past the viewport, taking its header and its primary action off screen with it. The wrapper becomes a `dashboard-page` shortcut that pins the column to `minmax(0, 1fr)`, so the region stays the viewport's width and the message bar wraps onto a second line instead. --- apps/web/src/routes/dashboard-admin-backup-restore.tsx | 4 ++-- apps/web/src/routes/dashboard-admin-users.tsx | 2 +- apps/web/src/routes/dashboard-monitor-performance.tsx | 2 +- apps/web/src/routes/dashboard-monitor-usage.tsx | 2 +- apps/web/src/routes/dashboard-providers-model-aliases.tsx | 4 ++-- apps/web/src/routes/dashboard-providers-proxy.tsx | 6 +++--- apps/web/src/routes/dashboard-providers-search.tsx | 4 ++-- apps/web/src/routes/dashboard-providers-upstreams.tsx | 2 +- apps/web/src/routes/dashboard-services-api-docs.tsx | 2 +- apps/web/src/routes/dashboard-services-api-keys.tsx | 2 +- apps/web/src/routes/dashboard-settings.tsx | 2 +- apps/web/uno.config.ts | 5 +++++ 12 files changed, 21 insertions(+), 16 deletions(-) diff --git a/apps/web/src/routes/dashboard-admin-backup-restore.tsx b/apps/web/src/routes/dashboard-admin-backup-restore.tsx index 55c7da27f..2adb17b46 100644 --- a/apps/web/src/routes/dashboard-admin-backup-restore.tsx +++ b/apps/web/src/routes/dashboard-admin-backup-restore.tsx @@ -295,7 +295,7 @@ export default function DashboardAdminBackupRestore() { if (!user.isAdmin) { return ( -
+
@@ -303,7 +303,7 @@ export default function DashboardAdminBackupRestore() { } return ( -
+
diff --git a/apps/web/src/routes/dashboard-admin-users.tsx b/apps/web/src/routes/dashboard-admin-users.tsx index 0096953dd..e0f092c1b 100644 --- a/apps/web/src/routes/dashboard-admin-users.tsx +++ b/apps/web/src/routes/dashboard-admin-users.tsx @@ -147,7 +147,7 @@ export default function DashboardAdminUsers({ loaderData }: Route.ComponentProps }; return ( -
+
diff --git a/apps/web/src/routes/dashboard-monitor-performance.tsx b/apps/web/src/routes/dashboard-monitor-performance.tsx index a1634a94b..894302918 100644 --- a/apps/web/src/routes/dashboard-monitor-performance.tsx +++ b/apps/web/src/routes/dashboard-monitor-performance.tsx @@ -184,7 +184,7 @@ export default function DashboardMonitorPerformance({ loaderData }: Route.Compon .filter(key => key !== 'userId' || view === 'all-by-user') .map(key => ({ key, rows: overview.axes[key] })); - return
+ return
: clearForm()} onDelete={setDeleteTarget} onEdit={handleEdit} onRefresh={() => void refreshProxies()} />} -
+
{editingId !== null && void refreshProxies()} diff --git a/apps/web/src/routes/dashboard-providers-search.tsx b/apps/web/src/routes/dashboard-providers-search.tsx index 9d6694637..0fb678917 100644 --- a/apps/web/src/routes/dashboard-providers-search.tsx +++ b/apps/web/src/routes/dashboard-providers-search.tsx @@ -234,7 +234,7 @@ export default function DashboardProvidersSearch({ loaderData }: Route.Component if (!user.isAdmin) { return ( -
+
+
+
+
diff --git a/apps/web/src/routes/dashboard-services-api-keys.tsx b/apps/web/src/routes/dashboard-services-api-keys.tsx index 24354e0f1..63ec1c0ea 100644 --- a/apps/web/src/routes/dashboard-services-api-keys.tsx +++ b/apps/web/src/routes/dashboard-services-api-keys.tsx @@ -188,7 +188,7 @@ export default function DashboardServicesApiKeys({ loaderData }: Route.Component }; return ( -
+
+
diff --git a/apps/web/uno.config.ts b/apps/web/uno.config.ts index 7686e3fbf..2ce3b5bcd 100644 --- a/apps/web/uno.config.ts +++ b/apps/web/uno.config.ts @@ -14,6 +14,11 @@ export default defineConfig({ }, }, shortcuts: { + // A route's own content region. `min-w-0` alone lets the region shrink but + // leaves its single column at `auto`, which grows to the widest child's + // min-content — one long message bar then pushes the whole page past the + // viewport. The explicit track floors that column at zero. + 'dashboard-page': 'grid gap-[18px] min-w-0 grid-cols-[minmax(0,1fr)]', 'text-fui-fg1': 'text-[var(--colorNeutralForeground1)]', 'text-fui-fg2': 'text-[var(--colorNeutralForeground2)]', 'text-fui-fg3': 'text-[var(--colorNeutralForeground3)]',