Repository navigation
docs: add RecommendationShelf section usage guide - #3413
thiagopereira-vtex wants to merge 1 commit into
Conversation
WalkthroughChangesRecommendationShelf documentation
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
|
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. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/core/src/components/sections/RecommendationShelf/README.md`:
- Line 48: Update the schema reference in the RecommendationShelf README to use
the exact repository path and filename casing:
packages/core/cms/faststore/components/cms_component__recommendationshelf.jsonc.
- Line 121: Update the RecommendationShelf README text to describe vrn.ts and
VRN_TYPE_TO_RECOMMENDATION as the runtime source of truth, while explicitly
noting that the CMS schema pattern separately hardcodes supported VRN types and
must be kept synchronized when campaign types change.
- Line 89: Update the documentation near the recommendation hooks description to
state that the client-side flow does not affect SSR or TTFB, and remove the
absolute claim that it has no Lighthouse impact. Avoid implying Lighthouse
metrics are unaffected.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f791255d-48ae-4004-9a57-590eecb8d52d
📒 Files selected for processing (1)
packages/core/src/components/sections/RecommendationShelf/README.md
|
|
||
| ## CMS configuration | ||
|
|
||
| The following properties are exposed by the schema (`cms/faststore/components/cms_component__RecommendationShelf.jsonc`): |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Correct the schema path and filename casing.
The README references cms/faststore/components/cms_component__RecommendationShelf.jsonc, but the supplied schema is packages/core/cms/faststore/components/cms_component__recommendationshelf.jsonc. Please use the exact repository path so readers can locate the schema.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/core/src/components/sections/RecommendationShelf/README.md` at line
48, Update the schema reference in the RecommendationShelf README to use the
exact repository path and filename casing:
packages/core/cms/faststore/components/cms_component__recommendationshelf.jsonc.
|
|
||
| ## How it works | ||
|
|
||
| The entire flow runs on the client, after hydration, so it does not affect SSR, TTFB, or Lighthouse metrics. |
There was a problem hiding this comment.
🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win
Narrow the Lighthouse performance claim.
The hooks defer recommendation work until the client, supporting no SSR/TTFB impact; that does not guarantee zero Lighthouse impact. Client-side rendering and query work can still affect metrics such as LCP or INP, especially when the shelf is above the fold. Rewrite this as “does not affect SSR or TTFB” and avoid the absolute Lighthouse claim.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/core/src/components/sections/RecommendationShelf/README.md` at line
89, Update the documentation near the recommendation hooks description to state
that the client-side flow does not affect SSR or TTFB, and remove the absolute
claim that it has no Lighthouse impact. Avoid implying Lighthouse metrics are
unaffected.
| - `ProductCard`: a custom card component. Defaults to the core `ProductCard`. | ||
| - `mapProductToProductCard`: maps each product (a normalized `StoreProduct`, identical to the search shape) to the card props. When provided, it is fully responsible for the card props, and the default `productCardConfiguration` merge no longer applies. | ||
|
|
||
| The campaign types and VRN validation have a single source of truth in `vrn.ts` (`VRN_TYPE_TO_RECOMMENDATION`). Adding or changing campaign types must be done there and reflected in the CMS schema `pattern`. |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Clarify the two synchronized VRN sources.
vrn.ts centralizes the runtime mapping, but the CMS schema separately hardcodes the supported VRN types in its validation pattern. Calling vrn.ts the single source of truth while requiring a manual schema update may cause future drift. Describe it as the runtime source of truth and explicitly state that the CMS schema pattern must stay synchronized.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/core/src/components/sections/RecommendationShelf/README.md` at line
121, Update the RecommendationShelf README text to describe vrn.ts and
VRN_TYPE_TO_RECOMMENDATION as the runtime source of truth, while explicitly
noting that the CMS schema pattern separately hardcodes supported VRN types and
must be kept synchronized when campaign types change.
|

0 New Issues
0 Fixed Issues
0 Accepted Issues
No data about coverage (27.30% Estimated after merge)
Summary
RecommendationShelfsection documenting how to enable, configure, and use it.experimental.enableRecommendationsflag and an active VTEX Recommendations campaign/VRN), CMS configuration, campaign types and product context, the client-side flow, code-level customization, placement recommendations, privacy/caching, and troubleshooting.Notes
packages/components,packages/storybook).Test plan
Summary by CodeRabbit