Skip to content

Lovable sync 1779811798#465

Closed
adm01-debug wants to merge 0 commit into
mainfrom
lovable-sync-1779811798
Closed

Lovable sync 1779811798#465
adm01-debug wants to merge 0 commit into
mainfrom
lovable-sync-1779811798

Conversation

@adm01-debug
Copy link
Copy Markdown
Owner

@adm01-debug adm01-debug commented May 26, 2026

📋 Descrição

🎯 Tipo de mudança

  • 🚀 feat — nova funcionalidade
  • 🐛 fix — correção de bug
  • ♻️ refactor — refatoração (sem mudança de comportamento)
  • 🔧 chore — manutenção, deps, config
  • 📚 docs — documentação
  • ⚡ perf — performance
  • 🔒 security — segurança
  • 🚨 hotfix — correção urgente em produção
  • 💥 breaking change — quebra compatibilidade

🔗 Issues relacionadas

Closes #
Refs #

🌐 Sistemas afetados

  • Bitrix24 (CRM, SPAs, BizProc)
  • Supabase (DB, Edge Functions, RLS, migrations)
  • n8n (workflows)
  • Evolution API / WhatsApp
  • Bling (NFe, OAuth)
  • Cloudflare (Workers, Images, Tunnels)
  • Frontend (UI, dashboards)
  • CI / GitHub Actions
  • Outro: ____

🧪 Como testar

✅ Checklist pré-merge

Qualidade

  • Código segue style guide (ESLint passa)
  • npx tsc --noEmit passa sem erros
  • Testes passam (npm run test)
  • Adicionei testes para novas funcionalidades quando aplicável
  • CodeRabbit revisou o PR (ou justificativa para skip)

Segurança

  • Sem secrets, tokens ou credenciais hardcoded
  • Variáveis de ambiente novas documentadas
  • Sem console.log com payloads sensíveis (usar logger.*)
  • RLS revisado se houve mudança em tabelas
  • Edge functions: input validado com Zod

