diff --git a/openspec/changes/group-sidebar-categories/tasks.md b/openspec/changes/group-sidebar-categories/tasks.md
index 23930c1..be5686c 100644
--- a/openspec/changes/group-sidebar-categories/tasks.md
+++ b/openspec/changes/group-sidebar-categories/tasks.md
@@ -2,8 +2,13 @@
Portal only. TDD, then the review gate. Verify: `cd solvway-admin-portal && npx vitest run; echo VITEST=$? && npx tsc --noEmit && npm run lint` (check the vitest exit code).
-- [ ] 1.1 Category map, `groupSidebar`, the icon override, section rendering in `SidebarNav` (full, drawer and rail), and the label keys. The "Administration" label and `ADMIN_MODULES` go.
+- [x] 1.1 Category map, `groupSidebar`, the icon override, section rendering in `SidebarNav` (full, drawer and rail), and the label keys. The "Administration" label and `ADMIN_MODULES` go.
- Scope: `solvway-admin-portal/app/lib/aclSidebar*`, `solvway-admin-portal/app/components/app/Sidebar*`, `solvway-admin-portal/app/lib/i18n/defaultMessages.ts`
-- [ ] 1.2 Trim the icon map to the icons Co-Lite uses.
+- [x] 1.2 Trim the icon map to the icons Co-Lite uses.
- Scope: the icon map file and its tests
-- [ ] 1.3 DESIGN.md Navigation updated, and a Playwright check at 1280 px (full and rail) and 360 px (drawer) as a super admin, plus a staff user with event pages only.
+- [x] 1.3 DESIGN.md Navigation updated, and a Playwright check at 1280 px (full and rail) and 360 px (drawer) as a super admin, plus a staff user with event pages only.
+ - Done 2026-12-02 on the local stack:
+ - Playwright as super admin: the full sidebar at 1280 px (Dashboard, then Events, Leads, Access and System with labels and dividers), the collapsed rail (dividers only, Login security with its lock icon), and the drawer at 360 px.
+ - The staff-only scenario (event pages only) is covered by `Sidebar.sections.test.tsx`. No browser sign-in was done for it, because no local staff user has only those modules.
+ - Icon map trimmed to Co-Lite's 12 icons. The babyboo-only icon tests were removed, and the Activity-group test file was deleted.
+ - Portal verify: vitest 1572 passed (exit 0), tsc 0, lint 0 errors.
diff --git a/solvway-admin-portal/DESIGN.md b/solvway-admin-portal/DESIGN.md
index 3b480b4..b3be69c 100644
--- a/solvway-admin-portal/DESIGN.md
+++ b/solvway-admin-portal/DESIGN.md
@@ -237,7 +237,7 @@ Quiet, compact, unmistakable.
- Live inside a card or an 8px framed container. Header row in slate tint, 40px tall, 12px semibold uppercase muted labels with sort chevrons; cells 14px with 8px padding; rows separated by hairlines, hovering at 50% slate tint. The pager below reads "1-7 of 7" left and outline Previous / Next right.
### Navigation
-- **Sidebar:** white, right hairline. Items are 44px tall, 8px radius, 20px outline icon plus 14px medium label. Idle: muted slate, hover slate tint with ink. Active: blue tint with deep blue ink, `aria-current="page"`. Groups expand with a rotating chevron and indent children behind a left hairline. The collapsed rail shows icons only, with groups opening as a side popover. Admin pages (Users, Roles, Emails, Login security, Audit log, Companies) sit below a hairline divider and a 12px semibold muted "Administration" label; the rail keeps the divider only, and a section with nothing to open is not drawn.
+- **Sidebar:** white, right hairline. Items are 44px tall, 8px radius, 20px outline icon plus 14px medium label. Idle: muted slate, hover slate tint with ink. Active: blue tint with deep blue ink, `aria-current="page"`. Groups expand with a rotating chevron and indent children behind a left hairline. The collapsed rail shows icons only, with groups opening as a side popover. Pages are grouped into always-open sections: Dashboard alone, then Events (Events, Event leads), Leads (Leads, Interests), Access (Users, Roles, Login security) and System (Companies, Emails, Audit log). Each later section starts with a hairline divider and a 12px semibold muted label; the rail keeps the dividers only, a section with nothing to open is not drawn, and a page the map does not know trails in a last unlabelled section. Every page has its own icon.
- **Header:** white, bottom hairline, 56px; the link back to the parent page left (sub-pages only); company picker (a styled select), locale switcher, theme toggle and user menu (blue avatar initial) right.
### Data States
diff --git a/solvway-admin-portal/app/components/app/Sidebar.sections.test.tsx b/solvway-admin-portal/app/components/app/Sidebar.sections.test.tsx
index 329a28d..f836ac9 100644
--- a/solvway-admin-portal/app/components/app/Sidebar.sections.test.tsx
+++ b/solvway-admin-portal/app/components/app/Sidebar.sections.test.tsx
@@ -9,46 +9,70 @@ vi.mock("@/app/lib/useAclSidebar", () => ({ useAclSidebar: () => state.links }))
import { SidebarNav } from "./Sidebar";
-const link = (name: string): SidebarLink => ({ name, url: `/${name}`, children: [] });
+const link = (name: string): SidebarLink => ({ name, url: `/${name}`, iconName: "Users", children: [] });
const names = (...n: string[]) => n.map(link);
const ALL = names(
"BO_DASHBOARD", "BO_EVENTS", "BO_EVENT_LEADS", "BO_INTERESTS", "BO_LEADS",
"BO_USERS", "BO_ROLES", "BO_EMAILS", "BO_LOGIN_SECURITY", "BO_AUDIT_LOG", "BO_COMPANIES",
);
+const linkNames = (list: HTMLElement) => within(list).getAllByRole("link").map((a) => a.getAttribute("href")?.slice(1));
describe("Sidebar sections", () => {
- it("lists work pages above the Administration label and admin pages below it", () => {
- state.links = ALL;
+ it("lists Dashboard, then Events, Leads, Access and System sections in order", () => {
+ state.links = [...ALL].reverse();
render();
- const label = screen.getByText("Administration");
- const before = (el: HTMLElement) => label.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_PRECEDING;
- const after = (el: HTMLElement) => label.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING;
- const hrefs = (re: RegExp) => screen.getAllByRole("link").filter((a) => re.test(a.getAttribute("href") ?? ""));
- for (const a of hrefs(/DASHBOARD|EVENTS|EVENT_LEADS|INTERESTS|LEADS/)) expect(before(a)).toBeTruthy();
- for (const a of hrefs(/USERS|ROLES|EMAILS|LOGIN_SECURITY|AUDIT_LOG|COMPANIES/)) expect(after(a)).toBeTruthy();
+ const lists = screen.getAllByRole("list");
+ expect(lists).toHaveLength(5);
+ expect(linkNames(lists[0])).toEqual(["BO_DASHBOARD"]);
+ expect(linkNames(screen.getByRole("list", { name: "Events" }))).toEqual(["BO_EVENTS", "BO_EVENT_LEADS"]);
+ expect(linkNames(screen.getByRole("list", { name: "Leads" }))).toEqual(["BO_LEADS", "BO_INTERESTS"]);
+ expect(linkNames(screen.getByRole("list", { name: "Access" }))).toEqual(["BO_USERS", "BO_ROLES", "BO_LOGIN_SECURITY"]);
+ expect(linkNames(screen.getByRole("list", { name: "System" }))).toEqual(["BO_COMPANIES", "BO_EMAILS", "BO_AUDIT_LOG"]);
expect(screen.getAllByRole("link")).toHaveLength(11);
});
- it("names the admin list by the label", () => {
- state.links = ALL;
- render();
- const list = screen.getByRole("list", { name: "Administration" });
- expect(within(list).getAllByRole("link")).toHaveLength(6);
- });
-
- it("shows no Administration label or divider when no admin module is available", () => {
+ it("shows only the sections the user has pages in", () => {
state.links = names("BO_EVENTS", "BO_EVENT_LEADS");
const { container } = render();
- expect(screen.queryByText("Administration")).toBeNull();
+ expect(screen.getByRole("list", { name: "Events" })).toBeTruthy();
+ for (const label of ["Leads", "Access", "System"]) expect(screen.queryByText(label)).toBeNull();
expect(container.querySelector("[data-slot='sidebar-divider']")).toBeNull();
});
- it("shows only the divider in the collapsed rail", () => {
+ it("puts a divider between sections but not above the first", () => {
+ state.links = ALL;
+ const { container } = render();
+ expect(container.querySelectorAll("[data-slot='sidebar-divider']")).toHaveLength(4);
+ expect(container.querySelector("nav")!.firstElementChild!.tagName).toBe("UL");
+ });
+
+ it("lists an unknown page after System without a label", () => {
+ state.links = [...ALL, link("BO_NEW_THING")];
+ const { container } = render();
+ const lists = screen.getAllByRole("list");
+ expect(lists).toHaveLength(6);
+ const last = lists[5];
+ expect(linkNames(last)).toEqual(["BO_NEW_THING"]);
+ expect(last.getAttribute("aria-labelledby")).toBeNull();
+ expect(last.getAttribute("aria-label")).toBeNull();
+ expect(container.querySelectorAll("[data-slot='sidebar-divider']")).toHaveLength(5);
+ });
+
+ it("shows dividers and no labels in the collapsed rail", () => {
state.links = ALL;
const { container } = render();
- expect(screen.queryByText("Administration")).toBeNull();
- expect(container.querySelector("[data-slot='sidebar-divider']")).not.toBeNull();
+ for (const label of ["Events", "Leads", "Access", "System"]) expect(screen.queryByText(label)).toBeNull();
+ expect(container.querySelectorAll("[data-slot='sidebar-divider']")).toHaveLength(4);
+ expect(screen.getByRole("list", { name: "Access" })).toBeTruthy();
expect(screen.getAllByRole("link")).toHaveLength(11);
});
+
+ it("renders Login security with a different icon than Roles", () => {
+ state.links = [{ ...link("BO_ROLES"), iconName: "Shield" }, { ...link("BO_LOGIN_SECURITY"), iconName: "Shield" }];
+ render();
+ const icon = (name: string) => document.querySelector(`a[href='/${name}'] svg`)!.getAttribute("class");
+ expect(icon("BO_ROLES")).toContain("lucide-shield");
+ expect(icon("BO_LOGIN_SECURITY")).toContain("lucide-lock-keyhole");
+ });
});
diff --git a/solvway-admin-portal/app/components/app/Sidebar.test.tsx b/solvway-admin-portal/app/components/app/Sidebar.test.tsx
index ec770f6..6745f78 100644
--- a/solvway-admin-portal/app/components/app/Sidebar.test.tsx
+++ b/solvway-admin-portal/app/components/app/Sidebar.test.tsx
@@ -24,12 +24,13 @@ vi.mock("@/app/lib/useAclSidebar", () => ({
import Sidebar from "./Sidebar";
+// Icons are Co-Lite seed icons (group-sidebar-categories trimmed the babyboo-only ones).
const BO_FIXTURE: SidebarLink[] = [
{ name: "Dashboard", url: "/", iconName: "LayoutDashboard", children: [] },
{ name: "Members", url: "/members", iconName: "Users", children: [] },
- { name: "Reports", url: "/reports", iconName: "FileText", children: [] },
- { name: "Network", url: "/network", iconName: "Network", children: [] },
- { name: "Messages", url: "/messages", iconName: "Languages", children: [] },
+ { name: "Reports", url: "/reports", iconName: "Mail", children: [] },
+ { name: "Network", url: "/network", iconName: "ScrollText", children: [] },
+ { name: "Messages", url: "/messages", iconName: "Tags", children: [] },
];
describe("Sidebar icon rendering", () => {
@@ -41,9 +42,9 @@ describe("Sidebar icon rendering", () => {
expect(screen.getByText("Messages")).toBeInTheDocument();
expect(container.querySelector("svg.lucide-layout-dashboard")).not.toBeNull();
expect(container.querySelector("svg.lucide-users")).not.toBeNull();
- expect(container.querySelector("svg.lucide-file-text")).not.toBeNull();
- expect(container.querySelector("svg.lucide-network")).not.toBeNull();
- expect(container.querySelector("svg.lucide-languages")).not.toBeNull();
+ expect(container.querySelector("svg.lucide-mail")).not.toBeNull();
+ expect(container.querySelector("svg.lucide-scroll-text")).not.toBeNull();
+ expect(container.querySelector("svg.lucide-tags")).not.toBeNull();
});
it("renders the neutral fallback icon, and does not throw, for an unknown or absent iconName", () => {
diff --git a/solvway-admin-portal/app/components/app/Sidebar.tsx b/solvway-admin-portal/app/components/app/Sidebar.tsx
index 117f993..4657ed4 100644
--- a/solvway-admin-portal/app/components/app/Sidebar.tsx
+++ b/solvway-admin-portal/app/components/app/Sidebar.tsx
@@ -1,11 +1,11 @@
"use client";
-import { useEffect, useId, useState } from "react";
+import { Fragment, useEffect, useId, useState } from "react";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { ChevronDown, PanelLeftClose, PanelLeftOpen } from "lucide-react";
import { useAclSidebar } from "@/app/lib/useAclSidebar";
-import { ADMIN_MODULES, currentTrail, type SidebarLink } from "@/app/lib/aclSidebar";
+import { currentTrail, groupSidebar, type SidebarLink } from "@/app/lib/aclSidebar";
import { useT } from "@/app/lib/i18n/MessagesProvider";
import { iconFor } from "./icon-map";
import { cn } from "@/app/lib/utils";
@@ -215,39 +215,48 @@ function RailGroup({
export function SidebarNav({ onNavigate, collapsed = false }: { onNavigate?: () => void; collapsed?: boolean }) {
const t = useT();
const links = useAclSidebar();
- const trail = currentTrail(links, usePathname());
- const adminLabelId = useId();
-
- const work = links.filter((l) => !ADMIN_MODULES.includes(l.name));
- const admin = links.filter((l) => ADMIN_MODULES.includes(l.name));
+ const sections = groupSidebar(links);
+ // Trail from the grouped links: groupSidebar copies them, and active matching is by identity.
+ const trail = currentTrail(sections.flatMap((s) => s.links), usePathname());
+ const idBase = useId();
const render = (link: SidebarLink) =>
collapsed ? (
) : (
);
- const listClass = cn("space-y-1", collapsed ? "px-2 py-3" : "p-3");
return (
);
}
diff --git a/solvway-admin-portal/app/components/app/icon-map.activity.test.tsx b/solvway-admin-portal/app/components/app/icon-map.activity.test.tsx
deleted file mode 100644
index f97fc4c..0000000
--- a/solvway-admin-portal/app/components/app/icon-map.activity.test.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { render } from "@testing-library/react";
-import { describe, it, expect } from "vitest";
-import { iconFor } from "./icon-map";
-
-// add-online-users: the Activity group (BO_NAV_ACTIVITY), Online users and Audit log seed icons.
-describe("iconFor — Activity group", () => {
- it.each(["Activity", "UserCheck", "ScrollText"])("resolves %s to a real (non-fallback) icon", (name) => {
- const Icon = iconFor(name);
- const { container } = render();
- expect(container.querySelector("svg")).not.toBeNull();
- expect(container.querySelector("svg.lucide-circle")).toBeNull();
- });
-});
diff --git a/solvway-admin-portal/app/components/app/icon-map.test.tsx b/solvway-admin-portal/app/components/app/icon-map.test.tsx
index b13d192..39419f6 100644
--- a/solvway-admin-portal/app/components/app/icon-map.test.tsx
+++ b/solvway-admin-portal/app/components/app/icon-map.test.tsx
@@ -3,8 +3,9 @@ import { describe, it, expect } from "vitest";
import { iconFor } from "./icon-map";
// Covers spec "The Sidebar Renders Lucide Icons From icon_name":
-// - a seeded icon name renders as a lucide icon
+// - every icon Co-Lite seeds (or overrides in the sidebar) renders as a real lucide icon
// - an unknown/absent icon name falls back safely (no throw)
+// group-sidebar-categories: the map holds only Co-Lite's icons; babyboo-only entries were removed.
describe("iconFor", () => {
it("resolves a seeded lucide icon name (LayoutDashboard) to a component that renders", () => {
@@ -13,55 +14,21 @@ describe("iconFor", () => {
expect(container.querySelector("svg.lucide-layout-dashboard")).not.toBeNull();
});
- it.each(["Users", "FileText", "Network", "Languages", "Shield", "Settings", "Bell"])(
- "resolves seeded icon name %s to its matching lucide component",
- (name) => {
- const Icon = iconFor(name);
- const { container } = render();
- expect(container.querySelector("svg")).not.toBeNull();
- expect(container.querySelector("svg.lucide-circle")).toBeNull();
- },
- );
+ it.each([
+ "LayoutDashboard", "CalendarDays", "ClipboardList", "Tags", "Users", "UserCog",
+ "ShieldCheck", "Shield", "LockKeyhole", "Mail", "ScrollText", "Store",
+ ])("resolves Co-Lite icon name %s to a real (non-fallback) lucide component", (name) => {
+ const Icon = iconFor(name);
+ const { container } = render();
+ expect(container.querySelector("svg")).not.toBeNull();
+ expect(container.querySelector("svg.lucide-circle")).toBeNull();
+ });
- it.each(["Calendar"])(
- "resolves Events sidebar seed icon %s to a real (non-fallback) lucide component",
- (name) => {
- const Icon = iconFor(name);
- const { container } = render();
- expect(container.querySelector("svg")).not.toBeNull();
- expect(container.querySelector("svg.lucide-circle")).toBeNull();
- },
- );
-
- it.each(["ShoppingCart"])(
- "resolves POS counter-sales sidebar seed icon %s to a real (non-fallback) lucide component",
- (name) => {
- const Icon = iconFor(name);
- const { container } = render();
- expect(container.querySelector("svg")).not.toBeNull();
- expect(container.querySelector("svg.lucide-circle")).toBeNull();
- },
- );
-
- it.each(["Store"])(
- "resolves Branch Counter sidebar seed icon %s to a real (non-fallback) lucide component",
- (name) => {
- const Icon = iconFor(name);
- const { container } = render();
- expect(container.querySelector("svg")).not.toBeNull();
- expect(container.querySelector("svg.lucide-circle")).toBeNull();
- },
- );
-
- it.each(["ArrowDownToLine", "BarChart2", "ArrowLeftRight", "History", "SlidersHorizontal"])(
- "resolves Inventory sidebar seed icon %s to a real (non-fallback) lucide component",
- (name) => {
- const Icon = iconFor(name);
- const { container } = render();
- expect(container.querySelector("svg")).not.toBeNull();
- expect(container.querySelector("svg.lucide-circle")).toBeNull();
- },
- );
+ it("no longer maps babyboo-only icons such as ShoppingCart (they fall back)", () => {
+ const Icon = iconFor("ShoppingCart");
+ const { container } = render();
+ expect(container.querySelector("svg.lucide-circle")).not.toBeNull();
+ });
it("falls back to a neutral icon, without throwing, for an unknown name", () => {
expect(() => iconFor("NotARealLucideIconName")).not.toThrow();
@@ -81,22 +48,4 @@ describe("iconFor", () => {
const { container } = render();
expect(container.querySelector("svg.lucide-circle")).not.toBeNull();
});
-
- // fix-admin-sidebar-groups-icons: icon_name values on live BO module rows that used to
- // render the fallback circle.
- it.each(["ShieldCheck", "Wallet", "Mail", "Coins", "Megaphone", "Warehouse", "UserCog", "GalleryHorizontalEnd", "MessagesSquare", "Wrench"])(
- "resolves live BO module icon name %s to a real (non-fallback) lucide component",
- (name) => {
- const Icon = iconFor(name);
- const { container } = render();
- expect(container.querySelector("svg")).not.toBeNull();
- expect(container.querySelector("svg.lucide-circle")).toBeNull();
- },
- );
-
- it("resolves the Collections seed icon Layers to a real lucide component (add-storefront-collections)", () => {
- const Icon = iconFor("Layers");
- const { container } = render();
- expect(container.querySelector("svg.lucide-layers")).not.toBeNull();
- });
});
diff --git a/solvway-admin-portal/app/components/app/icon-map.ts b/solvway-admin-portal/app/components/app/icon-map.ts
index 4713aad..55c6383 100644
--- a/solvway-admin-portal/app/components/app/icon-map.ts
+++ b/solvway-admin-portal/app/components/app/icon-map.ts
@@ -1,4 +1,4 @@
-import { Activity, ArrowDownToLine, ArrowLeftRight, BarChart2, Bell, Box, Calendar, CalendarDays, Circle, ClipboardList, Coins, CreditCard, FileText, GalleryHorizontalEnd, Gift, History, LayoutDashboard, Languages, Layers, Mail, Megaphone, Menu, MessagesSquare, Network, Package, Settings, Shield, ShieldCheck, ShoppingCart, SlidersHorizontal, Star, Store, Tags, ScrollText, Undo2, UserCheck, UserCog, Users, Wallet, Warehouse, Wrench } from "lucide-react";
+import { CalendarDays, Circle, ClipboardList, LayoutDashboard, LockKeyhole, Mail, ScrollText, Shield, ShieldCheck, Store, Tags, UserCog, Users } from "lucide-react";
import type { LucideIcon } from "lucide-react";
// Maps the aclMenu tree's `iconName` (a plain string served by
@@ -6,78 +6,23 @@ import type { LucideIcon } from "lucide-react";
// component. A curated map, not `import * as Icons from "lucide-react"`: the
// old src/components/app/nav-config.ts imported icon components directly, and
// pulling in the whole icon set here would ship every lucide icon to the
-// browser for a handful of nav entries. Extend this map as more modules are
-// seeded with new iconName values.
+// browser for a handful of nav entries. Add an entry when a module is seeded
+// with a new iconName value.
const ICONS: Record = {
+ // Icons Co-Lite seeds (local/seed/03-colite.sql and the archived change SQL), plus Companies (Store)
+ // and Login security (LockKeyhole, a sidebar override).
LayoutDashboard,
- // Activity group (add-online-users): BO_NAV_ACTIVITY, Online users and Audit log seed icons.
- Activity,
- UserCheck,
- ScrollText,
- Users,
- FileText,
- Network,
- Languages,
- // Collapsible nav group headers (add-admin-portal-nav-groups).
- Shield,
- Settings,
- // Notifications module (add-admin-internal-notifications, seed id 41300000).
- Bell,
- // Catalogue Setup module (add-admin-catalog-setup): BO_CATALOG nav group and
- // BO_CATALOG_SETUP page.
- Package,
- Tags,
- Layers,
- // Product Setup module (add-admin-product-setup): BO_PRODUCTS page seed icon.
- Box,
- // Inventory module (add-inventory-stock-in): Stock In and Stock on Hand seed icons.
- ArrowDownToLine,
- BarChart2,
- // Inventory transfers + movement history (add-inventory-transfers-movement-history, I3):
- // Transfers and Movement History seed icons.
- ArrowLeftRight,
- History,
- // Inventory adjustments (add-inventory-adjustments, I4):
- // Adjustments seed icon.
- SlidersHorizontal,
- // Events module (add-event-module-pickup-e1, E1):
- // Events page seed icon.
- Calendar,
- // add-admin-events: BO_EVENTS seed icon_name = 'CalendarDays'.
CalendarDays,
- // POS counter-sales module (add-event-pos-counter-sales):
- // POS page seed icon (sql/02-seed-bo-module-pos.sql icon_name = 'ShoppingCart').
- ShoppingCart,
- // Payment Methods module (add-payment-method-config, 2a):
- // seed icon_name = 'CreditCard'.
- CreditCard,
- // Branch Counter POS module (add-branch-counter-sale):
- // seed icon_name = 'Store'.
- Store,
- // Refund Requests (add-refund-requests, seed id 44300000).
- Undo2,
- // Gift Cards (add-gift-card-core, seed id 45000000, icon_name 'Gift').
- Gift,
- // Live BO module icon_name values that rendered the fallback circle
- // (fix-admin-sidebar-groups-icons).
- ShieldCheck,
- Wallet,
- Mail,
- Coins,
- Megaphone,
- Warehouse,
- UserCog,
- GalleryHorizontalEnd,
- // add-member-messaging: BO_MEMBER_MESSAGES seed icon_name = 'MessagesSquare'.
- MessagesSquare,
- // BO_RANK_REFERRAL seed icon_name = 'Wrench'.
- Wrench,
- // Product reviews (add-product-reviews, seed id 44800000).
- Star,
- // Forms (add-cms-forms, seed id 45200000).
ClipboardList,
- // Menus (add-storefront-menus, seed id 45300000).
- Menu,
+ Tags,
+ Users,
+ UserCog,
+ ShieldCheck,
+ Shield,
+ LockKeyhole,
+ Mail,
+ ScrollText,
+ Store,
};
/** Neutral fallback for an absent or unrecognised `iconName` (spec: "The
diff --git a/solvway-admin-portal/app/lib/aclSidebar.ts b/solvway-admin-portal/app/lib/aclSidebar.ts
index 480ddda..a699aca 100644
--- a/solvway-admin-portal/app/lib/aclSidebar.ts
+++ b/solvway-admin-portal/app/lib/aclSidebar.ts
@@ -12,8 +12,32 @@ export interface SidebarLink {
children: SidebarLink[];
}
-// ponytail: fixed list; a new admin module falls into the work section until added here.
-export const ADMIN_MODULES = ["BO_USERS", "BO_ROLES", "BO_EMAILS", "BO_LOGIN_SECURITY", "BO_AUDIT_LOG", "BO_COMPANIES"];
+// ponytail: fixed map; a new module lands in the trailing unlabelled section until added here.
+// `label` is an i18n key; the first section has none (Dashboard stands alone).
+export const SIDEBAR_SECTIONS: { label?: string; modules: string[] }[] = [
+ { modules: ["BO_DASHBOARD"] },
+ { label: "SidebarSectionEvents", modules: ["BO_EVENTS", "BO_EVENT_LEADS"] },
+ { label: "SidebarSectionLeads", modules: ["BO_LEADS", "BO_INTERESTS"] },
+ { label: "SidebarSectionAccess", modules: ["BO_USERS", "BO_ROLES", "BO_LOGIN_SECURITY"] },
+ { label: "SidebarSectionSystem", modules: ["BO_COMPANIES", "BO_EMAILS", "BO_AUDIT_LOG"] },
+];
+
+// Icon overrides by module name, so a shared seed icon can differ in the sidebar.
+export const SIDEBAR_ICONS: Record = { BO_LOGIN_SECURITY: "LockKeyhole" };
+
+/** Splits links into the SIDEBAR_SECTIONS order; unknown links trail in an unlabelled section; empty sections drop. */
+export function groupSidebar(links: SidebarLink[]): { label?: string; links: SidebarLink[] }[] {
+ const known = SIDEBAR_SECTIONS.flatMap((s) => s.modules);
+ const withIcon = (l: SidebarLink) => ({ ...l, iconName: SIDEBAR_ICONS[l.name] ?? l.iconName });
+ const sections = [
+ ...SIDEBAR_SECTIONS.map(({ label, modules }) => ({
+ label,
+ links: modules.flatMap((m) => links.filter((l) => l.name === m)).map(withIcon),
+ })),
+ { label: undefined, links: links.filter((l) => !known.includes(l.name)).map(withIcon) },
+ ];
+ return sections.filter((s) => s.links.length > 0);
+}
const byId = (nodes: AdminModule[] | undefined) => [...(nodes ?? [])].sort((a, b) => (a.id ?? 0) - (b.id ?? 0));
diff --git a/solvway-admin-portal/app/lib/i18n/defaultMessages.ts b/solvway-admin-portal/app/lib/i18n/defaultMessages.ts
index 52611f4..6b7ba86 100644
--- a/solvway-admin-portal/app/lib/i18n/defaultMessages.ts
+++ b/solvway-admin-portal/app/lib/i18n/defaultMessages.ts
@@ -86,7 +86,10 @@ export const DEFAULT_MESSAGES: Record = {
HeaderSwitchToDark: "Switch to dark theme",
LocaleSwitcherChange: "Change language",
SidebarMainNav: "Main",
- SidebarAdministration: "Administration",
+ SidebarSectionEvents: "Events",
+ SidebarSectionLeads: "Leads",
+ SidebarSectionAccess: "Access",
+ SidebarSectionSystem: "System",
UiBreadcrumb: "breadcrumb",
UiMore: "More",
UiColumns: "Columns",