Add @bytelyst/command-palette (workspace:* + minimal lockfile importer entry). Mount CommandRegistryProvider + a lazily-loaded CommandMenu in providers.tsx, opened with ⌘K / Ctrl-K. Register navigate commands (Overview/Items/Board/Roadmap), New item (navigates to items with ?new=1 which auto-opens the create modal), Toggle theme, Sign out, and per-product Switch commands wired to setProductId. Command building lives in the pure src/lib/command-registry.ts. Add command-menu.test.tsx (jsdom) asserting the builder set and that the palette opens on ⌘K and lists commands. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
'use client';
|
|
|
|
import { useEffect, type ReactNode } from 'react';
|
|
import dynamic from 'next/dynamic';
|
|
import { CommandRegistryProvider } from '@bytelyst/command-palette';
|
|
import { AuthProvider } from '@/lib/auth-context';
|
|
import { ThemeProvider } from '@/lib/theme-context';
|
|
import { ProductProvider } from '@/lib/product-context';
|
|
import { initTelemetry } from '@/lib/telemetry';
|
|
|
|
import { CSPostHogProvider } from '@/components/posthog-provider';
|
|
|
|
// ⌘K palette — loaded lazily so its code stays out of the initial bundle (UX-5).
|
|
const CommandMenu = dynamic(() => import('@/components/command-menu'), { ssr: false });
|
|
|
|
export function Providers({ children }: { children: ReactNode }) {
|
|
useEffect(() => {
|
|
initTelemetry();
|
|
}, []);
|
|
|
|
return (
|
|
<CSPostHogProvider>
|
|
<ThemeProvider>
|
|
<ProductProvider>
|
|
<AuthProvider>
|
|
<CommandRegistryProvider>
|
|
{children}
|
|
<CommandMenu />
|
|
</CommandRegistryProvider>
|
|
</AuthProvider>
|
|
</ProductProvider>
|
|
</ThemeProvider>
|
|
</CSPostHogProvider>
|
|
);
|
|
}
|