Category Master — Three-Level Tree View & Inspector Panel

By Engineering Team•October 9, 2026•3 min read

Category Master tree view, showing the three stacked level panels and the Template Config Inspector panel

What the admin sees

The entry point for the whole feature (CategoryPage.tsx). A breadcrumb reads “Catalog / Categories Structures”, followed by one Paper holding three stacked level panels:

  • Level 0 (Roots) — always visible, with a ”+ Add” link in its header.
  • Level 1 (Sub-Cats) — its ”+ Add” link only appears once a root is selected; otherwise the panel header shows no add action.
  • Level 2 (Leaf Nodes) — its title renders in bold (boldTitle), and its ”+ Add” link only appears once a sub-category is selected.

Each row (CategoryItem) shows a tree icon, the category name, a star icon if the category is featured, and a chevron. A panel with no entries shows “No entries yet” instead of an empty list. Clicking a row selects it (highlighted with a left accent border and a tinted background) and narrows the next panel down to that node’s children — selecting a root filters the Sub-Cats panel to its children; selecting a sub-category filters the Leaf Nodes panel the same way.

Once any node is selected, a Template Config Inspector panel appears below the tree, showing:

  • An Edit button (pencil icon) and a Delete button (trash icon, red).
  • “Category Reference Name” — the selected node’s name in large bold text, plus its raw ID in a monospace caption below it.
  • “Hierarchy Breadcrumb Trail” — a chip-like strip starting with a location pin icon, then each ancestor’s name down to the selected node, separated by chevrons, with the current node’s name highlighted in the primary color.

What the admin does here

  • Clicking a panel’s ”+ Add” link opens the right-anchored drawer in add mode for that level (see the three per-level form docs below).
  • Clicking the Inspector Panel’s Edit button calls openEditDrawer, which fetches the full record via GET /product/admin/api/v1/category/:id before opening the drawer in edit mode, pre-filling every field — including the write-only specTemplate/variantAttributes/displayOrder fields (see Technical Debt — TD-00018, TD-08 for why this contradicts the feature’s own CLAUDE.md). A spinner replaces the Edit icon while this fetch is in flight.
  • Clicking Delete opens a confirmation dialog: “This will permanently remove the category. Child categories that reference it may become orphaned. This action cannot be undone.” Confirming calls DELETE /product/admin/api/v1/category/:id and reloads the tree.