Documentação

  • Atualizei docs (README / CHANGELOG / docs/) se necessário
  • Memória atualizada (mem://) se a mudança afetar arquitetura/regras
  • Migrations com backup em _backup_*_YYYYMMDD se destrutivas

UI

  • Componentes usam tokens semânticos (sem cores hardcoded)
  • Screenshots / vídeo anexados (se mudança visual)

📸 Screenshots (se UI)

🔄 Plano de rollback

⚠️ Notas para o reviewer


Summary by cubic

Made the product grid column selector consistent, accessible, and persistent across pages. Centralized responsive grid classes and added unit/E2E coverage for reliability.

  • New Features
    • ColumnSelector shows 3/4/5/6/8 options, persists in localStorage under product-grid-columns, with safe fallback via getDefaultColumns.
    • Centralized responsive grid via COLUMN_CLASSES shared by Products, Favorites, Novelties, Replenishments, Collections, and Filters; includes viewport-based resize clamping.
    • A11y: radiogroup with aria-checked, keyboard support (Enter/Space), and clear focus styles.
    • Tests: unit for ColumnSelector; E2E for persistence, navigation, a11y, and visuals; added data-testid hooks on the layout trigger and grid containers/rows.

Written for commit c24c2a1. Summary will update on new commits. Review in cubic

Copilot AI review requested due to automatic review settings May 26, 2026 16:10
@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
we-dream-big Ready Ready Preview, Comment May 26, 2026 4:28pm

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Warning

Review limit reached

@adm01-debug, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 34 minutes and 51 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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 97614015-73c7-49c5-8da3-2d5d251bbb7c

📥 Commits

Reviewing files that changed from the base of the PR and between 1509a1d and ffcd32c.

📒 Files selected for processing (13)
  • e2e/column-selector.spec.ts
  • src/components/novelties/NoveltyProductGrid.tsx
  • src/components/products/ColumnSelector.test.tsx
  • src/components/products/ColumnSelector.tsx
  • src/components/products/LayoutPopover.tsx
  • src/components/products/ProductGrid.tsx
  • src/components/products/VirtualizedProductGrid.tsx
  • src/components/replenishments/ReplenishmentProductGrid.tsx
  • src/components/replenishments/grid-layout.ts
  • src/hooks/products/useCatalogState.ts
  • src/pages/collections/useCollectionsPageState.ts
  • src/pages/filters/useFiltersPageState.ts
  • src/pages/products/FavoritesPage.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lovable-sync-1779811798

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

@supabase
Copy link
Copy Markdown

supabase Bot commented May 26, 2026

This pull request has been ignored for the connected project doufsxqlfjyuvxuezpln because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR standardizes product grid “column density” behavior across multiple pages by centralizing column CSS classes and the localStorage key used to persist the chosen column count, and adds new unit/E2E coverage and test hooks (data-testid) for the selector and grids.

Changes:

  • Centralizes STORAGE_KEY (grid column persistence) and introduces COLUMN_CLASSES for consistent responsive grid layouts.
  • Updates multiple pages/hooks to persist gridColumns using the shared storage key and refines responsive clamping logic.
  • Adds data-testid hooks plus new unit tests and a new Playwright spec for column selector behavior.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
src/pages/products/FavoritesPage.tsx Switches to shared STORAGE_KEY import for grid columns.
src/pages/filters/useFiltersPageState.ts Persists grid columns to shared storage key and adds viewport-based clamping.
src/pages/collections/useCollectionsPageState.ts Persists grid columns to shared storage key.
src/hooks/products/useCatalogState.ts Persists grid columns to shared storage key and updates viewport-based clamping.
src/components/replenishments/ReplenishmentProductGrid.tsx Persists grid columns to shared storage key.
src/components/replenishments/grid-layout.ts Reuses centralized COLUMN_CLASSES for grid column classes.
src/components/products/VirtualizedProductGrid.tsx Adds data-testid hooks for container/rows to support E2E.
src/components/products/ProductGrid.tsx Reuses centralized COLUMN_CLASSES instead of local mapping.
src/components/products/LayoutPopover.tsx Adds data-testid to trigger; adjusts popover width.
src/components/products/ColumnSelector.tsx Exposes STORAGE_KEY, getDefaultColumns, and COLUMN_CLASSES; updates selector behavior & test hooks.
src/components/products/ColumnSelector.test.tsx Adds new unit tests for ColumnSelector behavior/accessibility/persistence.
src/components/novelties/NoveltyProductGrid.tsx Reuses centralized COLUMN_CLASSES and shared storage persistence.
e2e/column-selector.spec.ts Adds Playwright spec for column switching, persistence, accessibility, and visual snapshots.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/products/ProductGrid.tsx Outdated
8: "grid-cols-3 sm:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8",
};
// Usando as classes centralizadas para garantir consistência em todos os grids do sistema.
const columnClasses = COLUMN_CLASSES;
@@ -0,0 +1,103 @@
import { render, screen, fireEvent, waitFor, act } from "@testing-library/react";
Comment on lines +37 to +40
const options = [3, 4, 5, 6, 8];
options.forEach(cols => {
expect(screen.getByRole("radio", { name: `${cols} colunas` })).toBeInTheDocument();
});
Comment on lines +74 to +76
[3, 4, 5, 6, 8].forEach(cols => {
expect(screen.getByRole("radio", { name: `${cols} colunas` })).toBeInTheDocument();
});
Comment on lines +85 to +87
[3, 4, 5, 6, 8].forEach(cols => {
expect(screen.getByRole("radio", { name: `${cols} colunas` })).toBeInTheDocument();
});
Comment on lines +195 to +203
// Responsive clamp: force appropriate columns on small screens
useEffect(() => {
const handleResize = () => {
const w = window.innerWidth;
if (w < 768 && gridColumns > 3) {
setGridColumns(3);
let maxCols: ColumnCount = 3;
if (w >= 1536) maxCols = 8;
else if (w >= 1280) maxCols = 6;
else if (w >= 1024) maxCols = 5;
else if (w >= 768) maxCols = 4;
Comment on lines 205 to 207
if (gridColumns > maxCols) {
setGridColumns(maxCols);
}
Comment on lines +25 to +29
const renderSelector = (value: any = 5, onChange = vi.fn()) => {
return render(
<TooltipProvider>
<ColumnSelector value={value} onChange={onChange} />
</TooltipProvider>
Comment thread e2e/column-selector.spec.ts Outdated
Comment on lines +19 to +23
await page.getByTestId("layout-popover-trigger").click();

// Test 3 columns
const option3 = page.getByTestId("column-option-3");
await option3.click();
Comment thread e2e/column-selector.spec.ts Outdated
Comment on lines +126 to +129
// Stabilize UI for snapshots (freeze animations, hide loaders)
await page.addInitScript(() => {
const style = document.createElement('style');
style.innerHTML = `
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.

2 participants