Repository navigation
Closed
Copy link
Labels
agent:webClaimed by Agent: WebClaimed by Agent: Webarea:sharedShared packages / contracts / configsShared packages / contracts / configsarea:webfeatureNew feature or enhancementNew feature or enhancementpo:antigravityDispatched by the Antigravity Product OwnerDispatched by the Antigravity Product Ownerstatus:in-reviewTask completed and waiting for review / PR mergeTask completed and waiting for review / PR merge
Description
Goal
Implement Package 8A Feature F2 (approved by JOY on 2026-11-22 from Docs/Proposals/2026-11-22-de-xuat-tinh-nang-moi-phase-8.html): add RTINGS-inspired 1-click Use-Case Presets and custom 0% - 100% criterion weight sliders across /leaderboard, /compare, and /compare/[versus] using our existing per-category RATING_CRITERIA and criteria_scores with zero database migrations.
Requirements
- Category Use-Case Presets & Normalized Custom Weight Math (
packages/shared-data/src/rules/rating-criteria.ts+apps/web/src/lib/use-case-weights.ts):- Define curated, category-specific 1-click presets for all 5 categories (
smartphones,tablets,laptops,smartwatches,earbuds), e.g. Balanced Default, Gaming & Battery, Camera & Creator, Office & Portability, ANC & Commute, Value-First, etc. - Support custom
0..100integer slider weights per criterion that normalize cleanly to100%(gracefully handling all-zero reset to Balanced Default and missing/unrated criteria without inventing scores). - Design rule
#1531 D3/D9: Always keep the officialRate.vn Scorevisible alongsideYour Custom Score(labeled clearly when custom weights or a non-default preset are active) so users never confuse official and personalized scores.
- Define curated, category-specific 1-click presets for all 5 categories (
- Interactive UI & Shareable Query State (
UseCaseWeightBar.tsx,LeaderboardExplorer.tsx,CompareWorkspace.tsx,VersusInteractiveScoreboard.tsx):- Render an accessible (
aria-pressed, keyboard-friendly<input type="range">with visible percentage labels and reset button) preset + weight customization bar on/leaderboard,/compare, and/compare/[versus]. - Re-rank / recompute custom winner & deltas instantaneously on client state and encode non-default presets/weights cleanly in URL query params (
?preset=...or?weights=...) while keepingrel="canonical"pointing to the base route so SEO indexation stays clean.
- Render an accessible (
- Localization (
vi,en,cs):- Localize all preset names, slider labels, and custom-score explanations in
apps/web/locales/{vi,en,cs}.jsonstrictly under namespaces"compare"and"leaderboard".
- Localize all preset names, slider labels, and custom-score explanations in
Approach
Add category preset metadata in rating-criteria.ts + pure weight/URL serialization helpers in apps/web/src/lib/use-case-weights.ts, create UseCaseWeightBar.tsx, integrate into LeaderboardExplorer.tsx, CompareWorkspace.tsx, and VersusInteractiveScoreboard.tsx, and add unit tests in apps/web/src/lib/__tests__/leaderboard-criteria.test.ts and compare-params.test.ts.
Acceptance
- Selecting a preset or dragging criterion sliders updates custom scores and winner ordering immediately on
/leaderboard,/compare, and/compare/[versus]. - Official
Rate.vn Scoreremains clearly visible and unchanged; missing criterion scores are never fabricated. - Shareable query params (
?preset=.../?weights=...) restore state on reload without alteringrel="canonical", and reject malformed/prototype query keys safely. - Full
vi,en,csi18n parity, WCAG 2.1 AA contrast & keyboard accessibility, and green monorepo CI + Playwright E2E.
Files
packages/shared-data/src/rules/rating-criteria.tsapps/web/src/lib/use-case-weights.tsapps/web/src/components/compare/UseCaseWeightBar.tsxapps/web/src/components/leaderboard/LeaderboardExplorer.tsxapps/web/src/components/compare/CompareWorkspace.tsxapps/web/src/components/compare/VersusInteractiveScoreboard.tsxapps/web/locales/{vi,en,cs}.json("compare"and"leaderboard"namespaces only)apps/web/src/lib/__tests__/leaderboard-criteria.test.tsapps/web/src/lib/__tests__/compare-params.test.ts
Metadata
Metadata
Assignees
Labels
agent:webClaimed by Agent: WebClaimed by Agent: Webarea:sharedShared packages / contracts / configsShared packages / contracts / configsarea:webfeatureNew feature or enhancementNew feature or enhancementpo:antigravityDispatched by the Antigravity Product OwnerDispatched by the Antigravity Product Ownerstatus:in-reviewTask completed and waiting for review / PR mergeTask completed and waiting for review / PR merge
Activity
JOY commentedon Nov 22, 2026
🔒 [Agent: Web] Claim lock
refs/claims/1864taken by claimantantigravity:98e4f4c6-a524-4fe3-9d35-6247893a8d4e(Status: in-progress).JOY commentedon Nov 22, 2026
[Agent: Web] Claimed this issue (Status: Ready -> In Progress) on branch
feat/1864-rtings-use-case-weights(Claimant:antigravity:98e4f4c6-a524-4fe3-9d35-6247893a8d4e).JOY commentedon Nov 22, 2026
🤖 [Agent: Web] Opened PR #1867 (
feat/1864-rtings-use-case-weights->dev, commitefd14bb7) implementing RTINGS-style category use-case presets, normalized0..100slider weights, and?preset=/?weights=URL sync across/leaderboard,/compare, and/compare/[versus]. Running the 2-reviewer fresh-context gate and CI checks now.fix(web): harden use-case weight math, a11y contrast, and exports
feat(web): add RTINGS-style use-case presets and weight sliders (#1867)
JOY commentedon Nov 22, 2026
🤖 [Agent: Web] Merged PR #1867 into
dev(bb89681e44cf950347d940d79c338ff31e92da4d). Keepingstatus:in-reviewuntil Package 8A is promoted tomainand verified live.