CBV01 commited on
Commit
902a16c
·
1 Parent(s): b31cb3a

fix(dashboard): eliminate horizontal scrollbar across dashboard and layout containers

Browse files
frontend/src/app/globals.css CHANGED
@@ -29,6 +29,13 @@
29
  --font-mono: var(--font-geist-mono);
30
  }
31
 
 
 
 
 
 
 
 
32
  body {
33
  background: var(--background);
34
  color: var(--foreground);
@@ -84,4 +91,9 @@ body {
84
 
85
  .animate-marquee:hover {
86
  animation-play-state: paused;
 
 
 
 
 
87
  }
 
29
  --font-mono: var(--font-geist-mono);
30
  }
31
 
32
+ html,
33
+ body {
34
+ max-width: 100vw;
35
+ overflow-x: hidden;
36
+ position: relative;
37
+ }
38
+
39
  body {
40
  background: var(--background);
41
  color: var(--foreground);
 
91
 
92
  .animate-marquee:hover {
93
  animation-play-state: paused;
94
+ }
95
+
96
+ .mask-linear-fade {
97
+ mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
98
+ -webkit-mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
99
  }
frontend/src/app/layout.tsx CHANGED
@@ -27,7 +27,7 @@ export default function RootLayout({
27
  return (
28
  <html lang="en" suppressHydrationWarning className="dark">
29
  <body
30
- className={`${geistSans.variable} ${geistMono.variable} antialiased selection:bg-blue-500/30 font-sans min-h-screen bg-background text-foreground`}
31
  >
32
  <ThemeProvider
33
  attribute="class"
 
27
  return (
28
  <html lang="en" suppressHydrationWarning className="dark">
29
  <body
30
+ className={`${geistSans.variable} ${geistMono.variable} antialiased selection:bg-blue-500/30 font-sans min-h-screen bg-background text-foreground overflow-x-hidden`}
31
  >
32
  <ThemeProvider
33
  attribute="class"
frontend/src/app/page.tsx CHANGED
@@ -186,9 +186,9 @@ export default function Dashboard() {
186
  }
187
 
188
  return (
189
- <div className="animate-in fade-in slide-in-from-bottom-4 duration-500">
190
- {/* Sticky Header Section */}
191
- <header className="sticky top-16 md:top-0 z-20 bg-background/90 backdrop-blur-md pt-2 pb-5 mb-6 border-b border-border/50 transition-all flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4">
192
  <div>
193
  <div className="flex items-center gap-2.5">
194
  <h2 className="text-2xl font-bold tracking-tight text-foreground">
@@ -212,7 +212,7 @@ export default function Dashboard() {
212
  <span>New Campaign</span>
213
  </Link>
214
  </div>
215
- </header>
216
 
217
  {/* Upgraded Metric Cards with Sparklines */}
218
  <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3.5 mb-6">
@@ -372,7 +372,7 @@ export default function Dashboard() {
372
  </div>
373
 
374
  {/* Interactive Chart Canvas */}
375
- <div className="flex-1 flex relative">
376
  {/* Y-Axis Labels */}
377
  <div className="flex flex-col justify-between py-6 pr-3 text-[10px] font-mono text-foreground/40 font-bold h-full w-12 shrink-0 text-right border-r border-border/30">
378
  {[chartMax, Math.round(chartMax * 0.75), Math.round(chartMax * 0.5), Math.round(chartMax * 0.25), 0].map(val => (
@@ -380,7 +380,7 @@ export default function Dashboard() {
380
  ))}
381
  </div>
382
 
383
- <div className="flex-1 relative pl-3">
384
  {/* Horizontal Grid Benchmark Lines */}
385
  <div className="absolute inset-x-0 inset-y-0 flex flex-col justify-between pointer-events-none py-6 ml-3 opacity-15">
386
  <div className="border-b border-dashed border-foreground/60 w-full"></div>
@@ -404,7 +404,7 @@ export default function Dashboard() {
404
  {/* SVG Curve */}
405
  <svg
406
  viewBox="0 0 1000 210"
407
- className="w-full h-full overflow-visible"
408
  preserveAspectRatio="none"
409
  >
410
  <defs>
@@ -596,8 +596,8 @@ export default function Dashboard() {
596
  <h3 className="text-base font-bold text-foreground tracking-tight">Recent Broadcast Activity</h3>
597
  <span className="text-xs text-foreground/40 font-medium">Auto-refreshed with background runner</span>
598
  </div>
599
- <div className="bg-card border border-border/80 rounded-2xl overflow-hidden shadow-sm overflow-x-auto custom-scrollbar">
600
- <table className="min-w-[540px] w-full text-left border-collapse">
601
  <thead>
602
  <tr className="border-b border-border/60 text-foreground/40 text-[10px] uppercase tracking-wider bg-foreground/[0.02]">
603
  <th className="font-bold p-3 pl-4">Account Node</th>
 
186
  }
187
 
188
  return (
189
+ <div className="animate-in fade-in slide-in-from-bottom-4 duration-500 w-full min-w-0 max-w-full overflow-x-hidden">
190
+ {/* Overview Section Header */}
191
+ <div className="pb-5 mb-6 border-b border-border/50 transition-all flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4">
192
  <div>
193
  <div className="flex items-center gap-2.5">
194
  <h2 className="text-2xl font-bold tracking-tight text-foreground">
 
212
  <span>New Campaign</span>
213
  </Link>
214
  </div>
215
+ </div>
216
 
217
  {/* Upgraded Metric Cards with Sparklines */}
218
  <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3.5 mb-6">
 
372
  </div>
373
 
374
  {/* Interactive Chart Canvas */}
375
+ <div className="flex-1 flex relative min-w-0 overflow-hidden">
376
  {/* Y-Axis Labels */}
377
  <div className="flex flex-col justify-between py-6 pr-3 text-[10px] font-mono text-foreground/40 font-bold h-full w-12 shrink-0 text-right border-r border-border/30">
378
  {[chartMax, Math.round(chartMax * 0.75), Math.round(chartMax * 0.5), Math.round(chartMax * 0.25), 0].map(val => (
 
380
  ))}
381
  </div>
382
 
383
+ <div className="flex-1 relative pl-3 min-w-0 overflow-hidden">
384
  {/* Horizontal Grid Benchmark Lines */}
385
  <div className="absolute inset-x-0 inset-y-0 flex flex-col justify-between pointer-events-none py-6 ml-3 opacity-15">
386
  <div className="border-b border-dashed border-foreground/60 w-full"></div>
 
404
  {/* SVG Curve */}
405
  <svg
406
  viewBox="0 0 1000 210"
407
+ className="w-full h-full overflow-hidden"
408
  preserveAspectRatio="none"
409
  >
410
  <defs>
 
596
  <h3 className="text-base font-bold text-foreground tracking-tight">Recent Broadcast Activity</h3>
597
  <span className="text-xs text-foreground/40 font-medium">Auto-refreshed with background runner</span>
598
  </div>
599
+ <div className="bg-card border border-border/80 rounded-2xl overflow-hidden shadow-sm overflow-x-auto custom-scrollbar w-full max-w-full">
600
+ <table className="min-w-[480px] w-full text-left border-collapse">
601
  <thead>
602
  <tr className="border-b border-border/60 text-foreground/40 text-[10px] uppercase tracking-wider bg-foreground/[0.02]">
603
  <th className="font-bold p-3 pl-4">Account Node</th>
frontend/src/components/Header.tsx CHANGED
@@ -153,11 +153,11 @@ export function Header({ user, status, onOpenSupport, onOpenEntitlements }: Head
153
  .toUpperCase();
154
 
155
  return (
156
- <header className="sticky top-0 z-30 w-full bg-background/80 backdrop-blur-xl border-b border-border/60 transition-all">
157
- <div className="flex items-center justify-between gap-3 px-4 md:px-8 py-2.5 max-w-7xl mx-auto">
158
 
159
  {/* Left / Center: Breaking News Ticker */}
160
- <div className="flex-1 min-w-0 flex items-center gap-3 mr-2">
161
  {/* Breaking News Pulsing Badge */}
162
  <div className="shrink-0 flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-rose-500/15 border border-rose-500/30 text-rose-400 text-[10px] font-black tracking-wider uppercase shadow-xs">
163
  <span className="relative flex h-2 w-2">
@@ -169,7 +169,7 @@ export function Header({ user, status, onOpenSupport, onOpenEntitlements }: Head
169
  </div>
170
 
171
  {/* Marquee Scroller */}
172
- <div className="flex-1 overflow-hidden relative group/ticker py-1 mask-linear-fade">
173
  <div className="animate-marquee cursor-default">
174
  {broadcasts.length > 0 ? (
175
  broadcasts.map((b, idx) => (
 
153
  .toUpperCase();
154
 
155
  return (
156
+ <header className="sticky top-0 z-30 w-full max-w-full overflow-x-hidden bg-background/80 backdrop-blur-xl border-b border-border/60 transition-all">
157
+ <div className="flex items-center justify-between gap-3 px-4 md:px-8 py-2.5 max-w-7xl mx-auto w-full min-w-0">
158
 
159
  {/* Left / Center: Breaking News Ticker */}
160
+ <div className="flex-1 min-w-0 flex items-center gap-3 mr-2 overflow-hidden">
161
  {/* Breaking News Pulsing Badge */}
162
  <div className="shrink-0 flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-rose-500/15 border border-rose-500/30 text-rose-400 text-[10px] font-black tracking-wider uppercase shadow-xs">
163
  <span className="relative flex h-2 w-2">
 
169
  </div>
170
 
171
  {/* Marquee Scroller */}
172
+ <div className="flex-1 min-w-0 overflow-hidden relative group/ticker py-1 mask-linear-fade [contain:paint]">
173
  <div className="animate-marquee cursor-default">
174
  {broadcasts.length > 0 ? (
175
  broadcasts.map((b, idx) => (
frontend/src/components/Sidebar.tsx CHANGED
@@ -244,7 +244,7 @@ export function Sidebar({ children }: { children: React.ReactNode }) {
244
  }
245
 
246
  return (
247
- <div className="flex w-full min-h-screen">
248
  {/* Mobile Topbar */}
249
  <div className="md:hidden fixed top-0 left-0 right-0 h-16 bg-background/80 backdrop-blur-3xl border-b border-border flex items-center justify-between px-4 z-50">
250
  <div className="flex items-center gap-2">
@@ -501,8 +501,8 @@ export function Sidebar({ children }: { children: React.ReactNode }) {
501
 
502
  {/* Main Content Wrapper */}
503
  <main className={`
504
- flex-1 min-h-screen pt-16 md:pt-0 transition-all duration-300 flex flex-col
505
- ${isCollapsed ? "md:ml-20" : "md:ml-50"}
506
  `}>
507
  <Header
508
  user={user}
@@ -510,7 +510,7 @@ export function Sidebar({ children }: { children: React.ReactNode }) {
510
  onOpenSupport={() => setShowSupportModal(true)}
511
  onOpenEntitlements={() => setShowEntitlementsFlyout(true)}
512
  />
513
- <div className={pathname === '/ai-assistant' ? 'p-1.5 md:p-2.5 max-w-[105rem] mx-auto h-[calc(100dvh-55px)] md:h-[calc(100vh-55px)] flex flex-col flex-1 w-full' : 'p-4 md:p-8 max-w-7xl mx-auto flex-1 w-full'}>
514
  {children}
515
  </div>
516
  </main>
 
244
  }
245
 
246
  return (
247
+ <div className="flex w-full min-h-screen min-w-0 max-w-full overflow-x-hidden">
248
  {/* Mobile Topbar */}
249
  <div className="md:hidden fixed top-0 left-0 right-0 h-16 bg-background/80 backdrop-blur-3xl border-b border-border flex items-center justify-between px-4 z-50">
250
  <div className="flex items-center gap-2">
 
501
 
502
  {/* Main Content Wrapper */}
503
  <main className={`
504
+ flex-1 min-h-screen min-w-0 max-w-full overflow-x-hidden pt-16 md:pt-0 transition-all duration-300 flex flex-col
505
+ ${isCollapsed ? "md:ml-20 md:max-w-[calc(100vw-5rem)]" : "md:ml-50 md:max-w-[calc(100vw-12.5rem)]"}
506
  `}>
507
  <Header
508
  user={user}
 
510
  onOpenSupport={() => setShowSupportModal(true)}
511
  onOpenEntitlements={() => setShowEntitlementsFlyout(true)}
512
  />
513
+ <div className={pathname === '/ai-assistant' ? 'p-1.5 md:p-2.5 max-w-[105rem] mx-auto h-[calc(100dvh-55px)] md:h-[calc(100vh-55px)] flex flex-col flex-1 w-full min-w-0 overflow-x-hidden' : 'p-4 md:p-8 max-w-7xl mx-auto flex-1 w-full min-w-0'}>
514
  {children}
515
  </div>
516
  </main>