Manual child order for guides #37

Closed
opened 2026-11-02 14:12:38 +01:00 by miko · 1 comment
Owner

Part of #1

Problem

docs/project-description.md says categories and guides are sorted alphabetically or — switchable per category — manually (GLOSSARY: Child Order). Today only subcategories follow a category's child order: Guide has no position, and loadCategoryGuides (src/guides/loadGuide.ts) always orders by title. #6 handed this to #8, but it was not picked up.

Decisions (grilling session)

  • Category pages keep two sections: subcategories, then guides. Each list has its own manual order; guides do not share a position space with subcategories.
  • One child-order switch per category governs both lists.
  • Admins only arrange guides, on /admin/categories/[id], with the same up/down buttons as subcategories.

Acceptance criteria

  • Guide.position, counting among the guides of its category; the migration numbers existing guides per category alphabetically by title
  • Category pages list guides by title in alphabetical order, by position (title as tie-breaker) in manual order
  • Switching a category to manual numbers its guides in their current alphabetical order
  • The admin category page always lists all non-deleted guides (drafts included and marked); up/down buttons only in manual order
  • A new guide, a guide whose category changes, and a restored guide go last; saving properties without a category change keeps the position; deleted guides keep their position
  • Unit tests for the ordering and "goes last" rules (reusing src/categories/childOrder.ts)
  • Playwright: an admin switches a category to manual, moves a guide up, and the category page shows the new order
Part of #1 ## Problem `docs/project-description.md` says categories *and* guides are sorted alphabetically or — switchable per category — manually (GLOSSARY: Child Order). Today only subcategories follow a category's child order: `Guide` has no `position`, and `loadCategoryGuides` (`src/guides/loadGuide.ts`) always orders by title. #6 handed this to #8, but it was not picked up. ## Decisions (grilling session) - Category pages keep two sections: subcategories, then guides. Each list has its own manual order; guides do **not** share a position space with subcategories. - One child-order switch per category governs both lists. - Admins only arrange guides, on `/admin/categories/[id]`, with the same up/down buttons as subcategories. ## Acceptance criteria - [ ] `Guide.position`, counting among the guides of its category; the migration numbers existing guides per category alphabetically by title - [ ] Category pages list guides by title in alphabetical order, by `position` (title as tie-breaker) in manual order - [ ] Switching a category to manual numbers its guides in their current alphabetical order - [ ] The admin category page always lists all non-deleted guides (drafts included and marked); up/down buttons only in manual order - [ ] A new guide, a guide whose category changes, and a restored guide go last; saving properties without a category change keeps the position; deleted guides keep their position - [ ] Unit tests for the ordering and "goes last" rules (reusing `src/categories/childOrder.ts`) - [ ] Playwright: an admin switches a category to manual, moves a guide up, and the category page shows the new order
Author
Owner

Implemented in #40 (feature/37-manual-guide-order). Guides get a position within their category, the admin category page arranges them in manual order, and new, recategorised and restored guides go last. Covered by unit tests and a Playwright test.

Implemented in #40 (feature/37-manual-guide-order). Guides get a position within their category, the admin category page arranges them in manual order, and new, recategorised and restored guides go last. Covered by unit tests and a Playwright test.
miko closed this issue 2026-11-02 15:37:24 +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#37
No description provided.