Conversation
… lib/votes One vote metric everywhere: Score = 2·MustGo + Interested − WontGo, computed by the new pure tallyVotes() in src/lib/votes/score.ts (weights from the vote config, which moves to src/lib/votes/config.ts). Replaces the three diverging hand-rolled formulas (SetDetails net score, VoteTab rating/popularity), the rating-desc/popularity-desc sorts (now a single default "Top Score" / score-desc sort), the half-broken Minimum Rating filter, and the useVoteCount hook. Old sort/minRating URLs degrade gracefully via the existing zod .catch. See docs/adr/0010-single-vote-score.md. UPL-13 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LkfRGkbSUEtCTNWyfaPSKF
vote() belongs below the describe block per the repo's file-structure convention, and the group-scoped-subset test used a subset that happened to score the same as the full set, so it couldn't actually catch a scoping bug. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LkfRGkbSUEtCTNWyfaPSKF
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Fix the broken E2E import, add legacy-URL regression coverage, and update stale design-document references.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR centralizes vote scoring and counting through tallyVotes(), replaces legacy ranking with “Top Score,” and updates related consumers.
Changes:
- Added shared scoring/configuration modules and tests.
- Updated voting UIs, badges, filters, URL handling, and documentation.
- Removed Minimum Rating filtering and
useVoteCount.
File summaries
| File | Summary |
|---|---|
src/routes/festivals/$festivalSlug/editions/$editionSlug/sets/$setSlug.tsx |
Uses shared score tallying. |
src/routes/festivals/$festivalSlug/editions/$editionSlug/explore.tsx |
Updates vote config import. |
src/pages/SetDetails/SetVotingButtons.tsx |
Uses centralized vote counts. |
src/pages/SetDetails/SetInfoCard.tsx |
Renders the shared score. |
src/pages/SetDetails/SetGroupVoting.tsx |
Uses centralized group counts. |
src/pages/SetDetails/NonMusicSetDetail/NonMusicSetDetail.tsx |
Passes the renamed score prop. |
src/pages/SetDetails/NonMusicSetDetail/NonMusicSetBanner.tsx |
Renders the renamed score prop. |
src/pages/SetDetails/MultiArtistSetInfoCard.tsx |
Renders the shared score. |
src/pages/ExploreSetPage/VotingActions.tsx |
Updates vote config import. |
src/pages/ExploreSetPage/VotingActions.test.tsx |
Updates test imports. |
src/pages/EditionView/tabs/VoteTab/useSetFiltering.ts |
Sorts by shared score. |
src/pages/EditionView/tabs/VoteTab/SetCard/SetVotingButtons.tsx |
Uses centralized counts. |
src/pages/EditionView/tabs/VoteTab/filters/SortControls.tsx |
Replaces legacy sort explanations. |
src/pages/EditionView/tabs/VoteTab/filters/MobileFilters.tsx |
Removes Minimum Rating UI. |
src/pages/EditionView/tabs/VoteTab/filters/FilterSortControls.tsx |
Removes rating filter state. |
src/pages/EditionView/tabs/VoteTab/filters/DesktopFilters.tsx |
Removes Minimum Rating UI. |
src/pages/EditionView/tabs/VoteTab/filters/constants.ts |
Defines the Top Score sort. |
src/pages/EditionView/tabs/ScheduleTab/VoteFilterChips.tsx |
Updates vote config import. |
src/pages/EditionView/tabs/ScheduleTab/VoteButtons.tsx |
Uses centralized counts. |
src/pages/EditionView/tabs/ScheduleTab/horizontal/OverviewStageRow.tsx |
Updates vote config import. |
src/lib/votes/score.ts |
Adds the shared tally implementation. |
src/lib/votes/score.test.ts |
Tests tally behavior. |
src/lib/votes/config.ts |
Relocates vote configuration. Critical (3 votes): update the broken E2E import; Nit (1 vote): update stale design-document paths. |
src/lib/votes/config.test.ts |
Updates configuration tests. |
src/lib/searchSchemas.ts |
Updates sort defaults and removes rating state. Moderate (2 votes): add legacy-URL regression coverage. |
src/lib/scheduleFilter.ts |
Updates vote config import. |
src/hooks/useVoteCount.ts |
Removes the obsolete hook. |
src/hooks/useTimelineUrlState.ts |
Updates vote type imports. |
src/components/onboarding/steps/VotingExplanationStep.tsx |
Updates vote config import. |
docs/adr/0010-single-vote-score.md |
Documents the unified score model. |
CONTEXT.md |
Updates domain terminology. |
Review details
- Files reviewed: 30/31 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Playwright test resultsDetails
|
…y-URL test tests/e2e/voting.spec.ts still imported from the old src/lib/voteConfig path, breaking the e2e build (my earlier import sweep only covered src/). Also repoints two design docs at the new path and adds regression coverage for the legacy sort/minRating URL params degrading via the zod .catch. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LkfRGkbSUEtCTNWyfaPSKF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consolidates the three diverging vote-aggregation formulas (mean rating, Won't-Go-blind popularity, and the Set-detail net-score badge) into one pure
tallyVotes()module (src/lib/votes/score.ts), so every caller reads counts and score from one place instead of re-derivingvote_typeliterals. Replaces therating-desc/popularity-descsorts with a single default "Top Score" (score-desc) sort, drops the (mathematically unreachable) Minimum Rating filter, and deletesuseVoteCount.UPL-13
Verification
sort=rating-desc,sort=popularity-desc, orminRating=2; the page loads with the new default sort instead of erroring.pnpm test(664 tests) andpnpm run typecheckpass;pnpm run lintis clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01LkfRGkbSUEtCTNWyfaPSKF
Generated by Claude Code