diff --git a/dashboards/tracker-web/src/__tests__/primitives-adapter.exports.test.ts b/dashboards/tracker-web/src/__tests__/primitives-adapter.exports.test.ts index 231710cc..14b80472 100644 --- a/dashboards/tracker-web/src/__tests__/primitives-adapter.exports.test.ts +++ b/dashboards/tracker-web/src/__tests__/primitives-adapter.exports.test.ts @@ -83,6 +83,16 @@ const EXPECTED_EXPORTS = [ 'DataListItem', 'DataListMeta', 'Timeline', + // UX-8 AppShell additions + 'AppShell', + 'AppShellMain', + 'AppShellMobileToggle', + 'AppShellNav', + 'AppShellNavItem', + 'AppShellOverlay', + 'AppShellPageHeader', + 'AppShellSidebar', + 'AppShellSkipLink', ] as const; describe('Primitives adapter — export presence', () => { diff --git a/dashboards/tracker-web/src/app/dashboard/layout.tsx b/dashboards/tracker-web/src/app/dashboard/layout.tsx index 086598ca..0b35aa43 100644 --- a/dashboards/tracker-web/src/app/dashboard/layout.tsx +++ b/dashboards/tracker-web/src/app/dashboard/layout.tsx @@ -1,9 +1,21 @@ 'use client'; -import { useEffect } from 'react'; -import { useRouter } from 'next/navigation'; +import { useEffect, useState } from 'react'; +import { useRouter, usePathname } from 'next/navigation'; import Link from 'next/link'; +import { + AppShell, + AppShellSkipLink, + AppShellMobileToggle, + AppShellOverlay, + AppShellSidebar, + AppShellNav, + AppShellNavItem, + AppShellMain, + Button, +} from '@/components/ui/Primitives'; import { useAuth } from '@/lib/auth-context'; +import { useTheme } from '@/lib/theme-context'; import { ProductSwitcher } from '@/components/product-switcher'; import { SystemBanners } from '@/components/system-banners'; @@ -13,9 +25,17 @@ const NAV_ITEMS = [ { href: '/dashboard/board', label: 'Board' }, ]; +/** Open the ⌘K command palette by replaying the global hotkey. */ +function openCommandPalette() { + window.dispatchEvent(new KeyboardEvent('keydown', { key: 'k', metaKey: true, ctrlKey: true })); +} + export default function DashboardLayout({ children }: { children: React.ReactNode }) { const { user, loading, logout } = useAuth(); + const { theme, setTheme } = useTheme(); const router = useRouter(); + const pathname = usePathname(); + const [navOpen, setNavOpen] = useState(false); useEffect(() => { if (!loading && !user) { @@ -31,45 +51,71 @@ export default function DashboardLayout({ children }: { children: React.ReactNod ); } + const go = (href: string) => (e: React.MouseEvent) => { + e.preventDefault(); + setNavOpen(false); + router.push(href); + }; + return ( -