Skip to content

updated Product Sizes#6

Merged
benazeem merged 1 commit into
mainfrom
feat/shadcn-form-primitives-and-Product-data-update
Jul 7, 2026
Merged

updated Product Sizes#6
benazeem merged 1 commit into
mainfrom
feat/shadcn-form-primitives-and-Product-data-update

Conversation

@benazeem

@benazeem benazeem commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Bug Fixes
    • Improved the size guide so only relevant attar sizes appear, preventing unsupported sizes from showing up in the card list.
    • Updated product size selection to better match category-specific options, falling back to default sizes only when needed.
    • Refined the size guide content to show the correct attar-specific details and description.

Copilot AI review requested due to automatic review settings July 7, 2026 10:20
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ms-signature Ready Ready Preview, Comment Jul 7, 2026 10:20am

@benazeem
benazeem merged commit 2488caf into main Jul 7, 2026
3 of 4 checks passed
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 39df2df9-500c-4749-b0ab-ec8c1179b7bb

📥 Commits

Reviewing files that changed from the base of the PR and between 5650352 and db7293e.

📒 Files selected for processing (2)
  • app/size-guide/page.tsx
  • lib/utils.ts

📝 Walkthrough

Walkthrough

Changes 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.

Changes

Attar Size Filtering

Layer / File(s) Summary
Allowed sizes utility filtering
lib/utils.ts
getAllowedProductSizes filters provided sizes against category-specific allowed values (attar: 6ml/12ml, others: 30ml), falling back to defaults if no matches.
Size guide page filtering and card refactor
app/size-guide/page.tsx
Adds allowedAttarSizes set and updated metadata description, refactors buildCard to a switch on size.value, and skips sizes not in allowedAttarSizes in buildGuideCards.

Estimated code review effort: 2 (Simple) | ~10 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/shadcn-form-primitives-and-Product-data-update

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.

❤️ Share

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread app/size-guide/page.tsx
Comment on lines 136 to +141
for (const product of categoryProducts) {
for (const size of product.sizes ?? []) {
if (!allowedAttarSizes.has(size.value)) {
continue;
}

Comment thread app/size-guide/page.tsx
Comment on lines 72 to 76
function buildCard(
category: "attar" | "perfume",
size: { label: string; value: string; price: number },
basePrice: number,
): GuideCard {
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.

2 participants