What does this PR do?
Implements a comprehensive admin sidebar redesign that adds collection grouping, plugin subgroups, nested submenus, icon rendering, sidebar configuration, and bidirectional sync with public menus.
Discussion: #1027
Data Layer
- Migration 039: Adds
sort_order (INTEGER, default 0) and group (TEXT, nullable) columns to _emdash_collections
- Collection types:
sortOrder, group, and icon added to Collection, CreateCollectionInput, UpdateCollectionInput, ManifestCollection
- Plugin types:
group and sortOrder added to PluginAdminPage and ManifestPlugin.adminPages
- Ordering: Collections now ordered by
sort_order ASC, slug ASC instead of just slug ASC
Admin Sidebar Rendering
- Collection grouping: Collections with a
group field render in separate collapsible sidebar groups; ungrouped collections remain in the default "Content" group
- Plugin grouping: Plugin pages with a
group field render in separate collapsible sidebar groups; ungrouped pages remain in "Plugins"
- Icon resolution:
resolveIcon() helper maps 30+ icon names to Phosphor components with fallback to defaults
- Nested submenus:
NavItem.children support with NavSubMenu expandable component (max 1 level of nesting)
- Sidebar config:
hideCoreFeatures and hideCollections options in EmDashConfig.sidebar to hide items from the nav
- RTL-safe: All layout uses logical Tailwind classes (
ms-*, ps-*, start-*); chevrons flip in RTL
Menu Sync
addToMenu: New field on CreateCollectionInput — auto-adds a type: "collection" menu item to the specified public menu on collection creation
- Auto-cleanup: Deleting a collection automatically removes its menu items
- Manual sync endpoint:
POST /_emdash/api/schema/collections/:slug/sync-menu to add a collection to a menu after creation
- Full sync engine:
GET /_emdash/api/menus/:name/sync-diff — preview changes (toAdd, toRemove, toReorder)
POST /_emdash/api/menus/:name/sync — apply changes to align menu with sidebar structure
Reordering UI
CollectionReorderDialog: Drag-and-drop dialog using @dnd-kit/core + @dnd-kit/sortable for reordering collections
- API endpoint:
POST /_emdash/api/schema/collections/reorder — batch updates sort_order for multiple collections
- Integration: "Reorder" button added to Content Types admin page
Related PR
Type of change
What does this PR do?
Implements a comprehensive admin sidebar redesign that adds collection grouping, plugin subgroups, nested submenus, icon rendering, sidebar configuration, and bidirectional sync with public menus.
Discussion: #1027
Data Layer
sort_order(INTEGER, default 0) andgroup(TEXT, nullable) columns to_emdash_collectionssortOrder,group, andiconadded toCollection,CreateCollectionInput,UpdateCollectionInput,ManifestCollectiongroupandsortOrderadded toPluginAdminPageandManifestPlugin.adminPagessort_order ASC, slug ASCinstead of justslug ASCAdmin Sidebar Rendering
groupfield render in separate collapsible sidebar groups; ungrouped collections remain in the default "Content" groupgroupfield render in separate collapsible sidebar groups; ungrouped pages remain in "Plugins"resolveIcon()helper maps 30+ icon names to Phosphor components with fallback to defaultsNavItem.childrensupport withNavSubMenuexpandable component (max 1 level of nesting)hideCoreFeaturesandhideCollectionsoptions inEmDashConfig.sidebarto hide items from the navms-*,ps-*,start-*); chevrons flip in RTLMenu Sync
addToMenu: New field onCreateCollectionInput— auto-adds atype: "collection"menu item to the specified public menu on collection creationPOST /_emdash/api/schema/collections/:slug/sync-menuto add a collection to a menu after creationGET /_emdash/api/menus/:name/sync-diff— preview changes (toAdd, toRemove, toReorder)POST /_emdash/api/menus/:name/sync— apply changes to align menu with sidebar structureReordering UI
CollectionReorderDialog: Drag-and-drop dialog using@dnd-kit/core+@dnd-kit/sortablefor reordering collectionsPOST /_emdash/api/schema/collections/reorder— batch updatessort_orderfor multiple collectionsRelated PR
Type of change