Search & discovery
Menu Builder
Generated from docs/plan/core/menu-builder/PLAN.md in the AstroBaaS repository. Nothing described below is implemented — it is the written plan for it.
Menu Builder is a core feature that lets merchants organize navigation menus via drag-and-drop UI. It enables merchants to build multi-level navigation hierarchies without coding.
The problem
Merchants can’t organize navigation without code; they hire developers to move a menu item.
What it does
- Create and manage multiple named menus with drag-and-drop item ordering
- Support menu item types: category, product, page, custom link with nested levels (unlimited depth)
- Bulk rename menu items and configure item properties (label, URL, icon, target)
- Admin tree view editor with drag-and-drop and publish/unpublish toggle
- Link validation: warn if menu item points to deleted category/product/page
- Keyboard shortcuts: move items up/down without drag
What it deliberately does NOT do
Each boundary carries its reason. A boundary without a reason gets crossed by the next person who reads this.
- Does NOT support image in menu items (reason: complexity, UI bloat)
- Does NOT auto-generate menus from categories (reason: manual organization intentional)
- Does NOT support conditional menu display (reason: separate feature)
- Does NOT provide CSS classes for styling (reason: frontend theme responsibility)
Data model
New table: menus (id, name, slug, published, created_at). New table: menu_items (id, menu_id, parent_id, item_type, label, url, icon, order, published, target, created_at).
API
- POST /api/menus {name}
- GET /api/menus/:id/items
- POST /api/menus/:id/items {parent_id, item_type, target_id, label, order}
- PATCH /api/menus/:id/items/:item_id {label, order, published}
- POST /api/menus/:id/items/:item_id/move {parent_id, order}
- DELETE /api/menus/:id/items/:item_id
Every route added here must also appear in src/pages/openapi.json.ts — a test
fails the build if it does not.
Admin
Menus list with item count, last modified; menu editor with tree view and drag-and-drop; add item form; item properties panel; link validation flag for broken links; preview panel; keyboard nav support.
The seam — why this is core
Core owns: menu storage, UI editor, API, validation, preview rendering.
Core owns the interface + honest drag-and-drop builder; menu management is infrastructure, not a support commitment or credential.
Dependencies
- Assumes category, product, and page APIs exist
- Assumes render engine can iterate over menu_items tree
Acceptance checks
Each of these must be able to fail. Before claiming this is done, break the code deliberately and watch each one go red.
- Menu item can have up to 10 nested levels
- Drag-and-drop reorders without page reload
- Custom link accepts any URL including external
- Broken link warning if target_id deleted
- Menu preview renders correct URL for each type
- Unpublished menu items not rendered in preview or frontend
- Bulk rename updates label for multiple items in one request
- Keyboard nav: arrow up/down moves item, enter opens edit
- All storage drivers support nested structures equally
- Menu can have 1000+ items without UI becoming unusable
Risks
Broken links: if category deleted, menu item URL wrong. Deep nesting: 20 nested levels causes slow rendering. Schema migration adding menus and menu_items tables. Performance: 1000+ items in editor may be sluggish.
Commercial context
| Suggested price | free (core) |
| Rival anchor | Shopify: Navigation (included); Magento: included |
The anchor is what the nearest equivalent charges on Shopify or Magento today. It is context for a pricing decision, not the decision.
Generated from the commerce plan. See docs/COMMERCE-PLAN.md for the full
catalogue and ../../AI-GUIDE.md for how to work on this repository.