Skip to content

[SUPERSEDED] Lovable sync 1779811626#463

Closed
adm01-debug wants to merge 25 commits into
mainfrom
lovable-sync-1779811626
Closed

[SUPERSEDED] Lovable sync 1779811626#463
adm01-debug wants to merge 25 commits into
mainfrom
lovable-sync-1779811626

Conversation

@adm01-debug
Copy link
Copy Markdown
Owner

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

Fechado: supersedido pelo PR #465 (lovable-sync-1779811798) que contém o mesmo conteúdo + COLUMN_CLASSES centralizado + data-testid + E2E tests. Conflito com main — conteúdo incorporado via #465.

lovable-dev Bot and others added 25 commits May 26, 2026 16:01
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
X-Lovable-Edit-ID: edt-65367ce7-14f5-4395-a51d-c85d05a6f978
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
X-Lovable-Edit-ID: edt-611c7804-1473-40a2-a367-4d923e4500fd
Co-authored-by: adm01-debug <231131902+adm01-debug@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 26, 2026 16:09
@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:09pm

@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 35 minutes and 40 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: 42147b44-154f-449e-8b29-4f41e9de2af7

📥 Commits

Reviewing files that changed from the base of the PR and between fa7ad6d and 98fc0cc.

📒 Files selected for processing (11)
  • 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/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-1779811626

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 centralizes product grid column configuration and persistence so multiple pages share the same column-density behavior, while updating the column selector UI (always showing 3/4/5/6/8) and adding unit coverage.

Changes:

  • Exported shared constants (STORAGE_KEY, COLUMN_CLASSES) from ColumnSelector and reused them across grids/utilities.
  • Unified grid column persistence to a single localStorage key across multiple pages/components.
  • Added accessibility improvements to ColumnSelector (radiogroup/radio roles) and introduced unit tests.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/pages/products/FavoritesPage.tsx Switches to shared grid columns storage key import.
src/pages/filters/useFiltersPageState.ts Adds persistence wrapper for grid columns and updates responsive clamp logic.
src/pages/collections/useCollectionsPageState.ts Adds persistence wrapper for grid columns using shared storage key.
src/hooks/products/useCatalogState.ts Updates responsive clamp logic for grid columns and persists columns under shared key.
src/components/replenishments/ReplenishmentProductGrid.tsx Adds persistence wrapper for grid columns using shared storage key.
src/components/replenishments/grid-layout.ts Replaces local cols→class mapping with shared COLUMN_CLASSES.
src/components/products/ProductGrid.tsx Reuses shared COLUMN_CLASSES instead of a local mapping.
src/components/products/LayoutPopover.tsx Slight width adjustment for the popover content.
src/components/products/ColumnSelector.tsx Exports shared constants, always shows all options, adds ARIA roles and keyboard handling, persists selection.
src/components/products/ColumnSelector.test.tsx Adds unit tests for options visibility, persistence, ARIA, and keyboard interaction.
src/components/novelties/NoveltyProductGrid.tsx Reuses shared COLUMN_CLASSES and adds persistence wrapper for grid columns.

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

Comment on lines +8 to 9
import { COLUMN_CLASSES, type ColumnCount } from "./ColumnSelector";
import { ProductCardSkeleton } from "./ProductCardSkeleton";
Comment on lines +110 to 123
// Responsive clamp: garante que o número de colunas não ultrapasse o disponível
// para a largura atual da tela, mantendo a consistência visual.
useEffect(() => {
const handleResize = () => {
const w = window.innerWidth;
if (w < 640 && gridColumns > 1) {
setGridColumnsState(3 as ColumnCount);
} else if (w >= 640 && w < 768 && gridColumns > 2) {
setGridColumnsState(3 as ColumnCount);
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;

if (gridColumns > maxCols) {
setGridColumns(maxCols);
}
Comment on lines +187 to 207
const [gridColumns, setGridColumnsState] = useState<ColumnCount>(getDefaultColumns);
const setGridColumns = useCallback((cols: ColumnCount) => {
setGridColumnsState(cols);
try {
localStorage.setItem(GRID_COLS_KEY, String(cols));
} catch { /* empty */ }
}, []);

// 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;

if (gridColumns > maxCols) {
setGridColumns(maxCols);
}
Comment on lines 90 to 103
@@ -97,9 +101,6 @@ export function ColumnSelector({ value, onChange, className }: ColumnSelectorPro

const available = getAvailableOptions(screenWidth);

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();
});
@@ -0,0 +1,103 @@
import { render, screen, fireEvent, waitFor, act } from "@testing-library/react";
Comment on lines 60 to +69
export function NoveltyProductGrid() {
const navigate = useNavigate();
const [viewMode, setViewMode] = useState<ViewMode>('grid');
const [gridColumns, setGridColumns] = useState<ColumnCount>(getDefaultColumns);
const [gridColumns, setGridColumnsState] = useState<ColumnCount>(getDefaultColumns);
const setGridColumns = useCallback((cols: ColumnCount) => {
setGridColumnsState(cols);
try {
localStorage.setItem(GRID_COLS_KEY, String(cols));
} catch { /* empty */ }
}, []);
Comment on lines 59 to +68
export function ReplenishmentProductGrid() {
const navigate = useNavigate();
const [viewMode, setViewMode] = useState<ViewMode>('grid');
const [gridColumns, setGridColumns] = useState<ColumnCount>(getDefaultColumns);
const [gridColumns, setGridColumnsState] = useState<ColumnCount>(getDefaultColumns);
const setGridColumns = useCallback((cols: ColumnCount) => {
setGridColumnsState(cols);
try {
localStorage.setItem(GRID_COLS_KEY, String(cols));
} catch { /* empty */ }
}, []);
@adm01-debug adm01-debug changed the title Lovable sync 1779811626 [SUPERSEDED] Lovable sync 1779811626 May 26, 2026
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