Files

3.3 KiB

plan, phase, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
plan phase subsystem tags dependency_graph tech_stack key_files decisions metrics
06-01 6 admin-layout
layout
sidebar
navigation
refactor
requires provides affects
AdminSidebar
AppShell
/admin/clients route
src/app/admin/layout.tsx
src/components/admin/AdminSidebar.tsx
src/app/admin/clients/page.tsx
src/app/admin/page.tsx
added patterns
AppShell flex-row
active route highlighting via usePathname
created modified deleted
src/components/admin/AdminSidebar.tsx
src/app/admin/clients/page.tsx
src/app/admin/layout.tsx
src/app/admin/page.tsx
src/components/admin/NavBar.tsx
AdminSidebar uses usePathname with exact-match flag for /admin to avoid it matching all /admin/* routes
/admin redirects to /admin/clients as placeholder — real dashboard content in 06-02
NavBar deleted entirely — AdminSidebar covers all navigation needs
duration completed tasks_completed tasks_total
~10 minutes 2026-05-31 4 4

Phase 6 Plan 01: Sidebar layout — AdminSidebar + AppShell + move client list to /admin/clients Summary

Replaced the top horizontal NavBar with a persistent left sidebar (AdminSidebar). Admin layout is now a flex-row AppShell. Client list moved from /admin to /admin/clients. /admin redirects to /admin/clients as temporary placeholder until dashboard is built in 06-02.

Tasks Completed

Task Name Commit Files
1 Create AdminSidebar component 2283740 src/components/admin/AdminSidebar.tsx
2 Update AdminLayout to AppShell 29e0e88 src/app/admin/layout.tsx
3 Move client list to /admin/clients 191b548 src/app/admin/clients/page.tsx, src/app/admin/page.tsx
4 Delete NavBar.tsx + verify build 4d52d87 src/components/admin/NavBar.tsx (deleted)

What Was Built

AdminSidebar.tsx — client component with:

  • 7 nav links: Dashboard (exact match), Clienti, Progetti, Offerte, Forecast, Catalogo, Impostazioni
  • Active route highlighting via usePathname with exact-match support for /admin
  • Logout button at bottom with signOut({ callbackUrl: "/admin/login" })
  • Brand green sidebar bg #1A463C, 224px fixed width

AppShell layoutlayout.tsx is now flex min-h-screen: sidebar (shrink-0, w-56) left + <main className="flex-1"> right. Removed max-w-5xl container constraint.

Route migration/admin/clients/page.tsx is a direct copy of the old /admin/page.tsx with the archived toggle URL updated from /admin?archived=1 to /admin/clients?archived=1. /admin/page.tsx now simply calls redirect("/admin/clients").

Deviations from Plan

None — plan executed exactly as written.

Verification

  • npx tsc --noEmit: PASSED — no errors
  • npm run build: PASSED — all 22 routes compile, /admin/clients appears as dynamic route
  • No NavBar references remain in codebase (grep found zero matches)
  • NavBar.tsx deleted from src/components/admin/

Self-Check: PASSED

  • src/components/admin/AdminSidebar.tsx — created (2283740)
  • src/app/admin/layout.tsx — updated (29e0e88)
  • src/app/admin/clients/page.tsx — created (191b548)
  • src/app/admin/page.tsx — redirect placeholder (191b548)
  • src/components/admin/NavBar.tsx — deleted (4d52d87)
  • npm run build passes