Repository navigation
fix(web): hide criteria with no scored product; no screen row for earbuds - #1554
Conversation
…buds #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 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 9 minutes. View limit details
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. |
Closes #1553
Problem
No published product has a criterion score yet (#1143). On the leaderboard:
What changes
LeaderboardExplorer.tsx):?criterion=URL for an unscored criterion opens on the combined score, the same way?cat=earbuds&criterion=screenalready does.JReviewsSection.tsx,smartphones/[slug]/page.tsx):leaderboardCriteriaForCategory), so earbuds have no screen row.Tests
e2e/selector-state.spec.ts:/leaderboard?cat=smartphones&criterion=camerathe criterion group has only its 3 overall buttons, "Điểm tổng hợp" is pressed, and the persona group and weight button are absent.pnpm test,tscandeslintpass locally. E2E runs in CI, because Docker is not available here.🤖 Generated with Claude Code
📌 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 misleading data. It also updates localization strings to remove hardcoded "5 criteria" references and passes category context to the review section for consistent filtering.
🎯 Type of Change
🔍 Changes Walkthrough
apps/web/e2e/selector-state.spec.tsapps/web/locales/cs.jsoncriteriaMatrixHeadingto remove the hardcoded "5" count, making it generic ("Scores by experience criterion").apps/web/locales/en.jsoncriteriaMatrixHeadingto remove the hardcoded "5" count.apps/web/locales/vi.jsoncriteriaMatrixHeadingto remove the hardcoded "5" count.apps/web/src/app/[locale]/smartphones/[slug]/page.tsxisCanonicalCategorySlugand passed the validatedcategorySlugtoJReviewsSectionto enable category-specific filtering.apps/web/src/components/leaderboard/LeaderboardExplorer.tsxscoredCriteriamemo to filter criteria based on actual product scores. Conditionally rendered persona presets, weight sliders, and mini-criteria bars only whenhasScoredCriteriais true. Updated URL parameter handling to fallback to 'combined' if a specific criterion has no scores.apps/web/src/components/reviews/JReviewsSection.tsxcategorySlugprop. CreatedshownCriteriaMetamemo to filter criteria based on the category. Updated rendering logic for criteria averages and individual review criteria chips to use the filtered list.📊 Architectural Flow
flowchart TD A[LeaderboardExplorer / JReviewsSection] --> B{Is Category Valid?} B -->|Yes| C[Compute Scored Criteria] C --> D{Do Products Have Scores for Criteria?} D -->|Yes| E[Render Tabs, Personas, Sliders, Bars] D -->|No| F[Hide Tabs, Personas, Sliders, Bars] F --> G[Show Combined Score Only] E --> H[Render UI Elements] G --> H