Skip to content

Commit 016046f

Browse files
committed
fix(ui,proxy): mobile overflow polish + structured-output additionalProperties
- AccountRateLimitRecoveryChart: drop fixed 430px height on mobile and let the summary card row auto-size, so QuotaResetSummaryCard / PressureForecastCard no longer get clipped under the filter bar - Layout / SecurityBanner / Accounts / Usage: tighten min-w-0 + overflow-hidden on mobile-only flex containers to stop horizontal overflow - proxy/translator: add additionalProperties=false to every object node when sanitizing structured-output schemas (root + nested + items + $defs + anyOf/oneOf/allOf), required by Codex strict mode
1 parent 42d48a7 commit 016046f

7 files changed

Lines changed: 481 additions & 41 deletions

File tree

frontend/src/components/AccountRateLimitRecoveryChart.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export default function AccountRateLimitRecoveryChart({ accounts, currentRpm = 0
207207
})
208208

209209
return (
210-
<Card className={`${compact ? 'h-[430px]' : 'mb-4'} py-0 ${className}`}>
210+
<Card className={`${compact ? 'lg:h-[430px]' : 'mb-4'} py-0 ${className}`}>
211211
<CardContent className={compact ? 'flex h-full flex-col p-4' : 'p-4 sm:p-5'}>
212212
<div className="mb-2 flex flex-wrap items-start justify-between gap-3">
213213
<div className="min-w-0">
@@ -281,7 +281,7 @@ export default function AccountRateLimitRecoveryChart({ accounts, currentRpm = 0
281281
)}
282282
</div>
283283

284-
<div className={compact ? 'grid min-h-0 flex-1 grid-rows-[minmax(116px,1fr)_94px] gap-3' : 'grid gap-3'}>
284+
<div className={compact ? 'grid min-h-0 flex-1 grid-rows-[200px_auto] gap-3 lg:grid-rows-[minmax(116px,1fr)_94px]' : 'grid gap-3'}>
285285
<div className={compact ? 'min-h-0' : 'h-[260px]'}>
286286
<ResponsiveContainer width="100%" height="100%">
287287
<ComposedChart data={chartPoints} margin={viewMode === 'reset' ? resetChartMargin : chartMargin}>

frontend/src/components/Layout.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type PropsWithChildren, type ReactNode, useEffect, useRef, useState } from 'react'
1+
import { type CSSProperties, type PropsWithChildren, type ReactNode, useEffect, useRef, useState } from 'react'
22
import { NavLink, useLocation } from 'react-router-dom'
33
import { LayoutDashboard, Users, Activity, Settings, Server, Sun, Moon, Languages, Globe, BookOpen, KeyRound, Image as ImageIcon, ShieldAlert, ExternalLink, ChevronLeft, ChevronRight } from 'lucide-react'
44
import { useTranslation } from 'react-i18next'
@@ -108,10 +108,10 @@ export default function Layout({ children }: PropsWithChildren) {
108108
return (
109109
<div className="min-h-dvh">
110110
<div
111-
className="grid max-w-full max-lg:grid-cols-1 max-lg:px-3 transition-[grid-template-columns] duration-200"
111+
className="grid max-w-full grid-cols-1 max-lg:px-3 lg:grid-cols-[var(--admin-layout-columns)] transition-[grid-template-columns] duration-200"
112112
style={{
113-
gridTemplateColumns: sidebarCollapsed ? '64px minmax(0,1fr)' : '264px minmax(0,1fr)',
114-
}}
113+
'--admin-layout-columns': sidebarCollapsed ? '64px minmax(0,1fr)' : '264px minmax(0,1fr)',
114+
} as CSSProperties}
115115
>
116116
{/* Sidebar - desktop */}
117117
<aside className="sticky top-0 self-start h-dvh border-r border-border bg-[hsl(var(--sidebar-background))] max-lg:hidden">
@@ -268,12 +268,12 @@ export default function Layout({ children }: PropsWithChildren) {
268268
{/* Main content */}
269269
<main className="min-w-0 p-5 max-lg:p-3 max-lg:pb-[92px]">
270270
{/* Mobile topbar */}
271-
<header className="hidden max-lg:flex items-center justify-between gap-4 mb-4 p-3 border border-border rounded-lg bg-card/95 shadow-sm">
272-
<div className="flex items-center gap-3">
271+
<header className="hidden max-lg:flex min-w-0 w-full max-w-full items-center justify-between gap-2 overflow-hidden mb-4 p-3 border border-border rounded-lg bg-card/95 shadow-sm">
272+
<div className="flex min-w-0 flex-1 items-center gap-3">
273273
<img src={logoSrc} alt={siteName} className="w-8 h-8 rounded-[10px] object-cover" />
274-
<strong className="max-w-[150px] truncate text-lg" title={siteName}>{siteName}</strong>
274+
<strong className="min-w-0 flex-1 truncate text-lg" title={siteName}>{siteName}</strong>
275275
</div>
276-
<div className="flex items-center gap-2">
276+
<div className="flex shrink-0 items-center gap-1.5">
277277
<button
278278
onClick={toggleLang}
279279
className="flex items-center justify-center size-8 rounded-lg text-muted-foreground hover:text-foreground transition-colors text-[11px] font-bold"
@@ -290,7 +290,7 @@ export default function Layout({ children }: PropsWithChildren) {
290290
{theme === 'dark' ? <Sun className="size-4" /> : <Moon className="size-4" />}
291291
</span>
292292
</button>
293-
<span className="inline-flex items-center justify-center min-h-[28px] px-2.5 rounded-full text-[12px] font-bold bg-[hsl(var(--success-bg))] text-[hsl(var(--success))] shrink-0 whitespace-nowrap">
293+
<span className="inline-flex items-center justify-center min-h-[28px] px-2.5 rounded-full text-[12px] font-bold bg-[hsl(var(--success-bg))] text-[hsl(var(--success))] shrink-0 whitespace-nowrap max-[420px]:hidden">
294294
{t('common.online')}
295295
</span>
296296
</div>
@@ -316,7 +316,7 @@ export default function Layout({ children }: PropsWithChildren) {
316316
}`}
317317
>
318318
{item.icon}
319-
<span>{t(item.labelKey)}</span>
319+
<span className="w-full truncate leading-tight">{t(item.labelKey)}</span>
320320
</NavLink>
321321
)
322322
})}

frontend/src/components/SecurityBanner.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ export default function SecurityBanner() {
5959
}
6060

6161
return (
62-
<div className="mb-4 flex items-start gap-3 rounded-lg border border-red-500/40 bg-red-500/10 p-4 text-red-700 dark:text-red-200">
62+
<div className="mb-4 flex min-w-0 max-w-full items-start gap-3 overflow-hidden rounded-lg border border-red-500/40 bg-red-500/10 p-4 text-red-700 dark:text-red-200">
6363
<ShieldAlert className="mt-0.5 size-5 shrink-0" />
6464
<div className="flex-1 min-w-0">
6565
<p className="text-sm font-bold">{copy.title}</p>
66-
<p className="mt-1 text-sm leading-relaxed">{copy.body}</p>
66+
<p className="mt-1 break-words text-sm leading-relaxed [overflow-wrap:anywhere]">{copy.body}</p>
6767
<div className="mt-2 flex flex-wrap items-center gap-2">
6868
<a
6969
href="/admin/api-keys"

0 commit comments

Comments
 (0)