Files
paint-ui/app/layout.tsx
Sebastian Krüger 2e18f43453 feat(ui/perf): implement loading states, keyboard navigation, and lazy-loaded tools
Add comprehensive UX and performance improvements:

**Loading States & Feedback:**
- Add loading overlay with spinner and custom messages
- Integrate loading states into all file operations (open, save, export)
- Create loading-store.ts for centralized loading state management

**Keyboard Navigation:**
- Expand keyboard shortcuts to include tool selection (1-7)
- Add layer navigation with Arrow Up/Down
- Add layer operations (Ctrl+D duplicate, Delete/Backspace remove)
- Display keyboard shortcuts in tool tooltips
- Enhanced keyboard shortcut system with proper key conflict handling

**Performance - Code Splitting:**
- Implement dynamic tool loader with lazy loading
- Tools load on-demand when first selected
- Preload common tools (pencil, brush, eraser) for instant access
- Add tool caching to prevent redundant loads
- Reduces initial bundle size and improves startup time

**Integration:**
- Add LoadingOverlay to app layout
- Update canvas-with-tools to use lazy-loaded tool instances
- Add keyboard shortcut hints to tool palette UI

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 16:08:24 +01:00

47 lines
1.5 KiB
TypeScript

import type { Metadata } from 'next';
import './globals.css';
import { ToastProvider } from '@/components/providers/toast-provider';
import { ContextMenu } from '@/components/ui/context-menu';
import { LoadingOverlay } from '@/components/ui/loading-overlay';
export const metadata: Metadata = {
title: 'Paint UI - Browser Image Editor',
description: 'Modern browser-based image editor built with Next.js. Multi-layer canvas, drawing tools, effects, and more.',
keywords: ['image editor', 'canvas', 'drawing', 'paint', 'layers', 'effects', 'photoshop alternative'],
};
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en" suppressHydrationWarning>
<head>
<script
dangerouslySetInnerHTML={{
__html: `
(function() {
try {
const theme = localStorage.getItem('theme');
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
const shouldBeDark = theme === 'dark' || (!theme && prefersDark);
if (shouldBeDark) {
document.documentElement.classList.add('dark');
}
} catch (e) {}
})();
`,
}}
/>
</head>
<body className="min-h-screen antialiased overflow-hidden">
{children}
<ToastProvider />
<ContextMenu />
<LoadingOverlay />
</body>
</html>
);
}