[SUPERSEDED] Lovable sync 1779811437#464
Conversation
X-Lovable-Edit-ID: edt-65367ce7-14f5-4395-a51d-c85d05a6f978 Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 35 minutes and 20 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
There was a problem hiding this comment.
Pull request overview
Este PR centraliza a persistência e o mapeamento de classes do grid de produtos (colunas) para reduzir duplicação entre páginas/grids, adicionando também testes e pequenos ajustes de acessibilidade no seletor de colunas.
Changes:
- Exporta
STORAGE_KEY/getDefaultColumnse centraliza classes emCOLUMN_CLASSESnoColumnSelector. - Padroniza o uso da chave de colunas (via
STORAGE_KEY) e adiciona persistência emlocalStorageem múltiplos states/hooks. - Ajusta lógica de “responsive clamp” de colunas e adiciona teste unitário para
ColumnSelector.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/products/FavoritesPage.tsx | Passa a usar STORAGE_KEY compartilhada para persistir colunas do grid. |
| src/pages/filters/useFiltersPageState.ts | Persiste colunas via STORAGE_KEY e melhora clamp responsivo por breakpoint. |
| src/pages/collections/useCollectionsPageState.ts | Persiste colunas via STORAGE_KEY no state da página de coleções. |
| src/hooks/products/useCatalogState.ts | Ajusta clamp responsivo e mantém persistência de colunas via STORAGE_KEY. |
| src/components/replenishments/ReplenishmentProductGrid.tsx | Persiste seleção de colunas via STORAGE_KEY. |
| src/components/replenishments/grid-layout.ts | Remove duplicação de map de classes e reutiliza COLUMN_CLASSES. |
| src/components/products/ProductGrid.tsx | Reutiliza COLUMN_CLASSES para manter consistência entre grids. |
| src/components/products/ColumnSelector.tsx | Exporta constantes/funções, adiciona COLUMN_CLASSES, melhora ARIA do seletor. |
| src/components/products/ColumnSelector.test.tsx | Adiciona testes para render/clamp/persistência/teclado do seletor. |
| src/components/novelties/NoveltyProductGrid.tsx | Reutiliza COLUMN_CLASSES e persiste colunas via STORAGE_KEY. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export const COLUMN_CLASSES: Record<ColumnCount, string> = { | ||
| 3: "grid-cols-3", | ||
| 4: "grid-cols-2 sm:grid-cols-3 md:grid-cols-4", | ||
| 5: "grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5", | ||
| 6: "grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6", | ||
| 8: "grid-cols-4 sm:grid-cols-5 md:grid-cols-6 lg:grid-cols-8", | ||
| }; |
| import { useReducedMotion } from "@/hooks/ui/useReducedMotion"; | ||
| import { SelectionCheckbox } from "@/components/common/SelectionCheckbox"; | ||
| import { cn } from "@/lib/utils"; | ||
| import { COLUMN_CLASSES, type ColumnCount } from "./ColumnSelector"; |
| const options = [3, 4, 5, 6, 8]; | ||
| options.forEach(cols => { | ||
| expect(screen.getByRole("radio", { name: `${cols} colunas` })).toBeInTheDocument(); | ||
| }); |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Fechado: versão intermediária supersedida pelo PR #465 (lovable-sync-1779811798). O #465 contém conteúdo idêntico + mais completo (COLUMN_CLASSES, data-testid, E2E tests).
Summary by cubic
Unifies grid column behavior across product views and persists the user’s column choice. Adds accessibility, keyboard support, and tests for the Column Selector while removing duplicated grid class maps.
New Features
STORAGE_KEY('product-grid-columns') and use it across products, novelties, replenishments, collections, filters, and favorites.radiogroup/radioroles,aria-checked, focus styles, and keyboard selection (Enter/Space).ColumnSelector: persistence, responsive filtering, auto-clamping, and keyboard navigation.Refactors
COLUMN_CLASSES; removed per-component mappings and unified usage in all grids.getDefaultColumnsand standardized responsive clamping to cap columns by breakpoint.Written for commit 159c973. Summary will update on new commits. Review in cubic