updated Product Sizes#6
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChanges restrict which product sizes are considered valid for the "attar" category (6ml, 12ml) versus other categories (30ml), applied both in a shared utility function and in the size-guide page's card-building logic, alongside a refactor of card content selection and updated metadata text. ChangesAttar Size Filtering
Estimated code review effort: 2 (Simple) | ~10 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR narrows the set of supported product size variants to align UI behavior with the current catalog (attar: 6ml/12ml, perfume: 30ml), and updates the size guide logic/content accordingly.
Changes:
- Adds category-based allowlist filtering in
getAllowedProductSizes()so only supported size values are surfaced. - Refactors size-guide card generation to use a size-value switch and introduces an attar size allowlist for the guide.
- Updates size-guide metadata copy to emphasize attar sizing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/utils.ts | Filters provided size arrays down to allowed size values per category, with sensible fallbacks when filtered results are empty. |
| app/size-guide/page.tsx | Refactors size guide card-building and adds size filtering (but currently applies the attar allowlist to perfumes too). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for (const product of categoryProducts) { | ||
| for (const size of product.sizes ?? []) { | ||
| if (!allowedAttarSizes.has(size.value)) { | ||
| continue; | ||
| } | ||
|
|
| function buildCard( | ||
| category: "attar" | "perfume", | ||
| size: { label: string; value: string; price: number }, | ||
| basePrice: number, | ||
| ): GuideCard { |
Summary by CodeRabbit