veza/apps/web/src/components/layout/DashboardLayout.tsx
senke 39b2b642d2 feat(web): UI premium Discord/Spotify-like — tokens, shadows, focus, layout
Plan UI premium 6–8 semaines (design system, shell, Storybook, a11y):

- Design system: DESIGN_TOKENS.md, APP_SHELL.md, FULL_LAYOUT_PAGE.md. Single source
  for layout/shell (index.css), shadows (design-system.css), durations/easing.
- Tokens: shadow-cover-depth, shadow-gold-glow, shadow-fab-glow; layout max-height
  (max-h-layout-drawer, max-h-layout-panel, max-h-layout-list). All duration-200/300/500
  replaced by --duration-fast/normal/slow. Arbitrary shadows replaced by token classes.
- Shell & player: Sidebar, Header, GlobalPlayer, MiniPlayer, PlayerQueue, PlayerControls,
  AudioPlayer use tokens; focus-visible on Sidebar, PlayerQueue, DropdownMenuTrigger/Item,
  TabsTrigger. Typography: text-[10px]/[9px] → text-xs where applicable.
- ESLint: no-restricted-syntax (warn) for w-/h-/rounded-/shadow-/text-/spacing arbitrary.
- Scripts: report-arbitrary-values.mjs, capture/compare/generate visual; visual-complete.spec.ts.
- Stories full layout: Dashboard, Playlists, Library, Settings, Profile in DashboardLayout.stories.
- .cursorrules + README: DESIGN_TOKENS, APP_SHELL, visual commands, no arbitrary without justification.
- apps/web/.gitignore: e2e test artifacts (test-results-visual, playwright-report-visual).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 17:15:58 +01:00

61 lines
No EOL
1.9 KiB
TypeScript

import type { ReactNode } from 'react';
import { Header } from './Header';
import { Sidebar } from './Sidebar';
import { GlobalPlayer } from '@/features/player/components/GlobalPlayer';
import { useUIStore } from '@/stores/ui';
import { cn } from '@/lib/utils';
import { AstralBackground } from '../ui/AstralBackground';
interface DashboardLayoutProps {
children: ReactNode;
}
/**
* Layout principal "App Shell" - Veza Professional V2
*
* Architecture:
* - Body: Fixed viewport (overflow-hidden)
* - Sidebar: Fixed left, z-index high
* - Main: Scrollable container independent of window
* - Header: Sticky top within Main
*/
export function DashboardLayout({ children }: DashboardLayoutProps) {
const { sidebarOpen } = useUIStore();
return (
<div className="flex h-screen w-full overflow-hidden relative bg-background">
{/* 1. Global Background (Fixed z-0) */}
<AstralBackground />
{/* 2. Fixed Sidebar (z-90) */}
<Sidebar />
{/* 3. Main Content Area (The only thing that scrolls) */}
<div
className={cn(
'flex-1 flex flex-col h-full relative z-10 transition-all duration-[var(--duration-slow)] ease-[var(--ease-in-out)]',
sidebarOpen ? 'lg:ml-main-expanded' : 'lg:ml-main-collapsed',
'ml-0'
)}
>
{/* Header is part of the flow but stays at top */}
<Header />
{/* Scrollable Content Container */}
<main
className="flex-1 overflow-y-auto overflow-x-hidden pt-main pb-main px-4 md:px-8 custom-scrollbar"
id="main-scroll-container"
>
<div className="max-w-layout-content mx-auto w-full">
{children}
</div>
</main>
{/* Floating Player (Fixed at bottom of screen, not scroll container) */}
<div className="absolute bottom-0 left-0 right-0 z-50">
<GlobalPlayer />
</div>
</div>
</div>
);
}