Shell & navigation
Dashboard: every screen, state and flow in Shell & navigation.
16 screens and overlays, 40 states, 1 flows. Frames show a real screenshot where one was captured and a wireframe card where the state needs data or conditions a device run cannot produce.
Flows
Error paths
This page hit an error
Route crashed
Shows message or Something went wrong, plus Reference digest, logs to Sentry
Not reachable on a device: Needs a server error, crash, race or code change
Global error
Fatal error
Shows error message and digest
Not reachable on a device: Needs a server error, crash, race or code change
Branches and edge cases
This page hit an error
Overview overrides
overview/error.tsx replaces this card for that segment
Not reachable on a device: Needs a server error, crash, race or code change
Auth guard
Suspended account passes
Guard checks auth only, never role or account status
Needs data: Needs specific backend rows, a role, or a submitted write on a disposable record
App error boundary
Caught error
Reported to Sentry; Next.js internal errors are re-thrown
Not reachable on a device: Needs a server error, crash, race or code change
Flow diagram
Screens and states
Root redirect
root-redirectRoot redirect
Sends the bare domain to the overview.
src/app/page.tsx:3Entry
- Bare domain
Exits
- Redirect → /dashboard/overview
States · 1
src/components/auth/auth-guard.tsx:78Dashboard index redirect
Auth guard
AuthGuardAuth guard
Requires a session or stored token for all dashboard pages.
src/components/auth/auth-guard.tsx:43Entry
- Every /dashboard route
Exits
- No session → /auth/sign-in?callbackUrl=
States · 4
src/components/auth/auth-guard.tsx:93src/components/auth/auth-guard.tsx:105src/components/auth/auth-guard.tsx:85src/components/auth/auth-guard.tsx:43Protected route
Protected route
Needs data: Needs an under-privileged account to see the gate
ProtectedRouteProtected route
Client role gate per feature using the permission matrix.
src/components/auth/protected-route.tsx:50Entry
- Each page wraps its content
Exits
- Fail → AccessDenied
States · 2
src/components/auth/protected-route.tsx:61src/components/auth/protected-route.tsx:83Access Denied
Access Denied
Needs data: Needs an account with role apps or too low a role
AccessDeniedAccess Denied
Standard no-permission card.
src/components/auth/access-denied.tsx:40Entry
- Any failed ProtectedRoute check
Exits
- Go Back → previous page
- Dashboard → /dashboard/overview
States · 4
src/components/auth/access-denied.tsx:61src/components/auth/access-denied.tsx:73src/components/auth/access-denied.tsx:61src/components/auth/access-denied.tsx:102404 Something's missing
not-found404 Something's missing
Global not-found page.
src/app/not-found.tsx:7Entry
- Unknown URL
Exits
- Go back → previous page
- Back to Home → /dashboard
States · 1
src/app/not-found.tsx:7Global error
Global error
Not reachable on a device: Needs an error in the root layout; code change
global-errorGlobal error
Last-resort boundary replacing the whole document.
src/app/global-error.tsxEntry
- Error in root layout or unbounded segment
Exits
- Button → /dashboard/overview
States · 1
src/app/global-error.tsx:143This page hit an error
This page hit an error
Not reachable on a device: Needs a route that throws; code change
dashboard-errorThis page hit an error
Per-route crash boundary that keeps the shell mounted.
src/app/dashboard/error.tsx:15Entry
- Render error in any dashboard route
Exits
- Try again → reset()
States · 2
src/app/dashboard/error.tsx:22src/app/dashboard/overview/error.tsx:19App error boundary
App error boundary
Not reachable on a device: Needs an error in the root layout; code change
ErrorBoundaryApp error boundary
Root boundary reporting to Sentry with a reset button.
src/components/error-boundary.tsxEntry
- Wraps the root layout
Exits
- Reset → re-render
States · 1
src/components/error-boundary.tsx:23Dashboard shell
DashboardShellDashboard shell
Sidebar, header and scroll area with Suspense skeleton.
src/components/layout/dashboard-shell.tsx:33Entry
- Dashboard layout
Exits
- Sidebar and header navigation
States · 4
src/components/layout/dashboard-shell.tsx:43src/components/layout/dashboard-shell.tsx:28src/hooks/use-permissions.ts:166src/lib/role-snapshot.tsSidebar
AppSidebarSidebar
Role-filtered navigation, footer docs links and user card.
src/components/layout/app-sidebar.tsxEntry
- Every dashboard page
Exits
- Item → route
- Account Settings → /dashboard/profile
- Sign out → /auth/sign-in
- Signed out Sign in → /auth/sign-in
States · 4
src/lib/nav-filter.ts:33src/components/layout/app-sidebar.tsx:155src/components/layout/app-sidebar.tsx:83src/components/layout/app-sidebar.tsx:222Header notification bell
NotificationBellHeader notification bell
Popover with the signed-in staff member's own inbox.
src/components/layout/notification-bell.tsx:46Entry
- Bell button in header
Exits
- Row click → mark read, follow actionUrl
- Mark all read
- View all → /dashboard/notifications
States · 5
src/components/layout/notification-bell.tsx:58src/components/layout/notification-bell.tsx:165src/components/layout/notification-bell.tsx:112src/components/layout/notification-bell.tsx:66src/components/layout/notification-bell.tsx:86Command palette
KBarCommand palette
Keyboard navigation to the sidebar items allowed for the role.
src/components/kbar/index.tsxEntry
- Header search input
- kbar shortcut
Exits
- Action → router.push(url)
- External link → new tab
States · 1
src/components/kbar/index.tsx:29Export dialog
ExportDialogExport dialog
Choose CSV columns and export rows matching current filters.
src/components/ui/export-dialog.tsxEntry
- Export button on Orders, Sessions, Users, Support,
Exits
- Select all / Clear all
- Cancel
- Export → CSV download
States · 7
src/components/ui/export-dialog.tsx:206src/components/ui/export-dialog.tsx:206src/components/ui/export-dialog.tsx:249src/components/ui/export-dialog.tsx:76src/components/ui/export-dialog.tsx:148src/components/ui/export-dialog.tsx:160src/components/ui/role-gate.tsx:20Confirmation dialog
ConfirmationDialogConfirmation dialog
Generic confirm used by Orders, Sessions, Notifications, Webhooks.
src/components/ui/confirmation-dialog.tsxEntry
- Destructive actions on several pages
Exits
- Confirm → action
- Cancel
States · 2
src/components/ui/confirmation-dialog.tsxsrc/components/ui/confirmation-dialog.tsxAdminOnly control gate
AdminOnly control gate
Needs data: Needs a dashboard-role account to see the disabled control
AdminOnlyAdminOnly control gate
Renders child disabled with a tooltip for low roles.
src/components/ui/role-gate.tsx:20Entry
- Export, templates, queue, webhooks, reports
Exits
- None
States · 1
src/components/ui/role-gate.tsx:20










