Skip to content

better workflow cart#151

Merged
henri318 merged 4 commits into
mainfrom
feat/better_workflow_cart
Jul 14, 2026
Merged

better workflow cart#151
henri318 merged 4 commits into
mainfrom
feat/better_workflow_cart

Conversation

@henri318

@henri318 henri318 commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Mejoras
    • La personalización con foto ahora se gestiona según el modo de configuración (incluye compatibilidad con datos antiguos).
    • Los productos con imágenes “personalizables” se configuran automáticamente como texto y foto, con soporte de plantilla de vista previa y offsets opcionales.
    • Al añadir una segunda personalización para un producto ya existente en el carrito autenticado, se muestra “Añadir otra personalización” sin controles de cantidad.
  • Correcciones
    • Mejoras en la migración del carrito de invitado: se habilitan reintentos si falla y se evita que errores detengan el proceso.
    • Se ajusta la detección de ítems del carrito considerando la posición de diseño aunque falte la imagen.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@henri318, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e8de2f84-ca4d-48ad-8fd7-66ce8da9d124

📥 Commits

Reviewing files that changed from the base of the PR and between c10f8c5 and 9ce41af.

📒 Files selected for processing (1)
  • modules/cart/presentation/components/add-to-cart-button.tsx
📝 Walkthrough

Walkthrough

La configuración elimina allowPhotoDesign y deriva text_photo desde las imágenes y configuraciones existentes. La experiencia usa allowsPhoto(). El carrito distingue variantes personalizadas, permite añadir otra personalización y reintenta migraciones guest fallidas.

Changes

Personalización y carrito

Layer / File(s) Summary
Derivación del modo de personalización
modules/products/domain/value-objects/product-customization-config.ts, modules/products/presentation/schemas/product-form-schema.ts, app/[locale]/seller/products/product-form.tsx, app/[locale]/products/[id]/customization-experience.tsx, prisma/*, tests/unit/...
allowPhotoDesign se elimina del contrato y la serialización; las configuraciones antiguas pueden convertirse a text_photo, que también se deriva en el payload, los seeds y la experiencia de personalización.
Detección de productos personalizados en carrito
modules/cart/presentation/components/add-to-cart-button.tsx, tests/e2e/personalization-flow.spec.ts
Las personalizaciones vacías se buscan por productId; cuando existe otra variante personalizada, se muestra la acción para añadir otra personalización y se actualiza el flujo e2e correspondiente.
Migración tolerante de personalizaciones guest
modules/cart/application/migrate-guest-cart.ts, modules/cart/presentation/components/cart-merge-detector.tsx
Los errores al crear personalizaciones devuelven null, designPosition cuenta como foto y los fallos de migración restablecen el estado para permitir reintentos.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SellerForm
  participant ProductCustomizationConfig
  participant CustomizationExperience
  SellerForm->>ProductCustomizationConfig: Deriva effectiveMode
  ProductCustomizationConfig->>ProductCustomizationConfig: Normaliza mode y compatibilidad legacy
  ProductCustomizationConfig->>CustomizationExperience: Entrega configuración
  CustomizationExperience->>CustomizationExperience: Evalúa allowsPhoto()
  CustomizationExperience->>CustomizationExperience: Renderiza MockupCanvasControl
Loading

Possibly related PRs

  • henri318/728-store#105: Introduce el flujo de productos personalizables basado en allowPhotoDesign.
  • henri318/728-store#122: Modifica la lógica de CustomizationExperience relacionada con la habilitación del canvas fotográfico.
  • henri318/728-store#129: Reestructura form.images, incluyendo customizableBase, usado ahora para derivar el modo.

Suggested labels: type:feature

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive El título es genérico y no describe claramente el cambio principal del pull request. Usa un título más específico, por ejemplo: "Unify cart and product customization workflow" o similar, indicando el cambio principal.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/better_workflow_cart

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@modules/cart/presentation/components/add-to-cart-button.tsx`:
- Around line 116-131: Update the item-matching predicate around hasDraftContent
and isAuthCustomizationMatching so every same-product item is validated through
isAuthCustomizationMatching, including when the draft has no customization
content. Remove the unconditional true branch and preserve the existing
normalized customization and item customizations inputs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a528e7b0-757b-4d17-8c4f-0c42931be8b1

📥 Commits

Reviewing files that changed from the base of the PR and between fcb76f3 and 136e60b.

📒 Files selected for processing (10)
  • app/[locale]/products/[id]/customization-experience.tsx
  • app/[locale]/seller/products/product-form.tsx
  • modules/cart/application/migrate-guest-cart.ts
  • modules/cart/presentation/components/add-to-cart-button.tsx
  • modules/cart/presentation/components/cart-merge-detector.tsx
  • modules/products/domain/value-objects/product-customization-config.ts
  • modules/products/presentation/schemas/product-form-schema.ts
  • tests/unit/app/[locale]/products/[id]/customization-experience.test.tsx
  • tests/unit/modules/products/domain/value-objects/product-customization-config.test.ts
  • tests/unit/modules/products/infrastructure/prisma-product-repository.test.ts
💤 Files with no reviewable changes (3)
  • tests/unit/modules/products/domain/value-objects/product-customization-config.test.ts
  • modules/products/presentation/schemas/product-form-schema.ts
  • tests/unit/modules/products/infrastructure/prisma-product-repository.test.ts

Comment thread modules/cart/presentation/components/add-to-cart-button.tsx Outdated
@henri318
henri318 merged commit 3e685d5 into main Jul 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant