feat(ux): ⌘K/Ctrl-K command palette for fast navigation
New CommandPalette over the existing unused cmdk primitive, mounted in the (app) layout. Grouped nav destinations mirroring the sidebar; admin/ manage entries gated by the same isAdmin + navPerms the layout already resolves (so it never offers a route the guard would bounce). Opens on Cmd/Ctrl-K, type-to-filter, Enter to jump.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { createClient } from '@/lib/supabase/server'
|
||||
import { redirect } from 'next/navigation'
|
||||
import { AppSidebar } from '@/components/app-sidebar'
|
||||
import { CommandPalette } from '@/components/command-palette'
|
||||
import { ConfirmProvider } from '@/components/ui/confirm'
|
||||
import { getRoleLabelMap } from '@/lib/role-labels'
|
||||
|
||||
@@ -77,6 +78,7 @@ export default async function AppLayout({ children }: { children: React.ReactNod
|
||||
|
||||
return (
|
||||
<ConfirmProvider>
|
||||
<CommandPalette isAdmin={isAdminRole} navPerms={navPerms} />
|
||||
<div className="flex h-screen bg-background overflow-hidden">
|
||||
<a
|
||||
href="#main-content"
|
||||
|
||||
Reference in New Issue
Block a user