Admin UX overhaul: P0 fixes, error-UX foundations, nav cleanup, tenant detail page
From the 2026-07-14 UI/UX audit (17/40). Four phases: P1 — Settings route crashed on Agents→Edit (Input/Textarea used but never imported). Added imports + a shared route-level error boundary (components/route-error.tsx) re-exported from all shell routes, so one crashing panel degrades to an explained card with the nav intact instead of replacing the whole app with a stack trace. Corrected the stale CLAUDE.md claim that `npm run typecheck` crashes — it works, and would have caught the missing import. P2 — Error/empty/feedback foundations. Fixed useSession identity churn that fired ~3x duplicate fetches per screen and self-inflicted 429s (referentially stable snapshot). New lib/errors.ts (describeError → plain-language + the fix) and components/data-state.tsx (DataState renders exactly one of error/loading/empty/content, so a failed load never shows as "empty"; DialogError for in-dialog failures; 429 auto-retry). Rolled across all 15 list routes; every mutation now toasts. Surfaced+fixed two silent-failure bugs (sso + buckets-CORS swallowed load errors; the latter could wipe rules on save). P3 — Nav IA + trust cleanup. Default-expanded rail; regrouped into 7 coherent sections; collapsed the Apps/Plan/Entitlements stub triplication into one honest /billing page; deleted fabricated seeded notifications and the dead Help menu item; fixed the 403 copy (referenced a tenant switcher that doesn't exist); removed orphan /assistant + /library routes; gated dev-seed login hints behind DEV; renamed /activity → /audit-log with a redirect. P4 — Tenant detail page (routes/tenants.$id.tsx + components/tenant-detail/*), closing the provision→configure gap. 8 tabs (Overview, Plan & quotas, Branding, Localization, Email & SMS, Feature flags, IP rules, Inbound webhooks), each verified saving to the real backend. Row name links to detail. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,6 @@ import {
|
||||
PanelLeftOpen,
|
||||
User as UserIcon,
|
||||
LogOut,
|
||||
HelpCircle,
|
||||
Menu,
|
||||
Play,
|
||||
HardDrive,
|
||||
@@ -38,8 +37,6 @@ import {
|
||||
Database,
|
||||
Plug,
|
||||
MessageSquare,
|
||||
Eye,
|
||||
LayoutGrid,
|
||||
CreditCard,
|
||||
// CREMA:NAV-ICONS
|
||||
} from "lucide-react"
|
||||
@@ -76,7 +73,6 @@ import {
|
||||
dismissAll,
|
||||
markAllRead,
|
||||
markRead,
|
||||
seedIfEmpty,
|
||||
unreadCount,
|
||||
useNotifications,
|
||||
} from "~/lib/notifications"
|
||||
@@ -121,7 +117,10 @@ const pinnedTop: NavItem[] = [
|
||||
]
|
||||
|
||||
// Pinned items render flat at the bottom of the rail, below all groups.
|
||||
// Audit log is cross-cutting rather than owned by any one group, so it sits
|
||||
// here next to Settings.
|
||||
const pinnedBottom: NavItem[] = [
|
||||
{ to: "/audit-log", icon: Activity, label: "Audit log" },
|
||||
{ to: "/settings", icon: Settings, label: "Settings" },
|
||||
]
|
||||
|
||||
@@ -132,9 +131,9 @@ const navGroups: NavGroup[] = [
|
||||
icon: Building2,
|
||||
items: [
|
||||
{ to: "/tenants", icon: Building2, label: "Tenants" },
|
||||
{ to: "/memberships", icon: UserCheck, label: "Memberships" },
|
||||
{ to: "/organizations", icon: Building, label: "Organizations" },
|
||||
{ to: "/users", icon: UsersIcon, label: "Users" },
|
||||
{ to: "/memberships", icon: UserCheck, label: "Memberships" },
|
||||
{ to: "/sso", icon: ShieldCheck, label: "SSO" },
|
||||
],
|
||||
},
|
||||
@@ -142,11 +141,9 @@ const navGroups: NavGroup[] = [
|
||||
key: "billing",
|
||||
label: "Billing",
|
||||
icon: CreditCard,
|
||||
items: [
|
||||
{ to: "/apps", icon: LayoutGrid, label: "Apps" },
|
||||
{ to: "/plan", icon: CreditCard, label: "Plan" },
|
||||
{ to: "/entitlements", icon: Gauge, label: "Entitlements" },
|
||||
],
|
||||
// One item today (Plan/Entitlements/Apps collapsed here — none has a live
|
||||
// endpoint yet). They split back into siblings under this group once wired.
|
||||
items: [{ to: "/billing", icon: CreditCard, label: "Plan & usage" }],
|
||||
},
|
||||
{
|
||||
key: "data",
|
||||
@@ -156,17 +153,25 @@ const navGroups: NavGroup[] = [
|
||||
{ to: "/storage", icon: HardDrive, label: "Storage" },
|
||||
{ to: "/buckets", icon: Boxes, label: "Buckets" },
|
||||
{ to: "/secrets", icon: KeyRound, label: "Secrets" },
|
||||
{ to: "/integrations", icon: Plug, label: "Integrations" },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: "integrations",
|
||||
label: "Integrations",
|
||||
key: "automation",
|
||||
label: "Automation",
|
||||
icon: Plug,
|
||||
items: [
|
||||
{ to: "/webhooks", icon: WebhookIcon, label: "Webhooks" },
|
||||
{ to: "/scheduled-tasks", icon: CalendarClock, label: "Scheduled" },
|
||||
{ to: "/integrations", icon: Plug, label: "Integrations" },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: "infrastructure",
|
||||
label: "Infrastructure",
|
||||
icon: Network,
|
||||
items: [
|
||||
{ to: "/networking", icon: Network, label: "Networking" },
|
||||
{ to: "/monitoring", icon: Gauge, label: "Monitoring" },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -178,15 +183,6 @@ const navGroups: NavGroup[] = [
|
||||
{ to: "/status-page", icon: AlertOctagon, label: "Status page" },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: "observability",
|
||||
label: "Observability",
|
||||
icon: Eye,
|
||||
items: [
|
||||
{ to: "/monitoring", icon: Gauge, label: "Monitoring" },
|
||||
{ to: "/activity", icon: Activity, label: "Audit log" },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: "ai",
|
||||
label: "AI & Search",
|
||||
@@ -260,8 +256,12 @@ export function AppShell({
|
||||
// short-circuit so a sign-out doesn't reduce the hook count and trip
|
||||
// React's "rendered fewer hooks than expected" check.
|
||||
const [expanded, setExpanded] = useState<boolean>(() => {
|
||||
if (typeof window === "undefined") return false
|
||||
return localStorage.getItem(SIDEBAR_KEY) === "1"
|
||||
if (typeof window === "undefined") return true
|
||||
// Default to expanded on first run — an icon-only rail of ~18 pictograms is
|
||||
// unreadable to anyone who hasn't memorised it. Collapse stays available and
|
||||
// is remembered once chosen.
|
||||
const stored = localStorage.getItem(SIDEBAR_KEY)
|
||||
return stored === null ? true : stored === "1"
|
||||
})
|
||||
useEffect(() => {
|
||||
localStorage.setItem(SIDEBAR_KEY, expanded ? "1" : "0")
|
||||
@@ -627,9 +627,6 @@ export function AppShell({
|
||||
>
|
||||
<Settings /> Settings
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem data-action="avatar-help">
|
||||
<HelpCircle /> Help
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItem
|
||||
data-action="avatar-signout"
|
||||
@@ -795,10 +792,6 @@ function NotificationsBell() {
|
||||
const unread = unreadCount(items)
|
||||
const navigate = useNavigate()
|
||||
|
||||
useEffect(() => {
|
||||
seedIfEmpty()
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<Popover>
|
||||
<PopoverTrigger
|
||||
|
||||
Reference in New Issue
Block a user