Skip to content

Feat/improvements ux#146

Merged
henri318 merged 5 commits into
mainfrom
feat/improvements_ux
Jul 13, 2026
Merged

Feat/improvements ux#146
henri318 merged 5 commits into
mainfrom
feat/improvements_ux

Conversation

@henri318

@henri318 henri318 commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Nuevas funcionalidades

    • Añadido un filtro opcional por categoría en los listados y en la búsqueda desde la URL.
    • Incorporada una sección de “productos similares” en la experiencia de producto (carga al hacer scroll y enlace a detalles).
    • Añadido un enlace visible a la categoría del producto desde la experiencia de personalización.
  • Mejoras visuales

    • Cabeceras y secciones mejoran su comportamiento al desplazarse (filtro/bloques “sticky”).
    • Mejorados los ajustes de imágenes/vídeos (sin recortes innecesarios) y el aspecto de miniaturas y tarjetas.
    • Nuevos estilos para enlaces por categoría y mejoras de placeholders.
  • Cambios en formularios y UI

    • Editor del vendedor: edición inline de categoría y pestañas de idioma mejor organizadas; se ajusta la detección de contenido traducido.
  • Traducciones y pruebas

    • Nuevos textos en español y catalán para “similares” y etiqueta de categoría, con tests actualizados.

@coderabbitai

coderabbitai Bot commented Jul 13, 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: 17 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: 6ae4a6dc-213c-479c-9d70-d0a04f70a325

📥 Commits

Reviewing files that changed from the base of the PR and between 2bcc6d4 and e9b3e70.

📒 Files selected for processing (4)
  • app/[locale]/page.tsx
  • app/[locale]/products/[id]/customization-experience.tsx
  • app/[locale]/products/[id]/similar-products.tsx
  • tests/unit/app/[locale]/products/[id]/customization-experience.test.tsx
📝 Walkthrough

Walkthrough

La página principal incorpora filtros por categoría. Las páginas de producto añaden enlaces de categoría y productos similares cargados mediante API. El formulario de vendedor integra la categoría y reorganiza la galería dentro del dropzone. También se actualiza la validación de personalizaciones.

Changes

Descubrimiento de productos

