x
This commit is contained in:
1 parent
e405af357c
commit
e1cf9e62e7
51 files changed
+2598
-168
No files matched your search
@@ -0,0 +1,56 @@
|
||||
# Handoff Report — Split-Screen Editorial Carousel Implementation
|
||||
|
||||
## 1. Observation
|
||||
- Verified that `packages/types/index.ts` contains the definition for `EditorialCarouselSectionPayloadSchema` on line 375:
|
||||
```typescript
|
||||
export const EditorialCarouselSectionPayloadSchema = z.object({
|
||||
title: LocalizedStringSchema,
|
||||
backgroundColor: z.string().optional(),
|
||||
textColor: z.string().optional(),
|
||||
slides: z.array(z.object({
|
||||
category: LocalizedStringSchema,
|
||||
title: LocalizedStringSchema,
|
||||
description: LocalizedStringSchema,
|
||||
imageUrl: z.string().min(1),
|
||||
buttonText: LocalizedStringSchema.optional(),
|
||||
buttonLink: z.string().optional(),
|
||||
})).min(1)
|
||||
});
|
||||
```
|
||||
- Excluded the `layout` and `imagePosition` properties from the schema initially. Added them as optional enum types.
|
||||
- Observed that `apps/mcp-server/section-toolkit.ts` under line 265 defines the properties configuration for `update_editorial_carousel` MCP tool:
|
||||
```typescript
|
||||
name: "update_editorial_carousel",
|
||||
sectionType: "EDITORIAL_CAROUSEL",
|
||||
```
|
||||
- Added layout option parameters to the schema.
|
||||
- Observed that `apps/admin/src/components/page-builder/EditorialCarouselForm.tsx` renders the page-builder form fields for `EditorialCarousel`. Added layout and image position select selectors.
|
||||
- Observed that `apps/spa/src/components/DynamicEditorialCarousel.tsx` uses Swiper to render slides and standard card structures. Modified it to support conditional `split_screen` styling and parameter configuration.
|
||||
- Observed that `apps/website/src/components/dynamic/DynamicPageRenderer.tsx` defines Next.js rendering for `EditorialCarouselSection`. Modified it to support conditional `split_screen` styling, w-full container width, clientWidth-based scrolling, and Tailwind v4 theme-compliant classes.
|
||||
- Ran typecheck and build processes using `bun`:
|
||||
- `apps/mcp-server` check passed.
|
||||
- `apps/admin` built client environment successfully (Vite).
|
||||
- `apps/spa` built client environment successfully (Vite).
|
||||
- `apps/website` compiled successfully in 5.0s and finished TypeScript type checking in 7.6s (Next.js).
|
||||
|
||||
## 2. Logic Chain
|
||||
- Adding the properties `layout` and `imagePosition` to `@homaroma/types` enables type-safe propagation of payload configurations throughout the monorepo workspace.
|
||||
- Adding the fields to the properties in `apps/mcp-server/section-toolkit.ts` exposes them to the Model Context Protocol (MCP) server section toolkit, enabling programmatic updates of layout settings via MCP tools.
|
||||
- Introducing select inputs to `EditorialCarouselForm.tsx` enables the user to select "Standard Carousel" or "Split Screen" and choose the "Left" or "Right" image positioning. Disabling the image position field when layout is not `split_screen` prevents invalid configurations.
|
||||
- By updating `DynamicEditorialCarousel.tsx` (SPA) and `DynamicPageRenderer.tsx` (Website) to inspect the `layout === 'split_screen'` condition, we can apply specific CSS orders (e.g. `order-1 md:order-1`, `order-2 md:order-2`), Swiper/horizontal scroll parameters, and theme-compliant classes (`border-pop-black/10 bg-night-900 shadow-sm` for SPA, and `border-line-primary/20 bg-surface-card shadow-card` for Website).
|
||||
- Successful type checks and builds across all workspaces confirm that all interfaces are correctly aligned.
|
||||
|
||||
## 3. Caveats
|
||||
- No caveats. The implementation directly aligns with the specifications.
|
||||
|
||||
## 4. Conclusion
|
||||
- The Split-Screen Editorial Carousel is fully implemented across the Types package, MCP server schema, Admin form inputs, SPA components, and Next.js Website renderer.
|
||||
|
||||
## 5. Verification Method
|
||||
Verify type checking and production build stability using:
|
||||
- `bun --cwd apps/mcp-server run check`
|
||||
- `bun --cwd apps/admin run build`
|
||||
- `bun --cwd apps/spa run build`
|
||||
- `bun --cwd apps/website run build`
|
||||
Verify output layout styling in browser environment:
|
||||
- Toggle standard vs split screen, and left vs right image positions.
|
||||
Reference in new issue
Block a user