forked from Qortal/q-blog
34 lines
1.5 KiB
Markdown
34 lines
1.5 KiB
Markdown
# Developer Guide — Multiple Blogs per Name (Plan A)
|
||
|
||
_Generated 2025-08-21_
|
||
|
||
**Start here** to implement the multi-blog feature. This guide links to the overview, technical plan, and ADR; then gives a fast manual test checklist.
|
||
|
||
## Read these first
|
||
|
||
- `docs/features/FEATURE_MULTIBLOG_OVERVIEW.md`
|
||
- `docs/features/TECH_IMPL_MULTIBLOG.md`
|
||
- `docs/DECISIONS/ADR-0005-multiple-blogs-per-name.md`
|
||
|
||
## Quick path (tasks)
|
||
|
||
1. Add `/{name}/blogs` route and component (`UserBlogs.tsx`).
|
||
2. Add smart redirect for `/{name}` → single blog → `/{name}/{blog}/posts`, else `/{name}/blogs`.
|
||
3. Convert Header “My Blog” to **“My Blogs” dropdown** (0 blogs → “Create Blog” button).
|
||
4. Wire `listBlogsByName(nameId)` query if missing; use it in Header + UserBlogs.
|
||
5. Tests: header menu behavior, redirect, UserBlogs rendering + empty states, basic a11y smoke.
|
||
|
||
## Manual test checklist (click-through)
|
||
|
||
- As a new user (0 blogs):
|
||
- Header shows **Create Blog**; clicking creates first blog.
|
||
- Visiting `/{name}` navigates to `/{name}/blogs` with empty state + CTA.
|
||
- As a user with 1 blog:
|
||
- Visiting `/{name}` lands on that blog’s posts (history replaced).
|
||
- Header shows **My Blogs**; menu lists 1 blog + “Create new blog”.
|
||
- As a user with 2+ blogs:
|
||
- Header menu lists all blogs; selecting one routes to `/{name}/{blog}/posts` and marks it active.
|
||
- `/{name}/blogs` lists all blogs; shows Edit/Create when viewing own name.
|
||
- Keyboard:
|
||
- Menu opens with Enter/Space; items navigable with arrows; ESC closes and returns focus to trigger.
|