dev experience

This commit is contained in:
2026-01-01 16:40:14 +01:00
parent 17d715f259
commit df7e5db5ba
12 changed files with 3745 additions and 6 deletions

View File

@@ -1,12 +1,17 @@
import AlphaFooter from '@/components/alpha/AlphaFooter';
import { AlphaNav } from '@/components/alpha/AlphaNav';
import DevToolbar from '@/components/dev/DevToolbar';
import { DebugModeToggle } from '@/components/dev/DebugModeToggle';
import { ApiErrorBoundary } from '@/components/errors/ApiErrorBoundary';
import { EnhancedErrorBoundary } from '@/components/errors/EnhancedErrorBoundary';
import { NotificationIntegration } from '@/components/errors/NotificationIntegration';
import { ErrorAnalyticsDashboard } from '@/components/errors/ErrorAnalyticsDashboard';
import NotificationProvider from '@/components/notifications/NotificationProvider';
import { AuthProvider } from '@/lib/auth/AuthContext';
import { getAppMode } from '@/lib/mode';
import { ServiceProvider } from '@/lib/services/ServiceProvider';
import { initializeGlobalErrorHandling } from '@/lib/infrastructure/GlobalErrorHandler';
import { initializeApiLogger } from '@/lib/infrastructure/ApiRequestLogger';
import { Metadata, Viewport } from 'next';
import Image from 'next/image';
import Link from 'next/link';
@@ -53,6 +58,24 @@ export default async function RootLayout({
}) {
const mode = getAppMode();
// Initialize debug tools in development
if (process.env.NODE_ENV === 'development') {
try {
initializeGlobalErrorHandling({
showDevOverlay: true,
verboseLogging: true,
captureEnhancedStacks: true,
});
initializeApiLogger({
logToConsole: true,
logBodies: true,
logResponses: true,
});
} catch (error) {
console.warn('Failed to initialize debug tools:', error);
}
}
if (mode === 'alpha') {
//const session = await authService.getCurrentSession();
const session = null;
@@ -67,14 +90,21 @@ export default async function RootLayout({
<AuthProvider initialSession={session}>
<NotificationProvider>
<NotificationIntegration />
<ApiErrorBoundary>
<EnhancedErrorBoundary enableDevOverlay={process.env.NODE_ENV === 'development'}>
<AlphaNav />
<main className="flex-1 max-w-7xl mx-auto px-6 py-8 w-full">
{children}
</main>
<AlphaFooter />
<DevToolbar />
</ApiErrorBoundary>
{/* Development Tools */}
{process.env.NODE_ENV === 'development' && (
<>
<DevToolbar />
<DebugModeToggle />
<ErrorAnalyticsDashboard refreshInterval={5000} />
</>
)}
</EnhancedErrorBoundary>
</NotificationProvider>
</AuthProvider>
</ServiceProvider>
@@ -91,7 +121,7 @@ export default async function RootLayout({
<body className="antialiased overflow-x-hidden">
<NotificationProvider>
<NotificationIntegration />
<ApiErrorBoundary>
<EnhancedErrorBoundary enableDevOverlay={process.env.NODE_ENV === 'development'}>
<header className="fixed top-0 left-0 right-0 z-50 bg-deep-graphite/80 backdrop-blur-sm border-b border-white/5">
<div className="max-w-7xl mx-auto px-6 py-4">
<div className="flex items-center justify-between">
@@ -116,7 +146,14 @@ export default async function RootLayout({
<div className="pt-16">
{children}
</div>
</ApiErrorBoundary>
{/* Development Tools */}
{process.env.NODE_ENV === 'development' && (
<>
<DebugModeToggle />
<ErrorAnalyticsDashboard refreshInterval={5000} />
</>
)}
</EnhancedErrorBoundary>
</NotificationProvider>
</body>
</html>