Skip to content

fix: unsafe props ternary#3254

Merged
ommeirelles merged 2 commits intomainfrom
fix/product-gallery
Apr 9, 2026
Merged

fix: unsafe props ternary#3254
ommeirelles merged 2 commits intomainfrom
fix/product-gallery

Conversation

@ommeirelles
Copy link
Copy Markdown
Contributor

@ommeirelles ommeirelles commented Mar 31, 2026

Fixing props wrong validation overwriting default value as false when expected should be a function.

image

Summary by CodeRabbit

  • Bug Fixes
    • Fixed product gallery page prop handling to ensure consistent behavior across all scenarios.

@ommeirelles ommeirelles requested a review from a team as a code owner March 31, 2026 14:20
@ommeirelles ommeirelles requested review from eduardoformiga and lariciamota and removed request for a team March 31, 2026 14:20
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 31, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • README.md is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2f828f67-658a-4f25-894e-874814cd65da

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The ProductGalleryPage component now explicitly normalizes the buildExtraProductProps prop passed to ProductGrid, using a conditional ternary operator to return undefined when searchId is falsy instead of relying on logical AND short-circuiting.

Changes

Cohort / File(s) Summary
ProductGalleryPage Prop Logic
packages/core/src/components/ui/ProductGallery/ProductGalleryPage.tsx
Changed buildExtraProductProps prop passing from logical AND (searchId && buildExtraProductProps) to explicit ternary conditional, ensuring falsy cases normalize to undefined rather than potentially falsy non-undefined values.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

Undefined at last! 🎯
No more fuzzy truthiness here,
When falsy, stay clear—
Explicit beats implicit's blur ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: unsafe props ternary' directly relates to the main change, which fixes a ternary expression passing unsafe props to ProductGrid.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/product-gallery

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 and usage tips.

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Apr 9, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@ommeirelles ommeirelles merged commit 00f35b5 into main Apr 9, 2026
7 of 8 checks passed
@ommeirelles ommeirelles deleted the fix/product-gallery branch April 9, 2026 18:52
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