Layer / File(s) Summary
Filtrado por categoría
app/[locale]/page.*, components/products/infinite-product-list.tsx
HomePage y InfiniteProductList aceptan y transmiten category; el listado se reinicializa al cambiar los filtros y el buscador queda sticky.
Consulta de productos similares
modules/products/..., app/api/products/[id]/similar/route.ts, tests/unit/modules/products/application/...
El repositorio y el caso de uso buscan productos activos por etiquetas compartidas, resuelven traducciones y portadas, y exponen los resultados mediante una ruta API con pruebas.
Integración en la página de producto
app/[locale]/products/[id]/..., shared/i18n/locales/*, tests/unit/app/[locale]/products/[id]/*
La personalización muestra el enlace de categoría y una cuadrícula diferida de productos similares con etiquetas traducidas, placeholders y estilos responsive.

Edición de productos del vendedor

Layer / File(s) Summary
Formulario y configuración de categoría
app/[locale]/seller/products/product-form.*, modules/products/presentation/..., tests/unit/app/[locale]/seller/products/*
El formulario incorpora la selección inline de categoría, fija las pestañas de idioma, deriva allowPhotoDesign desde las imágenes y elimina el checkbox del editor anterior.
Galería dentro del dropzone
shared/ui/file-upload-dropzone.tsx, app/[locale]/seller/products/product-photo-gallery.tsx
FileUploadDropzone admite children y la galería, errores y acciones multimedia se renderizan dentro de su contenido.

Validación de personalizaciones

Layer / File(s) Summary
Validación por capacidades
modules/customizations/application/create-customer-customization.ts, tests/unit/modules/customizations/..., tests/e2e/personalization-flow.spec.ts
La creación valida capacidades de texto, foto y estilo, y las pruebas cubren personalizaciones de texto y respuestas HTTP 201.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ProductPage
  participant SimilarProducts
  participant SimilarAPI
  participant SimilarUseCase
  participant ProductRepository
  ProductPage->>SimilarProducts: Renderiza productId, locale y labels
  SimilarProducts->>SimilarAPI: Solicita /api/products/{id}/similar
  SimilarAPI->>SimilarUseCase: Ejecuta la búsqueda
  SimilarUseCase->>ProductRepository: Busca por etiquetas compartidas
  ProductRepository-->>SimilarUseCase: Devuelve productos activos
  SimilarUseCase-->>SimilarAPI: Devuelve traducciones y cover
  SimilarAPI-->>SimilarProducts: Responde con items
  SimilarProducts-->>ProductPage: Renderiza tarjetas enlazadas
Loading

Possibly related PRs

  • henri318/728-store#105: Comparte la integración de enlaces de categoría y SimilarProducts en customization-experience.tsx.
  • henri318/728-store#109: También modifica InfiniteProductList y app/[locale]/page.tsx relacionados con los filtros del listado.
  • henri318/728-store#128: Introduce el modelo y el propósito COVER utilizados para seleccionar la portada de productos similares.

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 demasiado genérico y no describe claramente el cambio principal del PR. Usa un título específico que resuma el cambio principal, por ejemplo: "Mejoras de UX en productos y personalización".
✅ 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/improvements_ux

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: 6

🧹 Nitpick comments (2)
modules/products/application/get-similar-products-use-case.ts (1)

31-52: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Eliminar images del retorno de GetSimilarProductsUseCase
images no forma parte de SimilarProductItem y no se usa en el consumidor de la ruta. Si hace falta exponerla, añádela explícitamente a la interfaz; si no, quítala del mapeo para mantener el DTO alineado con su tipo.

🤖 Prompt for 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.

In `@modules/products/application/get-similar-products-use-case.ts` around lines
31 - 52, Remove the images property from the object returned by the products map
in GetSimilarProductsUseCase so the DTO remains aligned with SimilarProductItem;
do not add it to the interface unless the route consumer explicitly requires
images.
tests/unit/modules/products/application/get-similar-products-use-case.test.ts (1)

22-561: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Fixtures de producto muy repetidos entre los 8 tests.

Cada test reconstruye manualmente el mismo objeto ProductEntity (25-30 líneas) cambiando solo 2-3 campos. Extraer un factory como makeProduct(overrides: Partial<ProductEntity>) reduciría el ruido y evitaría que un cambio futuro en ProductEntity obligue a tocar los 8 fixtures.

♻️ Ejemplo de factory sugerida
function makeProduct(overrides: Partial<ProductEntity> = {}): ProductEntity {
  return {
    id: 'p',
    basePrice: ProductPrice.create(10, Currency.EUR),
    sellerId: 'seller-1',
    sellerName: 'Shop',
    status: ProductStatus.ACTIVE,
    categoryId: null,
    category: null,
    createdAt: new Date(),
    updatedAt: new Date(),
    translations: [],
    images: [],
    tags: [],
    ...overrides,
  };
}
🤖 Prompt for 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.

In
`@tests/unit/modules/products/application/get-similar-products-use-case.test.ts`
around lines 22 - 561, Extract the repeated ProductEntity setup in the test file
into a shared makeProduct factory near the test definitions, using the existing
default values and accepting Partial<ProductEntity> overrides. Replace each
manually constructed product fixture in the eight tests with makeProduct calls
that override only test-specific fields, preserving all current test behavior
and assertions.
🤖 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 `@app/`[locale]/page.module.css:
- Line 167: Insert the required empty line immediately before the padding
declaration in the relevant CSS rule to satisfy Stylelint’s
declaration-empty-line-before rule, without changing the padding value or
surrounding styles.

In `@app/`[locale]/page.tsx:
- Line 100: Actualiza la prop key de InfiniteProductList para construir una
clave sin ambigüedades entre q y category, usando una serialización estructurada
o separadores/escape que no permitan colisiones. Conserva la distinción entre
filtros ausentes y presentes para que React remonte el componente cuando cambie
cualquier combinación de búsqueda o categoría.

In `@app/`[locale]/products/[id]/customization-experience.tsx:
- Around line 411-415: Añade key={productId} al componente SimilarProducts para
forzar su remonte al navegar entre productos y restablecer el estado hasLoaded.
Mantén sin cambios las props existentes y el resto del flujo de renderizado.

In `@app/`[locale]/products/[id]/similar-products.tsx:
- Around line 53-55: Valida res.ok en la petición realizada desde el efecto de
carga de productos similares antes de procesar la respuesta; ante cualquier
respuesta no exitosa, conserva el estado vacío y termina el flujo. Además,
protege el acceso a data.items para que solo se pase un arreglo válido a
setItems, evitando que items.length reciba undefined.

In `@app/`[locale]/seller/products/product-form.module.css:
- Around line 101-107: Rename the CSS selector `.tabsSticky` to `.tabs-sticky`
in the `.tabsSticky` style definition, and update its usage in
`product-form.tsx` from `styles.tabsSticky` to `styles['tabs-sticky']`.

In `@tests/unit/app/`[locale]/products/[id]/customization-experience.test.tsx:
- Around line 36-38: Remove the duplicate vi.mock('next/navigation') declaration
near the later test setup, keeping the identical existing mock declaration
earlier in the file and leaving the useRouter behavior unchanged.

---

Nitpick comments:
In `@modules/products/application/get-similar-products-use-case.ts`:
- Around line 31-52: Remove the images property from the object returned by the
products map in GetSimilarProductsUseCase so the DTO remains aligned with
SimilarProductItem; do not add it to the interface unless the route consumer
explicitly requires images.

In
`@tests/unit/modules/products/application/get-similar-products-use-case.test.ts`:
- Around line 22-561: Extract the repeated ProductEntity setup in the test file
into a shared makeProduct factory near the test definitions, using the existing
default values and accepting Partial<ProductEntity> overrides. Replace each
manually constructed product fixture in the eight tests with makeProduct calls
that override only test-specific fields, preserving all current test behavior
and assertions.
🪄 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: 47630ccc-d9df-4804-8eb9-4c9a891cda9b

📥 Commits

Reviewing files that changed from the base of the PR and between 2329af3 and 77f7416.

📒 Files selected for processing (32)
  • app/[locale]/layout.module.css
  • app/[locale]/page.module.css
  • app/[locale]/page.tsx
  • app/[locale]/products/[id]/customization-experience.module.css
  • app/[locale]/products/[id]/customization-experience.tsx
  • app/[locale]/products/[id]/customization-form.module.css
  • app/[locale]/products/[id]/customization-form.tsx
  • app/[locale]/products/[id]/mockup-canvas-control.tsx
  • app/[locale]/products/[id]/page.module.css
  • app/[locale]/products/[id]/page.tsx
  • app/[locale]/products/[id]/product-showcase-gallery.tsx
  • app/[locale]/products/[id]/similar-products.module.css
  • app/[locale]/products/[id]/similar-products.tsx
  • app/[locale]/seller/products/product-form.module.css
  • app/[locale]/seller/products/product-form.tsx
  • app/[locale]/seller/products/product-photo-gallery.tsx
  • app/api/products/[id]/similar/route.ts
  • components/products/infinite-product-list.tsx
  • modules/products/application/get-similar-products-use-case.ts
  • modules/products/domain/product-repository.ts
  • modules/products/infrastructure/prisma-product-repository.ts
  • modules/products/presentation/components/product-customization-config-editor.module.css
  • modules/products/presentation/components/product-customization-config-editor.tsx
  • modules/products/presentation/product-form-labels.ts
  • shared/i18n/locales/cat.json
  • shared/i18n/locales/es.json
  • shared/ui/file-upload-dropzone.tsx
  • tests/doubles/memory-product-repository.ts
  • tests/unit/app/[locale]/products/[id]/customization-experience.test.tsx
  • tests/unit/app/[locale]/seller/products/product-form-locale-tabs.test.tsx
  • tests/unit/app/[locale]/seller/products/product-form.test.tsx
  • tests/unit/modules/products/application/get-similar-products-use-case.test.ts
💤 Files with no reviewable changes (4)
  • tests/unit/app/[locale]/seller/products/product-form-locale-tabs.test.tsx
  • modules/products/presentation/components/product-customization-config-editor.module.css
  • modules/products/presentation/components/product-customization-config-editor.tsx
  • modules/products/presentation/product-form-labels.ts

--search-width: 20rem;
padding: 0 0 var(--spacing-md) 60px;
position: relative;
padding: 0.5rem 0 var(--spacing-md) 60px;

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Stylelint: falta línea vacía antes de la declaración padding.

Stylelint reportó un error en la línea 167: se espera una línea vacía antes de la declaración padding (regla declaration-empty-line-before). Esto podría fallar el paso de lint en CI.

🔧 Corrección propuesta
 .searchWrap {
   --search-offset-left: 60px;
   --search-width: 20rem;
+
   padding: 0.5rem 0 var(--spacing-md) 60px;
   position: sticky;
   top: 0;
   z-index: calc(var(--z-content) + 1);
   background: var(--color-cream);
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
padding: 0.5rem 0 var(--spacing-md) 60px;
.searchWrap {
--search-offset-left: 60px;
--search-width: 20rem;
padding: 0.5rem 0 var(--spacing-md) 60px;
position: sticky;
top: 0;
z-index: calc(var(--z-content) + 1);
background: var(--color-cream);
}
🧰 Tools
🪛 Stylelint (17.14.0)

[error] 167-167: Expected empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)

🤖 Prompt for 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.

In `@app/`[locale]/page.module.css at line 167, Insert the required empty line
immediately before the padding declaration in the relevant CSS rule to satisfy
Stylelint’s declaration-empty-line-before rule, without changing the padding
value or surrounding styles.

Source: Linters/SAST tools

Comment thread app/[locale]/page.tsx Outdated
Comment thread app/[locale]/products/[id]/customization-experience.tsx
Comment thread app/[locale]/products/[id]/similar-products.tsx Outdated
Comment on lines +101 to +107
.tabsSticky {
position: sticky;
top: 0;
z-index: 10;
background: var(--color-cream);
padding: 0.5rem 0;
}

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

El selector .tabsSticky incumple la convención kebab-case del proyecto.

Stylelint marca este selector como error (selector-class-pattern), lo que hará fallar el lint. Renómbralo a .tabs-sticky y actualiza la referencia en product-form.tsx (que hoy lo usa como styles.tabsStickystyles['tabs-sticky']).

♻️ Renombrado propuesto
-.tabsSticky {
+.tabs-sticky {
   position: sticky;
   top: 0;
   z-index: 10;
   background: var(--color-cream);
   padding: 0.5rem 0;
 }

En app/[locale]/seller/products/product-form.tsx (Línea 956):

-          <div className={styles.tabsSticky}>
+          <div className={styles['tabs-sticky']}>
🧰 Tools
🪛 Stylelint (17.14.0)

[error] 101-101: Expected class selector ".tabsSticky" to be kebab-case (selector-class-pattern)

(selector-class-pattern)

🤖 Prompt for 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.

In `@app/`[locale]/seller/products/product-form.module.css around lines 101 - 107,
Rename the CSS selector `.tabsSticky` to `.tabs-sticky` in the `.tabsSticky`
style definition, and update its usage in `product-form.tsx` from
`styles.tabsSticky` to `styles['tabs-sticky']`.

Source: Linters/SAST tools

Comment thread tests/unit/app/[locale]/products/[id]/customization-experience.test.tsx Outdated
@henri318
henri318 merged commit fe00f20 into main Jul 13, 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