Categories: tree, pages and admin management #6

Closed
opened 2026-11-01 16:19:32 +01:00 by miko · 1 comment
Owner

Part of #1

Blocked by: #4

What

Hierarchical category tree of arbitrary depth (glossary: Category, Child Order).

Acceptance criteria

  • Prisma model Category (parentId?, title, slug unique among siblings, description as Editor.js JSON?, image?, visibility, childOrder, position, timestamps)
  • Category pages at /c/<slug-path> listing subcategories and guides; root listing on /
  • Admins can create, rename, move and delete categories; delete only when empty
  • Slug generated from title, editable
  • Child order per category: alphabetical (default) or manual; admins can reorder in manual mode; new entries go last
  • Top level follows the top-level child order setting (if #5 is not done yet, default alphabetical)

Vocabulary: GLOSSARY.md. Decisions: docs/adr/.

Part of #1 Blocked by: #4 ## What Hierarchical category tree of arbitrary depth (glossary: Category, Child Order). ## Acceptance criteria - [ ] Prisma model `Category` (parentId?, title, slug unique among siblings, description as Editor.js JSON?, image?, visibility, childOrder, position, timestamps) - [ ] Category pages at `/c/<slug-path>` listing subcategories and guides; root listing on `/` - [ ] Admins can create, rename, move and delete categories; delete only when empty - [ ] Slug generated from title, editable - [ ] Child order per category: alphabetical (default) or manual; admins can reorder in manual mode; new entries go last - [ ] Top level follows the top-level child order setting (if #5 is not done yet, default alphabetical) Vocabulary: `GLOSSARY.md`. Decisions: `docs/adr/`.
Author
Owner

Implemented in 1b2eedc on development.

Notes for follow-up tickets:

  • #7: src/categories/categoryTree.ts already has effectiveVisibility and visibleTo (guests only see effective-public categories, per ADR-0002). #7 should take this over rather than build a second copy.
  • #8: Category.position and the manual child order only cover subcategories. Guides have to share one position space with them, and "delete only when empty" (deleteCategory) must also count guides. Description (Editor.js JSON) is stored but cannot be edited yet.
  • #5: the top-level child order is the constant TOP_LEVEL_CHILD_ORDER (alphabetical) in src/categories/loadCategoryTree.ts; switch it to the setting.
  • #11: Category.image exists, but nothing sets it yet.
  • MariaDB does not enforce unique slugs between top-level categories (NULL parent); the app checks before writing, so two creates at the same moment could still collide.
Implemented in 1b2eedc on `development`. Notes for follow-up tickets: - **#7**: `src/categories/categoryTree.ts` already has `effectiveVisibility` and `visibleTo` (guests only see effective-public categories, per ADR-0002). #7 should take this over rather than build a second copy. - **#8**: `Category.position` and the manual child order only cover subcategories. Guides have to share one position space with them, and "delete only when empty" (`deleteCategory`) must also count guides. Description (Editor.js JSON) is stored but cannot be edited yet. - **#5**: the top-level child order is the constant `TOP_LEVEL_CHILD_ORDER` (alphabetical) in `src/categories/loadCategoryTree.ts`; switch it to the setting. - **#11**: `Category.image` exists, but nothing sets it yet. - MariaDB does not enforce unique slugs between top-level categories (NULL parent); the app checks before writing, so two creates at the same moment could still collide.
miko closed this issue 2026-11-01 18:01:07 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MassiveDynamic/kataba#6
No description provided.