Files
co-lite/openspec/changes/group-sidebar-categories/design.md
T

1.8 KiB

Context

See docs/superpowers/specs/2026-12-01-sidebar-categories-design.md. Task 1.2 of refine-visitor-pages-and-shell introduced ADMIN_MODULES and a two-way split in SidebarNav, with a visible label naming each list (aria-labelledby, plus aria-label in the rail).

Goals / Non-Goals

Goals: fixed categories and order, a distinct icon for every item, and a trimmed icon map.

Non-Goals: server menu changes, collapsible groups, renames.

Decisions

  • The category map replaces ADMIN_MODULES. SIDEBAR_SECTIONS in aclSidebar.ts is an ordered list of { label?: string; modules: string[] }, with Dashboard as the first entry without a label. A helper groupSidebar(links) returns the sections in map order, each with its links in map order. Links not in the map go into a trailing section without a label. Empty sections are dropped. SidebarNav renders each section with the existing divider, label and list pattern; the first section has no divider.
  • Icon override in the portal. SIDEBAR_ICONS: Record<string, string> (module name to lucide name), holding BO_LOGIN_SECURITY: "LockKeyhole", is applied in groupSidebar over the server's iconName. No SQL change.
  • Icon map trim. Keep only the icon names Co-Lite seeds (local/seed/03-colite.sql and the archived change SQL), Store (Companies, added by useAclSidebar), LockKeyhole, and the fallback. Check icon-map tests before removing anything; an existing test asserting a babyboo icon is a conflict to report.
  • Labels are new keys in defaultMessages.ts (SidebarSectionEvents, SidebarSectionLeads, SidebarSectionAccess, SidebarSectionSystem). SidebarAdministration is removed.

Risks / Trade-offs

  • A new server module shows in the trailing section until it is added to the map. That is visible and harmless. Keep the ponytail: note.