This commit is contained in:
Your Name committed 2026-06-28 20:18:07 -04:00
1 parent 6096c727d9
commit 3965f4f4da
38 files changed
+1513 -752

No files matched your search

+19 -23
View File
@@ -1,33 +1,29 @@
# Project: Split-Screen Editorial Carousel
# Project: update_category_image
## Architecture
This project extends the existing `EDITORIAL_CAROUSEL` page section schema and UI components in the HomAroma monorepo.
- **Database/Types Schema**: `packages/types/index.ts` defines the types used across the frontend applications (apps/admin, apps/spa, apps/website) and backend services.
- **Backend Validation**: `apps/backend/src/routes/pages.ts` validates incoming payloads using schemas imported from `@homaroma/types`.
- **CMS/MCP Server**: `apps/mcp-server/section-toolkit.ts` exposes MCP tools for managing/updating content, using schemas aligned with `@homaroma/types`.
- **Admin UI**: `apps/admin/src/components/page-builder/EditorialCarouselForm.tsx` renders a form for content managers to configure the carousel layout and content.
- **SPA Frontend**: `apps/spa/src/components/DynamicEditorialCarousel.tsx` renders the carousel on the SPA client.
- **Website Frontend**: `apps/website/src/components/dynamic/DynamicPageRenderer.tsx` contains the website's `EditorialCarouselSection` renderer.
- Database Schema: `Category` model in Prisma has an `imageUrl` field.
- Backend API: `apps/backend/src/routes/categories.ts` handles category operations.
- MCP Server: `apps/mcp-server/index.ts` exposes MCP tools to agents.
## Milestones
| # | Name | Scope | Dependencies | Status |
|---|------|-------|-------------|--------|
| M1 | Schema & Types | Update `EditorialCarouselSectionPayloadSchema` in `packages/types/index.ts` to include layout and imagePosition. Update `apps/mcp-server/section-toolkit.ts` to expose those fields in the `update_editorial_carousel` tool. | None | DONE |
| M2 | Admin CMS UI | Update `EditorialCarouselForm.tsx` to support configuring `layout` and `imagePosition` for the carousel section. | M1 | DONE |
| M3 | Frontend UI | Update the carousel components in `apps/spa` and `apps/website` to support `split_screen` and `standard` layouts, respecting desktop split proportions and mobile stacked views, using theme tokens. | M1 | DONE |
| M4 | E2E & Type Verification | Run monorepo typechecking, build validation, and test section CRUD operations using MCP tools. | M2, M3 | DONE |
| M1 | Backend Implementation | Expose `PATCH /api/categories/:id/image` in `apps/backend/src/routes/categories.ts` | None | DONE |
| M2 | MCP Tool Implementation | Add `update_category_image` tool schema and handler in `apps/mcp-server/index.ts` | M1 | DONE |
| M3 | Verification & Auditing | Compile the monorepo, test the tool end-to-end, and run Forensic Auditor. | M2 | DONE |
## Interface Contracts
### `packages/types` -> Consumers
- `EditorialCarouselSectionPayloadSchema` includes:
- `layout: z.enum(['standard', 'split_screen']).optional()`
- `imagePosition: z.enum(['left', 'right']).optional()`
- When `layout` is omitted or `'standard'`, components should fall back to existing slide behavior.
- When `layout` is `'split_screen'`, the components render the new split-screen layout.
### Backend API
- `PATCH /api/categories/:id/image`
- Body: `{ imageUrl: string }`
- Response: Updated Category object
### MCP Tool Schema
- Name: `update_category_image`
- Input Schema:
- `id`: number (required)
- `imageUrl`: string (required)
## Code Layout
- Schema: `packages/types/index.ts`
- MCP Server config: `apps/mcp-server/section-toolkit.ts`
- Admin UI builder: `apps/admin/src/components/page-builder/EditorialCarouselForm.tsx`
- SPA component: `apps/spa/src/components/DynamicEditorialCarousel.tsx`
- Website renderer: `apps/website/src/components/dynamic/DynamicPageRenderer.tsx`
- Backend routes: `apps/backend/src/routes/categories.ts`
- MCP server: `apps/mcp-server/index.ts`