Repository navigation
Conversation
…buds (#1554) * fix(web): hide criteria with no scored product; no screen row for earbuds #1553: no published product has a criterion score yet, so every criterion tab and persona emptied the leaderboard with no word why. - The leaderboard shows a criterion tab, weight slider, row cell and podium bar only for a criterion that some product in the category has a real score for; with none, the persona presets and sliders are hidden and a criterion URL opens on the combined score. - The product page's review score block and each review's criterion chips use the category's criteria: no screen row for earbuds. The heading drops its fixed "5". The review form is unchanged. Closes #1553 * fix(web): an unscored criterion falls back before paint and in the url Review of #1554: the fallback to the combined tab ran after paint, so an empty list flashed, and the URL kept the unscored criterion after a category switch. It now runs as a layout effect and rewrites the URL. Refs #1553 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Promote dev to main.
Merge with a merge commit, never squash (Docs/Resources/RELEASE.md).
📌 TL;DR
This PR refines the leaderboard and product review UI to dynamically hide criteria, personas, and weight sliders when no products in the current category have valid scores for them, preventing empty states and ensuring URL consistency. It also updates localization strings to remove hardcoded references to "5" criteria.
🎯 Type of Change
🔍 Changes Walkthrough
apps/web/e2e/selector-state.spec.tscriterion=combinedwhen a specific criterion has no data.apps/web/locales/cs.jsoncriteriaMatrixHeadingto remove the hardcoded number "5".apps/web/locales/en.jsoncriteriaMatrixHeadingto remove the hardcoded number "5".apps/web/locales/vi.jsoncriteriaMatrixHeadingto remove the hardcoded number "5".apps/web/src/app/[locale]/smartphones/[slug]/page.tsxcategorySlugtoJReviewsSectionto enable category-specific filtering of criteria.apps/web/src/components/leaderboard/LeaderboardExplorer.tsxscoredCriteriamemo to filter criteria based on actual product scores. AddeduseLayoutEffectto redirect URL tocombinedif the requested criterion has no data. Conditionally rendered persona/weight slider sections and criteria bars only whenhasScoredCriteriais true.apps/web/src/components/reviews/JReviewsSection.tsxcategorySlugprop. CreatedshownCriteriaMetamemo to filter criteria based on the category. Updated rendering logic to useshownCriteriaMetainstead of the fullcriteriaMetalist.📊 Architectural Flow
flowchart TD A[LeaderboardExplorer Mount] --> B{Calculate scoredCriteria} B -->|No products have scores| C[hasScoredCriteria = false] B -->|Products have scores| D[hasScoredCriteria = true] C --> E[Hide Persona/Weight UI] C --> F[Hide Criteria Bars] C --> G[Redirect URL to criterion=combined] D --> H[Show Persona/Weight UI] D --> I[Show Criteria Bars] J[Product Detail Page] --> K[Pass categorySlug to JReviewsSection] K --> L{Filter criteriaMeta by category} L --> M[Render only relevant criteria]