Skip to content

fix(mockup-generator): T1-T10 auditoria exaustiva — rebased s/ HEAD (substitui #478)#484

Merged
adm01-debug merged 1 commit into
mainfrom
rebase/478-mockup
May 26, 2026
Merged

fix(mockup-generator): T1-T10 auditoria exaustiva — rebased s/ HEAD (substitui #478)#484
adm01-debug merged 1 commit into
mainfrom
rebase/478-mockup

Conversation

@adm01-debug
Copy link
Copy Markdown
Owner

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

Substitui PR #478 (conflito resolvido — rebased sobre HEAD atual)

T1 — 7 handlers em useCallback com deps corretas → useMemo estável, sem re-renders extras
T2 — Closures staladas em async handlers → deps explícitas
T3 — 2 memory leaks: historyPushTimeout + draftNoticeTimeoutRef com clearTimeout no unmount
T4position_x/y, logo_url, logo_width_cm, logo_height_cm adicionados ao INSERT top-level
T5 — Batch saves sequenciais → Promise.allSettled (3× mais rápido)
T6deleteMockupFromDb sem userId → filtro de owner adicionado (segurança)
T7getTechniquePrompt: if (key === 'default') continue no loop
T8fetchMockupHistory: .limit(200) adicionado
T9replaceState preserva outros query params (remove só product_id e technique)
T10thumbnail_url = mockupUrl (era logoUrl, incorreto)

ESLint: 0 errors. Prettier: limpo.


Summary by cubic

Audited and fixed the mockup generator (T1–T10) for stability, correctness, and speed. Also updates skeleton tests to use the new data attribute selector.

  • Bug Fixes

    • Secured delete by filtering by owner.
    • Fixed two timeout leaks with proper cleanup on unmount.
    • Corrected DB saves: added position_x/y, logo_url, logo_width_cm, logo_height_cm; fixed thumbnail to use mockup URL; skip 'default' key in technique prompt.
    • History/URL: removed duplicate initial fetch, limited history to 200, and preserved other query params when updating the URL.
    • Tests: use [data-skeleton-id] instead of shimmer class; excluded test files from the skeleton integrity scan.
  • Performance

    • Parallelized batch DB saves with Promise.allSettled (3× faster).
    • Stabilized handlers with useCallback to avoid unnecessary re-renders.
    • Debounced autosave (1s) and position updates (300ms) for smoother UI.

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

…D main

Incorpora PR #478 (fix/mockup-generator-audit-10tasks) sobre HEAD atual do main.

T1 — useMemo ineficaz: 7 handlers → useCallback com deps corretas
T2 — Closures staladas: deps explícitas em cada useCallback async
T3 — 2 memory leaks: historyPushTimeout + draftNoticeTimeoutRef com cleanup
T4 — position_x/y, logo_url, logo_width/height_cm adicionados ao INSERT top-level
T5 — Batch saves sequenciais → Promise.allSettled (escrita paralela)
T6 — deleteMockupFromDb sem userId → filtro de owner adicionado
T7 — getTechniquePrompt: skip key 'default' no loop
T8 — fetchMockupHistory: .limit(200)
T9 — window.history.replaceState: preserva outros query params
T10 — thumbnail_url = mockupUrl (era logoUrl incorretamente)

Co-authored-by: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 26, 2026 21:23
@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.

@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 9:23pm

@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 ↗︎.

@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 21 minutes and 34 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: f01756dd-2eb1-492e-9cbb-198cd67ea6dd

📥 Commits

Reviewing files that changed from the base of the PR and between db1fa3c and 8c7308c.

📒 Files selected for processing (4)
  • src/components/products/ProductGrid.test.tsx
  • src/hooks/mockup/mockupGenerationService.ts
  • src/hooks/mockup/useMockupGenerator.ts
  • src/tests/skeleton-integrity.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rebase/478-mockup

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

@adm01-debug adm01-debug merged commit d6d4600 into main May 26, 2026
38 of 45 checks passed
@adm01-debug adm01-debug deleted the rebase/478-mockup branch May 26, 2026 21:24
@adm01-debug adm01-debug review requested due to automatic review settings May 26, 2026 21:50
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.

1 participant