Repository navigation
Make product badge optional and refine UI - #21
Conversation
Remove the implicit "Destaque" fallback for product badges across normalizers, repository, CSV import, provider and seed data so badges are optional by default. Add a Supabase migration to set products.badge default to an empty string and update existing rows. Update product page rendering to only show the badge when present (or when product is unavailable). Also tweak product card styles: background gradient, centered/contained images, padding, rounded borders and subtle scale/transition adjustments for improved visuals.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Makes product “badge” optional throughout the catalog pipeline and refines some product UI styling, removing the previous implicit "Destaque" fallback behavior.
Changes:
- Removes
"Destaque"badge fallbacks across CSV import, normalizers, repository snapshot building, provider normalization, and seed/base catalog data. - Adds a Supabase migration to change
products.badgedefault to an empty string and updates existing rows. - Updates product page to only render the badge when it exists (or when the product is unavailable) and tweaks product card media styles (gradient, contain/center images, padding, borders, scaling).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| supabase/migrations/20260328_000003_product_badge_optional.sql | Changes DB default for products.badge and attempts to normalize existing rows. |
| lib/products-csv-import.js | Stops defaulting imported badges to "Destaque"; imports empty when missing. |
| lib/catalog-repository.js | Removes badge fallback in payload normalization and snapshot mapping. |
| lib/catalog-normalizer.js | Removes badge fallback during catalog sanitization and input normalization. |
| components/providers/catalog-provider.js | Removes badge fallback when normalizing provider products. |
| lib/catalog-data.js | Removes badges from base in-memory seed products. |
| data/catalog-seed.json | Removes badges from JSON seed catalog entries. |
| app/produto/[id]/page.js | Renders gallery badge only if unavailable or badge is non-empty. |
| app/globals.css | Refines product card media presentation and hover scaling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| update public.products | ||
| set badge = '' | ||
| where badge is distinct from ''; |
There was a problem hiding this comment.
The UPDATE condition where badge is distinct from '' will match every row whose badge is not already an empty string (including non-empty badges), so this migration will wipe all existing badge values. If the intent is only to remove the previous implicit default (e.g., convert NULLs and/or the old default value 'Destaque' to empty), restrict the WHERE clause accordingly (e.g., where badge is null or badge = 'Destaque').
| where badge is distinct from ''; | |
| where badge is null; |
Remove the implicit "Destaque" fallback for product badges across normalizers, repository, CSV import, provider and seed data so badges are optional by default. Add a Supabase migration to set products.badge default to an empty string and update existing rows. Update product page rendering to only show the badge when present (or when product is unavailable). Also tweak product card styles: background gradient, centered/contained images, padding, rounded borders and subtle scale/transition adjustments for improved visuals.