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:
Moheeb Zara
2026-05-17 01:20:06 -07:00
parent 521fb1f8a8
commit 6c487802a5
2 changed files with 140 additions and 0 deletions
+2
View File
@@ -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"