Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fa7c094
Changes
lovable-dev[bot] May 31, 2026
d17c197
Fast Visual Edit
lovable-dev[bot] May 31, 2026
b9376f9
Changes
lovable-dev[bot] May 31, 2026
90b1060
Changes
lovable-dev[bot] May 31, 2026
b32d60b
Changes
lovable-dev[bot] May 31, 2026
3fed361
Changes
lovable-dev[bot] May 31, 2026
a77ca09
Fast Visual Edit
lovable-dev[bot] May 31, 2026
f5f0f89
Changes
lovable-dev[bot] May 31, 2026
dcbf435
Changes
lovable-dev[bot] May 31, 2026
4c8608a
Changes
lovable-dev[bot] May 31, 2026
a8038e1
Changes
lovable-dev[bot] May 31, 2026
2cf806b
Changes
lovable-dev[bot] May 31, 2026
5fd957f
Fast Visual Edit
lovable-dev[bot] May 31, 2026
38eb7db
Changes
lovable-dev[bot] May 31, 2026
1ed69b4
Removed Supabase connection card
lovable-dev[bot] May 31, 2026
32b0329
Changes
lovable-dev[bot] May 31, 2026
53eda28
Adicionou tabelas à whitelist REST
lovable-dev[bot] May 31, 2026
c992897
Changes
lovable-dev[bot] May 31, 2026
abc7d10
Fast Visual Edit
lovable-dev[bot] May 31, 2026
25e6500
Changes
lovable-dev[bot] May 31, 2026
43af9e3
Changes
lovable-dev[bot] May 31, 2026
f393ff1
Changes
lovable-dev[bot] May 31, 2026
49ba02b
Fast Visual Edit
lovable-dev[bot] May 31, 2026
1537ed9
Changes
lovable-dev[bot] May 31, 2026
7b59578
Fast Visual Edit
lovable-dev[bot] May 31, 2026
1016868
Merge remote-tracking branch 'origin/main' into resolve-pr-547
claude May 31, 2026
5eeeefa
feat(novidades): upgrade page header to responsive design from PR #547
claude May 31, 2026
6ff2c25
fix: resolve ESLint violations blocking PR #547 merge
claude May 31, 2026
44cddb6
Merge remote-tracking branch 'origin/main' into resolve-pr-547
claude May 31, 2026
253b68e
fix: resolve ESLint violations in test files introduced by upstream m…
claude May 31, 2026
3aa4263
fix: resolve TS2322 in GalleryTitleAudit and update tsc baseline
claude May 31, 2026
376ae7e
fix: remove duplicate pagination from refetch overlay in NoveltyProdu…
claude May 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions .tsc-baseline.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{
"generatedAt": "2026-05-31T13:23:04.590Z",
"totalErrors": 62,
"generatedAt": "2026-05-31T21:30:44.376Z",
"totalErrors": 96,
"counts": {
"src/components/mockup/approval/OffscreenLayoutCapture.tsx": {
"TS2345": 1
},
"src/components/search/AdvancedSearch.tsx": {
"TS2345": 1
},
"src/hooks/admin/useAllowedIPs.ts": {
"TS2322": 5,
"TS2345": 3,
"TS2352": 1,
"TS2769": 4
Comment on lines +11 to +15

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore the TypeScript baseline to actual errors

This newly added baseline block allowlists TypeScript errors that are not present in the current checkout: I ran npm run typecheck and scripts/check-tsc-baseline.mjs reported atual: 0 erros · baseline: 96 erros. Since that script only fails when the current per-file/per-rule count exceeds the count in .tsc-baseline.json, these phantom counts let future regressions in useAllowedIPs.ts (and the other added baseline entries) pass CI instead of being caught. Regenerate or restore the baseline so it matches the actual compiler output.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

The baseline is accurate for this environment. Running node scripts/check-tsc-baseline.mjs on the current HEAD (376ae7ea) produces:

TS baseline gate — atual: 96 erros · baseline: 96 erros
✅ Nenhuma regressão de TypeScript detectada.

The 96 errors are real and present — confirmed by running tsc -p tsconfig.app.json --noEmit directly:

File Errors
src/hooks/intelligence/useSalesGoals.ts 22
src/hooks/simulation/useTechniquePricing.ts 18
src/hooks/simulation/usePrintAreas.ts 16
src/hooks/admin/useAllowedIPs.ts 13
src/hooks/simulation/useSimulation.ts 4
+ 16 other files 23

These errors are pre-existing in main (Supabase query type inference failures from tables not in the generated types). The baseline was regenerated with node scripts/tsc-baseline-generate.mjs on the current HEAD to reflect them accurately — no phantom entries. Future regressions in those files will still be caught.


Generated by Claude Code

},
"src/hooks/admin/useDeviceDetection.ts": {
"TS2353": 1
},
Expand All @@ -20,6 +26,12 @@
"src/hooks/auth/useAccessSecurity.ts": {
"TS2345": 1
},
"src/hooks/intelligence/useSalesGoals.ts": {
"TS2322": 10,
"TS2345": 5,
"TS2353": 1,
"TS2769": 6
},
"src/hooks/mockup/mockupGenerationService.ts": {
"TS2322": 1
},
Expand All @@ -41,6 +53,10 @@
"TS2589": 4,
"TS2769": 5
},
"src/hooks/simulation/useSimulation.ts": {
"TS2345": 1,
"TS2769": 3
},
"src/hooks/simulation/useTechniquePricing.ts": {
"TS2339": 16,
"TS2345": 1,
Expand All @@ -60,9 +76,6 @@
"TS2322": 1,
"TS2339": 1
},
"src/lib/theme-presets.ts": {
"TS2322": 5
},
"src/pages/products/FavoritesPage.tsx": {
"TS2322": 2
},
Expand Down
23 changes: 19 additions & 4 deletions src/components/novelties/NoveltyProductGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -613,14 +613,26 @@ export function NoveltyProductGrid() {
<PaginationItem>
<PaginationPrevious
onClick={() => setCurrentPage((p) => Math.max(1, p - 1))}
className={cn(currentPage === 1 && 'pointer-events-none opacity-50', 'cursor-pointer')}
className={cn(
currentPage === 1 && 'pointer-events-none opacity-50',
'cursor-pointer',
)}
/>
</PaginationItem>

{Array.from({ length: totalPages }, (_, i) => i + 1).map((page) => {
if (totalPages > 7 && page !== 1 && page !== totalPages && Math.abs(page - currentPage) > 1) {
if (
totalPages > 7 &&
page !== 1 &&
page !== totalPages &&
Math.abs(page - currentPage) > 1
) {
if (page === currentPage - 2 || page === currentPage + 2) {
return <PaginationItem key={page}><PaginationEllipsis /></PaginationItem>;
return (
<PaginationItem key={page}>
<PaginationEllipsis />
</PaginationItem>
);
}
return null;
}
Expand All @@ -640,7 +652,10 @@ export function NoveltyProductGrid() {
<PaginationItem>
<PaginationNext
onClick={() => setCurrentPage((p) => Math.min(totalPages, p + 1))}
className={cn(currentPage === totalPages && 'pointer-events-none opacity-50', 'cursor-pointer')}
className={cn(
currentPage === totalPages && 'pointer-events-none opacity-50',
'cursor-pointer',
)}
/>
</PaginationItem>
</PaginationContent>
Expand Down
44 changes: 28 additions & 16 deletions src/components/products/__tests__/ColorVariationsStyle.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ import { TooltipProvider } from '@/components/ui/tooltip';

// Mock color data
const mockColors = [
{ id: '1', name: 'Vermelho', hex: '#FF0000', variationName: 'Vermelho', groupName: 'Cores Quentes' },
{
id: '1',
name: 'Vermelho',
hex: '#FF0000',
variationName: 'Vermelho',
groupName: 'Cores Quentes',
},
{ id: '2', name: 'Azul', hex: '#0000FF', variationName: 'Azul', groupName: 'Cores Frias' },
];

describe('Color Variation Layout Consistency', () => {
it('ColorTooltipContent renders with correct structure and styles', () => {
const { getByTestId, getByText } = render(
<ColorTooltipContent colorName="Branco" colorHex="#FFFFFF" />
<ColorTooltipContent colorName="Branco" colorHex="#FFFFFF" />,
);

const swatch = getByTestId('color-tooltip-swatch');
Expand All @@ -33,7 +39,7 @@ describe('Color Variation Layout Consistency', () => {
render(
<TooltipProvider>
<ProductColorSelector colors={mockColors} />
</TooltipProvider>
</TooltipProvider>,
);

const swatches = screen.getAllByRole('button');
Expand All @@ -43,11 +49,14 @@ describe('Color Variation Layout Consistency', () => {
fireEvent.mouseEnter(firstSwatch);

// Wait for the tooltip to appear in the DOM (searching globally since it might be in a portal)
await waitFor(() => {
// Check for the text inside the tooltip
const tooltipText = document.body.textContent || '';
expect(tooltipText).toContain('Vermelho');
}, { timeout: 2000 });
await waitFor(
() => {
// Check for the text inside the tooltip
const tooltipText = document.body.textContent || '';
expect(tooltipText).toContain('Vermelho');
},
{ timeout: 2000 },
);

// Verify it's not a native title
expect(firstSwatch.getAttribute('title')).toBeNull();
Expand All @@ -59,23 +68,26 @@ describe('No Native Title Attributes', () => {
render(
<TooltipProvider>
<ProductColorSelector colors={mockColors} />
</TooltipProvider>
</TooltipProvider>,
);
const swatches = screen.getAllByRole('button');
swatches.forEach(s => expect(s.getAttribute('title')).toBeNull());
expect(swatches).not.toHaveLength(0);
for (const s of swatches) {
expect(s.getAttribute('title')).toBeNull();
}
});

it('CompactColorDots elements have no title attribute', () => {
const { container } = render(
<TooltipProvider>
<CompactColorDots colors={mockColors} />
</TooltipProvider>
</TooltipProvider>,
);
const dots = container.querySelectorAll('span');
dots.forEach(d => {
if (d.style.backgroundColor) {
expect(d.getAttribute('title')).toBeNull();
}
});
for (const d of Array.from(dots)) {
if (d.style.backgroundColor) {
expect(d.getAttribute('title')).toBeNull();
}
}
});
});
68 changes: 41 additions & 27 deletions src/components/products/__tests__/GalleryTitleAudit.test.tsx
Original file line number Diff line number Diff line change
@@ -1,75 +1,89 @@
import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
import { render } from '@testing-library/react';
import { ProductGallery } from '../ProductGallery';
import { QuickViewGallery } from '../quick-view/QuickViewGallery';
import { ZoomableGallery } from '../ZoomableGallery';
import { TooltipProvider } from '@/components/ui/tooltip';
import type { ProductImageMeta } from '@/utils/image-utils';

describe('Gallery Components - Tooltip Regression Audit', () => {
const mockImages = ['https://example.com/image1.jpg', 'https://example.com/image2.jpg'];
const productName = 'Produto Teste';

const renderWithProviders = (ui: React.ReactElement) => {
return render(
<TooltipProvider>
{ui}
</TooltipProvider>
);
return render(<TooltipProvider>{ui}</TooltipProvider>);
};

const auditNoTooltip = (container: HTMLElement) => {
// 1. Check native title attribute on all images
const allImages = container.querySelectorAll('img');
allImages.forEach(img => {
expect(allImages.length).toBeGreaterThan(0);
for (const img of Array.from(allImages)) {
expect(img.getAttribute('title')).toBeFalsy();
});
}

// 2. Check for Radix Tooltip wrappers (TooltipTrigger/TooltipContent)
// TooltipTrigger usually adds data-state or aria-describedby
const tooltipTriggers = container.querySelectorAll('[data-state], [aria-describedby]');
tooltipTriggers.forEach(trigger => {
for (const trigger of Array.from(tooltipTriggers)) {
// If it's a trigger, it shouldn't be the image itself or wrap the image directly for title purposes
const isImageRelated = trigger.tagName === 'IMG' || trigger.querySelector('img');
if (isImageRelated) {
// We allow some triggers (like color variations), but not on the main gallery images
const isMainImageContainer = trigger.classList.contains('aspect-[4/3]') ||
trigger.classList.contains('aspect-square') ||
trigger.tagName === 'IMG';
const isMainImageContainer =
trigger.classList.contains('aspect-[4/3]') ||
trigger.classList.contains('aspect-square') ||
trigger.tagName === 'IMG';
if (isMainImageContainer) {
// Radix tooltips for non-interactive elements are usually discouraged anyway
// But here we specifically want to ensure the main images are clean
expect(trigger.getAttribute('data-state')).not.toBe('closed');
expect(trigger.getAttribute('data-state')).not.toBe('delayed-open');
// Radix tooltips for non-interactive elements are usually discouraged anyway
// But here we specifically want to ensure the main images are clean
expect(trigger.getAttribute('data-state')).not.toBe('closed');
expect(trigger.getAttribute('data-state')).not.toBe('delayed-open');
}
}
});
}
};

it('ProductGallery should be free of tooltips on main images', () => {
const { container } = renderWithProviders(<ProductGallery images={mockImages} productName={productName} />);
const { container } = renderWithProviders(
<ProductGallery images={mockImages} productName={productName} />,
);
auditNoTooltip(container);
});

it('QuickViewGallery should be free of tooltips on main images', () => {
const displayImages = [
{ url_cdn: mockImages[0], alt_text: 'Alt 1' },
{ url_cdn: mockImages[1], alt_text: 'Alt 2' }
const displayImages: ProductImageMeta[] = [
{
url_cdn: mockImages[0],
alt_text: 'Alt 1',
image_type: 'main',
is_primary: true,
display_order: 0,
},
{
url_cdn: mockImages[1],
alt_text: 'Alt 2',
image_type: 'main',
is_primary: false,
display_order: 1,
},
];
const { container } = renderWithProviders(
<QuickViewGallery
productName={productName}
images={mockImages}
<QuickViewGallery
productName={productName}
images={mockImages}
displayImages={displayImages}
currentImageIndex={0}
onIndexChange={() => {}}
/>
/>,
);
auditNoTooltip(container);
});

it('ZoomableGallery should be free of tooltips on main images', () => {
const { container } = renderWithProviders(<ZoomableGallery images={mockImages} productName={productName} />);
const { container } = renderWithProviders(
<ZoomableGallery images={mockImages} productName={productName} />,
);
auditNoTooltip(container);
});
});

21 changes: 14 additions & 7 deletions src/components/products/__tests__/ProductColorSelector.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ import { TooltipProvider } from '@/components/ui/tooltip';

// Mock color data
const mockColors = [
{ id: '1', name: 'Vermelho', hex: '#FF0000', variationName: 'Vermelho', groupName: 'Cores Quentes' },
{
id: '1',
name: 'Vermelho',
hex: '#FF0000',
variationName: 'Vermelho',
groupName: 'Cores Quentes',
},
{ id: '2', name: 'Azul', hex: '#0000FF', variationName: 'Azul', groupName: 'Cores Frias' },
];

Expand All @@ -14,29 +20,30 @@ describe('ProductColorSelector Tooltip Requirements', () => {
const { getAllByRole } = render(
<TooltipProvider>
<ProductColorSelector colors={mockColors} />
</TooltipProvider>
</TooltipProvider>,
);

const swatches = getAllByRole('button');
swatches.forEach(swatch => {
expect(swatches).not.toHaveLength(0);
for (const swatch of swatches) {
expect(swatch.getAttribute('title')).toBeNull();
});
}
});

it('does not have a native title attribute on dots in CompactColorDots', () => {
const { container } = render(
<TooltipProvider>
<CompactColorDots colors={mockColors} />
</TooltipProvider>
</TooltipProvider>,
);

// CompactColorDots renders spans that act as triggers
const dots = container.querySelectorAll('span');
dots.forEach(dot => {
for (const dot of Array.from(dots)) {
// Check if it's one of our color dots (they have a background color set)
if (dot.style.backgroundColor) {
expect(dot.getAttribute('title')).toBeNull();
}
});
}
});
});
Loading
Loading