Files
q-blog/docs/RELEASE_NOTES_multiblog.md
greenflame089 0b100af686 Release v0.2.2
2025-08-22 07:28:42 -04:00

35 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Q-Blog — Multi-Blog Feature Notes (Patch)
Date: 2025-08-21
This patch implements ADR-0005 (Allow Multiple Blogs per Name) using the Plan A approach described in docs/features.
Highlights
- Added new route `/:user/blogs` listing all blogs for a Name.
- Added smart redirect for `/:user`:
- 1 blog → `/:user/:blog` (history replace)
- 0 or >1 → `/:user/blogs`
- Converted header action from a single “My Blog” link to a “My Blogs” dropdown with per-blog entries and a “Create new blog” action. For 0 blogs, the header shows a primary “Create Blog” button.
- Kept all existing blog-scoped routes intact.
Code Map
- `src/utils/blogs.ts`: list + fetch blog details helpers.
- `src/pages/UserBlogs/UserBlogs.tsx`: new list page with owner CTAs.
- `src/pages/UserBlogs/NameRootRedirect.tsx`: redirect component for `/:user`.
- `src/App.tsx`: routes added for `/:user/blogs` and `/:user`.
- `src/wrappers/GlobalWrapper.tsx`: fetches current user blogs; wires Navbar selection to set active `currentBlog` and navigate.
- `src/components/layout/Navbar/Navbar.tsx`: “My Blogs” dropdown, accessible popover menu; primary Create button when 0 blogs.
Tests
- `tests/routes/NameRootRedirect.test.tsx`: redirects for single vs multiple blogs.
- `tests/pages/UserBlogs.test.tsx`: renders list.
- `tests/components/Navbar.multiblog.test.tsx`: Create vs My Blogs visibility.
Notes
- Redirect target within Q-Blog is `/:user/:blog` (this apps profile/posts page), not `…/posts`.
- No data migrations; all changes are UI/routing.