-
Notifications
You must be signed in to change notification settings - Fork 0
Lovable sync 1780254909 #547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
fa7c094
Changes
lovable-dev[bot] d17c197
Fast Visual Edit
lovable-dev[bot] b9376f9
Changes
lovable-dev[bot] 90b1060
Changes
lovable-dev[bot] b32d60b
Changes
lovable-dev[bot] 3fed361
Changes
lovable-dev[bot] a77ca09
Fast Visual Edit
lovable-dev[bot] f5f0f89
Changes
lovable-dev[bot] dcbf435
Changes
lovable-dev[bot] 4c8608a
Changes
lovable-dev[bot] a8038e1
Changes
lovable-dev[bot] 2cf806b
Changes
lovable-dev[bot] 5fd957f
Fast Visual Edit
lovable-dev[bot] 38eb7db
Changes
lovable-dev[bot] 1ed69b4
Removed Supabase connection card
lovable-dev[bot] 32b0329
Changes
lovable-dev[bot] 53eda28
Adicionou tabelas à whitelist REST
lovable-dev[bot] c992897
Changes
lovable-dev[bot] abc7d10
Fast Visual Edit
lovable-dev[bot] 25e6500
Changes
lovable-dev[bot] 43af9e3
Changes
lovable-dev[bot] f393ff1
Changes
lovable-dev[bot] 49ba02b
Fast Visual Edit
lovable-dev[bot] 1537ed9
Changes
lovable-dev[bot] 7b59578
Fast Visual Edit
lovable-dev[bot] 1016868
Merge remote-tracking branch 'origin/main' into resolve-pr-547
claude 5eeeefa
feat(novidades): upgrade page header to responsive design from PR #547
claude 6ff2c25
fix: resolve ESLint violations blocking PR #547 merge
claude 44cddb6
Merge remote-tracking branch 'origin/main' into resolve-pr-547
claude 253b68e
fix: resolve ESLint violations in test files introduced by upstream m…
claude 3aa4263
fix: resolve TS2322 in GalleryTitleAudit and update tsc baseline
claude 376ae7e
fix: remove duplicate pagination from refetch overlay in NoveltyProdu…
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 41 additions & 27 deletions
68
src/components/products/__tests__/GalleryTitleAudit.test.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
| }); | ||
| }); | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This newly added baseline block allowlists TypeScript errors that are not present in the current checkout: I ran
npm run typecheckandscripts/check-tsc-baseline.mjsreportedatual: 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 inuseAllowedIPs.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 👍 / 👎.
There was a problem hiding this comment.
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.mjson the current HEAD (376ae7ea) produces:The 96 errors are real and present — confirmed by running
tsc -p tsconfig.app.json --noEmitdirectly:src/hooks/intelligence/useSalesGoals.tssrc/hooks/simulation/useTechniquePricing.tssrc/hooks/simulation/usePrintAreas.tssrc/hooks/admin/useAllowedIPs.tssrc/hooks/simulation/useSimulation.tsThese errors are pre-existing in
main(Supabase query type inference failures from tables not in the generated types). The baseline was regenerated withnode scripts/tsc-baseline-generate.mjson the current HEAD to reflect them accurately — no phantom entries. Future regressions in those files will still be caught.Generated by Claude Code