Enable product rating in snippet preview #2781#22954
Conversation
#2781 Update Snippet Preview according to the Google structured data guidelines for AggregateRating / Rating
Pull Request Test Coverage Report for Build 06e77cb348a7904a627c684d26e5c9a92c8ac8b9Details
💛 - Coveralls |
#2781 Removed unused import.
…rating-in-snippet-preview
There was a problem hiding this comment.
Pull request overview
Updates the Snippet Preview product rich-result UI to comply with Google structured data guidelines for AggregateRating / Rating by introducing bestRating and adjusting the rating display and star scaling.
Changes:
- Added a shared
DEFAULT_BEST_RATINGconstant and plumbedbestRatingthrough snippet preview shopping data. - Updated mobile/desktop product data rendering to optionally display
rating/bestRatingand scale stars to a 5-star component. - Extended Redux shoppingData reducer and updated SnippetEditor tests to include
bestRating.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/search-metadata-previews/src/snippet-preview/constants.js | Introduces DEFAULT_BEST_RATING for consistent rating normalization. |
| packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js | Ensures bestRating is always present in the constructed shoppingData passed to subcomponents. |
| packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js | Updates rating rendering rules, scaling, and display formatting on mobile. |
| packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js | Updates rating rendering rules, scaling, and display formatting on desktop. |
| packages/js/tests/containers/SnippetEditor.test.js | Updates test fixtures to include bestRating. |
| packages/js/src/redux/reducers/shoppingData.js | Persists bestRating in Redux shopping data state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js
Outdated
Show resolved
Hide resolved
packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js
Outdated
Show resolved
Hide resolved
packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js
Show resolved
Hide resolved
packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js
Outdated
Show resolved
Hide resolved
packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js
Outdated
Show resolved
Hide resolved
packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js
Outdated
Show resolved
Hide resolved
packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js
Outdated
Show resolved
Hide resolved
packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js
Outdated
Show resolved
Hide resolved
packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js
Outdated
Show resolved
Hide resolved
packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js
Outdated
Show resolved
Hide resolved
konradyoast
left a comment
There was a problem hiding this comment.
LGTM, but please check copilot comments @mykola 🟢
…ataMobile.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…rating-in-snippet-preview
#2781 Fix comments Unit tests implemented.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js
Show resolved
Hide resolved
packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js
Outdated
Show resolved
Hide resolved
konradyoast
left a comment
There was a problem hiding this comment.
thanks for changes, lgtm !
…rating-in-snippet-preview
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js
Outdated
Show resolved
Hide resolved
#2781 Fix copilot comments.
…rating-in-snippet-preview
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js
Show resolved
Hide resolved
#2781 Fix changelog
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…rating-in-snippet-preview
d-claassen
left a comment
There was a problem hiding this comment.
✅ CR done and tested.
Context
bestRatingvalue and its visual representation in line with the visual presention in Google SERPs.Summary
This PR can be summarized in the following changelog entry:
bestRatingvalue on theshoppingDatainput.Relevant technical choices:
Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
aggregateRating:{rating} {5 stars} {#amount of reviews}Relevant test scenarios
Test instructions for QA when the code is in the RC
QA can test this PR by following these steps:
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.[yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached theGoogle Docs Add-onlabel to this PR.Documentation
Quality assurance
grunt build:imagesand commited the results, if my PR introduces new images or SVGs.Innovation
innovationlabel.Fixes #2781