Problem
src/lib/voteConfig.ts already defines the canonical vote values (mustGo: 2, interested: 1, wontGo: -1) with getVoteValue()/getVoteConfig() accessors, but two call sites reimplement the same scoring logic independently with raw vote_type literals instead of calling it:
src/pages/EditionView/tabs/ArtistsTab/useSetFiltering.ts:20-41 (calculateRating, getWeightedPopularityScore)
src/pages/SetDetails/SetGroupVoting.tsx:46-48
If the vote value scheme in voteConfig.ts ever changes (e.g. rebalancing weights, adding a 4th vote type), these two call sites have to be found and fixed by hand — voteConfig.ts isn't actually the single source of truth it appears to be.
Fix
Delete the local reimplementations in useSetFiltering.ts and SetGroupVoting.tsx; call getVoteValue/getVoteConfig instead. No new code, only deletion of two shallow reimplementations.
Architecture note
Filed from an architecture review (module/interface/depth vocabulary, see /codebase-design). The canonical seam already exists — this is pure leverage left on the table.
Problem
src/lib/voteConfig.tsalready defines the canonical vote values (mustGo: 2, interested: 1, wontGo: -1) withgetVoteValue()/getVoteConfig()accessors, but two call sites reimplement the same scoring logic independently with rawvote_typeliterals instead of calling it:src/pages/EditionView/tabs/ArtistsTab/useSetFiltering.ts:20-41(calculateRating,getWeightedPopularityScore)src/pages/SetDetails/SetGroupVoting.tsx:46-48If the vote value scheme in
voteConfig.tsever changes (e.g. rebalancing weights, adding a 4th vote type), these two call sites have to be found and fixed by hand —voteConfig.tsisn't actually the single source of truth it appears to be.Fix
Delete the local reimplementations in
useSetFiltering.tsandSetGroupVoting.tsx; callgetVoteValue/getVoteConfiginstead. No new code, only deletion of two shallow reimplementations.Architecture note
Filed from an architecture review (module/interface/depth vocabulary, see
/codebase-design). The canonical seam already exists — this is pure leverage left on the table.