Add a menu to the titlebar that admins curate (#65) #71

Merged
miko merged 1 commit from feature/65-menu into development 2026-11-04 11:40:47 +01:00
Owner

Closes #65

Admins curate a flat menu in the titlebar under Menu in the admin menu (/admin/menu): links to categories, guides, pages or external http(s) URLs, added, edited, sorted and removed in one form.

  • Without a label, an item shows its target's current title; URL items need a label.
  • Each visitor sees only the items whose targets they may open (effective category visibility, canViewGuide, page visibility and status); URLs always show and open in a new tab.
  • Deleting a category or page removes its items (cascade); a deleted guide's item is marked "Ziel gelöscht" in the form and hidden until the guide is restored.
  • From md up the menu sits beside the logo and wraps; below md a hamburger left of the logo folds it out (closes on Escape, outside click, page change).
  • The active entry is in the accent colour: a category in its whole subtree (guides included, via the guide pages), a guide on its reading and edit pages, a page on its own address.

Agreed deviation on the titlebar layout: pure CSS floats instead of a flex row. The logo and menu are capped by a fixed 23.5rem reservation for the account, so the account always stays in the first row. A short menu that leaves the search less than 16rem sends it to its own full-width row. A menu wrapping over several rows leaves the search in the free space below the account instead.

New table MenuItem (migration 20261104120000_add_menu_item).

Tests: unit tests for validation, visibility and active entry (30 new); e2e/menu.spec.ts (7 tests). Full unit and e2e suites pass.

🤖 Generated with Claude Code

Closes #65 Admins curate a flat menu in the titlebar under **Menu** in the admin menu (`/admin/menu`): links to categories, guides, pages or external http(s) URLs, added, edited, sorted and removed in one form. - Without a label, an item shows its target's current title; URL items need a label. - Each visitor sees only the items whose targets they may open (effective category visibility, `canViewGuide`, page visibility and status); URLs always show and open in a new tab. - Deleting a category or page removes its items (cascade); a deleted guide's item is marked "Ziel gelöscht" in the form and hidden until the guide is restored. - From md up the menu sits beside the logo and wraps; below md a hamburger left of the logo folds it out (closes on Escape, outside click, page change). - The active entry is in the accent colour: a category in its whole subtree (guides included, via the guide pages), a guide on its reading and edit pages, a page on its own address. **Agreed deviation on the titlebar layout:** pure CSS floats instead of a flex row. The logo and menu are capped by a fixed 23.5rem reservation for the account, so the account always stays in the first row. A short menu that leaves the search less than 16rem sends it to its own full-width row. A menu wrapping over several rows leaves the search in the free space below the account instead. New table `MenuItem` (migration `20261104120000_add_menu_item`). Tests: unit tests for validation, visibility and active entry (30 new); `e2e/menu.spec.ts` (7 tests). Full unit and e2e suites pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Admins link categories, guides, pages or external http(s) URLs under
/admin/menu, reached through the admin menu, and sort, edit and remove
the items in one form. An item without a label shows its target's
current title; each visitor sees only the items whose targets they may
open. Deleting a category or page removes its items; a deleted guide's
item is marked in the form and hidden until the guide is restored.

From md up the menu stands beside the logo and wraps when long; the
titlebar now floats instead of centring the search, which drops out of
the first row when the menu leaves it less than 16rem. Below md a
hamburger left of the logo folds the menu out. The entry for where the
visitor is shows in the accent colour: a category in its whole subtree,
guides included, which the guide pages publish to the menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit d60f2b7f7b into development 2026-11-04 11:40:47 +01:00
Sign in to join this conversation.
No reviewers
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!71
No description provided.