Home page above the categories (#83) #85

Merged
miko merged 1 commit from feature/83-home-page into development 2026-11-04 19:57:08 +01:00
Owner

Closes #83

Summary

The home page is a page with an empty slug (ADR-0018). It always exists, has no title or slug of its own, and its content shows above the categories at /.

 <Home> (src/app/page.tsx)
+  <HomePageContent>          # loadHomePage(): content if canViewPage, else nothing
+    "Edit home page" (admins) → /admin/pages/home
+    <RichText>
   <TopLevel>
     "Categories" + <CategoryListing>
 src/
 ├── app/admin/pages/
+│   ├── home/page.tsx       # ensureHomePage(), then the page form without title/slug/delete
 │   ├── [id]/page.tsx       # redirects the home page to /admin/pages/home
 │   └── page.tsx            # home page listed first, with status · visibility
 └── contentPages/
+    ├── homePage.ts         # ensureHomePage (created published + empty), loadHomePage
     ├── slug.ts             # + HOME_PAGE_SLUG = "", isHomePage, NOT_HOME_PAGE
     └── actions.ts          # save: no title/slug/search text for it; delete refuses it

The home page stays out of search (empty search text) and can't be a menu item (filtered in the menu form and its action).

Evidence

  • Before: e2e/pages.spec.ts › the home page always exists, and its content shows above the categories… failed: no "Home page" link in Admin → Pages.
    After: it passes. It checks that an admin edits the home page, that a guest sees the content above "Categories", that it is internal → hidden from guests but shown to viewers, and that a draft is shown to admins only.
  • Typecheck, lint, 374 unit tests, and all 52 e2e tests pass.

Merge Danger

Door: two-way

No schema migration. The home page is an ordinary Page row, created on first use. Rolling back leaves one Page with slug "", unreachable and harmless.

Blast Radius: pages

It touches page saving and deleting, the admin page list, the menu's page options, and the start page layout. Other pages behave as before.

🤖 Generated with Claude Code

Closes #83 ## Summary The **home page** is a page with an empty slug (ADR-0018). It always exists, has no title or slug of its own, and its content shows above the categories at `/`. ```diff <Home> (src/app/page.tsx) + <HomePageContent> # loadHomePage(): content if canViewPage, else nothing + "Edit home page" (admins) → /admin/pages/home + <RichText> <TopLevel> "Categories" + <CategoryListing> ``` ```diff src/ ├── app/admin/pages/ +│ ├── home/page.tsx # ensureHomePage(), then the page form without title/slug/delete │ ├── [id]/page.tsx # redirects the home page to /admin/pages/home │ └── page.tsx # home page listed first, with status · visibility └── contentPages/ + ├── homePage.ts # ensureHomePage (created published + empty), loadHomePage ├── slug.ts # + HOME_PAGE_SLUG = "", isHomePage, NOT_HOME_PAGE └── actions.ts # save: no title/slug/search text for it; delete refuses it ``` The home page stays out of search (empty search text) and can't be a menu item (filtered in the menu form and its action). ## Evidence - **Before:** `e2e/pages.spec.ts › the home page always exists, and its content shows above the categories…` failed: no "Home page" link in Admin → Pages. **After:** it passes. It checks that an admin edits the home page, that a guest sees the content above "Categories", that it is internal → hidden from guests but shown to viewers, and that a draft is shown to admins only. - Typecheck, lint, 374 unit tests, and all 52 e2e tests pass. ## Merge Danger **Door:** two-way No schema migration. The home page is an ordinary `Page` row, created on first use. Rolling back leaves one `Page` with slug `""`, unreachable and harmless. **Blast Radius:** pages It touches page saving and deleting, the admin page list, the menu's page options, and the start page layout. Other pages behave as before. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The home page is the page with the empty slug (ADR-0018): it has no
title or slug of its own, cannot be deleted, stays out of search and the
menu, and is created published and empty when an admin opens it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit b7ea6ec587 into development 2026-11-04 19:57:08 +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!85
No description provided.