Skip to content

docs: add RecommendationShelf section usage guide - #3413

Closed
thiagopereira-vtex wants to merge 1 commit into
devfrom
docs/recommendation-shelf-readme
Closed

thiagopereira-vtex wants to merge 1 commit into
devfrom
docs/recommendation-shelf-readme

Conversation

@thiagopereira-vtex

@thiagopereira-vtex thiagopereira-vtex commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds a README for the RecommendationShelf section documenting how to enable, configure, and use it.
  • Covers prerequisites (the experimental.enableRecommendations flag 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

  • Documentation only — no code changes.
  • Tone and structure follow the existing package READMEs (e.g. packages/components, packages/storybook).

Test plan

  • Review the rendered Markdown for accuracy and formatting.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guidance for configuring and using the Recommendation Shelf CMS component.
    • Documented campaign setup, product context requirements, carousel options, and product card customization.
    • Added details on rendering behavior, tracking, privacy, caching, recommended placements, and troubleshooting.

@thiagopereira-vtex
thiagopereira-vtex requested a review from a team as a code owner July 15, 2026 14:35
@thiagopereira-vtex
thiagopereira-vtex requested review from emersonlaurentino and lemagnetic and removed request for a team July 15, 2026 14:35
@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Changes

RecommendationShelf documentation

Layer / File(s) Summary
Enablement and CMS schema
packages/core/src/components/sections/RecommendationShelf/README.md
Documents the experimental flag, campaign VRN requirements, Activity Flow prerequisites, CMS properties, campaign classifications, and context behavior.
Recommendation lifecycle and customization
packages/core/src/components/sections/RecommendationShelf/README.md
Describes session initialization, user and argument resolution, query rendering states, tracking attributes, and manual component overrides.
Placement, privacy, and troubleshooting
packages/core/src/components/sections/RecommendationShelf/README.md
Adds placement guidance, default-disabled behavior, caching and cookie details, and troubleshooting steps for rendering and tracking. בא

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

  • vtex/faststore#3403: Introduces the RecommendationShelf implementation documented by this README.

Suggested labels: contributing

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the documentation-only addition of a RecommendationShelf usage guide.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/recommendation-shelf-readme

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.

@codesandbox-ci

Copy link
Copy Markdown

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between e0e8188 and 6c58cb8.

📒 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`):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀 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`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ 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.

@sonar-workflows

Copy link
Copy Markdown

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.

1 participant