Repository navigation
Conversation
…on (#1557) * fix(web): versus and deals offer a persona only with a scored criterion #1556: with no criterion scores yet, every persona on versus and deals ranked exactly like the default while still being offered, and the verdict named the persona's weights. - Versus shows a use-case preset only when both models have a real score for the criterion it weighs most; with no criterion scored on both sides, the presets and the custom weights are not shown, and the sliders list only the criteria both sides have. - Deals shows a persona only when some product in the category has a real score for its criterion; with only the default left the pills are hidden and the ranking uses the default. - Scoring already skipped null criteria (#1143); no new text. Closes #1556 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 implements a conditional rendering logic for persona presets and custom weight sliders in the "Deals" and "Versus" views, ensuring these controls are only displayed when at least one product has a valid score for the corresponding criteria. This prevents users from selecting personas that would produce identical rankings to the default, improving UI clarity and accessibility.
🎯 Type of Change
🔍 Changes Walkthrough
apps/web/src/components/compare/VersusInteractiveScoreboard.tsxversusAvailablePersonashelper to filter presets based on shared scored criteria. Updated the component to conditionally render persona pills and weight sliders only whencanWeighis true, falling back to default weights otherwise.apps/web/src/components/deals/DealFinderWorkspace.tsxavailableDealPersonashelper to determine which personas are relevant based on product scores in the current category. Updated the UI to hide the persona pill group entirely if only the default persona is available, and to fall back to default ranking if the selected persona is unavailable.apps/web/src/server/rate/__tests__/core-rate-architecture.test.tsavailableDealPersonasandversusAvailablePersonascorrectly filter personas based on the presence of criterion scores.apps/web/e2e/pill-group-state.spec.tsapps/web/e2e/light-theme-controls.spec.tsapps/web/e2e/deals-paging.spec.ts📊 Architectural Flow
flowchart TD A[Product Data] --> B{Has Criterion Scores?} B -- No --> C[availablePersonas = ['default']] B -- Yes --> D[Filter Personas by Scored Criteria] C --> E[UI: Hide Persona Pills & Sliders] D --> F[UI: Show Available Persona Pills] E --> G[Ranking: Use Default Weights] F --> H{User Selects Persona?} H -- Yes --> I[Ranking: Use Selected Persona Weights] H -- No/Invalid --> G