Skip to content

feat(admin): sidebar menu tree with collection grouping, plugin subgroups, and public menu sync #1023

@ahliweb

Description

@ahliweb

Is your feature request related to a problem? Please describe.

The admin sidebar currently renders all collections as a flat alphabetical list under a single "Content" group. There is no way to:

  1. Group collections (e.g., "Blog", "Shop", "Team") into separate collapsible sidebar sections
  2. Control collection order — everything is sorted alphabetically by slug with no user-configurable ordering
  3. Organize plugin admin pages — all plugin pages are dumped into a single "Plugins" group with no grouping or custom icons
  4. Create nested submenus — no way to have hierarchical navigation within sidebar groups
  5. Hide unused core features — sites that don't use comments, redirects, widgets, etc. still see them in the sidebar
  6. Sync sidebar structure to public menus — the admin sidebar and public navigation are completely separate systems, requiring duplicate effort to maintain both

Describe the solution you'd like

Data Layer

  • Add sort_order (INTEGER) and group (TEXT) columns to _emdash_collections
  • Extend PluginAdminPage descriptor with group and sortOrder fields
  • Pass icon, group, sortOrder through to the manifest for both collections and plugin pages

Admin Sidebar Rendering

  • Group collections by their group field into separate collapsible sidebar sections
  • Ungrouped collections remain in the default "Content" group
  • Plugin pages grouped by their group field into separate collapsible sections
  • Resolve icon names (25+ Phosphor icons) from collection/plugin config
  • Support one level of nested submenus via NavItem.children
  • sidebar config option with hideCoreFeatures and hideCollections arrays

Menu Sync

  • addToMenu field on collection creation to auto-add to a public menu
  • Auto-cleanup: deleting a collection removes its menu items
  • Full sync engine: GET /_emdash/api/menus/:name/sync-diff to preview, POST /_emdash/api/menus/:name/sync to apply
  • Manual per-collection sync: POST /_emdash/api/schema/collections/:slug/sync-menu

Reordering UI

  • Drag-and-drop collection reordering dialog in Content Types admin page
  • POST /_emdash/api/schema/collections/reorder API endpoint

Describe alternatives you've considered

  • Manual menu configuration (current state) — requires duplicating sidebar structure in the menu editor
  • Custom sidebar overrides — no built-in support, requires template customization

Additional context

This is a comprehensive sidebar redesign that ties together collection organization, plugin admin pages, and public navigation. The implementation includes 28 new tests covering ordering, grouping, menu sync, and export verification.

Related upstream discussions:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions