Conversation
Adds a fourth vote value (vote_type=0, "Neutral") so users can mark a set as indifferent without lying with Won't Go or leaving it unvoted. It's registered in the shared VOTES_TYPES/VOTE_CONFIG registry so Explore exclusion, Schedule filtering, and vote counting pick it up without per-type branching, and fixes several truthy checks on vote values that would otherwise have treated a 0 vote as "no vote" (0 is falsy). UPL-69
The new neutral entry's description copied the existing "Artists ..." phrasing from the other vote types, contradicting the spec's terminology note (votes key to sets, not artists) in the very code meant to follow it. UPL-69
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Deploy →
|
There was a problem hiding this comment.
🟡 Changes recommended
The migration re-adds the CHECK constraint with immediate validation (potentially stronger/longer locking than necessary), and there are a couple of small correctness/maintainability issues to address.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds a new Neutral vote type (vote_type = 0) to UpLine’s voting system, wiring it through the shared vote-type registry so Explore/Schedule/Set Details can treat it consistently alongside existing vote values.
Changes:
- Extends
VOTE_CONFIG/VOTES_TYPESto include Neutral and updates UI to render/select it. - Fixes “falsy vote value” handling so
0is treated as a real vote (Explore queue exclusion, Schedule vote state, etc.). - Updates styling (Tailwind + CSS variables) and adds/extends unit + integration tests for the new vote type.
File summaries
| File | Description |
|---|---|
| tailwind.config.ts | Adds vote.neutral color tokens for Tailwind utility generation. |
| supabase/migrations/20260917151416_add_neutral_vote_type.sql | Expands votes.vote_type CHECK constraint to allow 0. |
| src/routes/festivals/$festivalSlug/editions/$editionSlug/explore.tsx | Treats Neutral like Won’t Go for advancing the Explore queue. |
| src/pages/SetDetails/SetVotingButtons.tsx | Adds a Neutral vote button on Set Details. |
| src/pages/SetDetails/SetGroupVoting.tsx | Adds Neutral to the group voting summary grid/counts. |
| src/pages/ExploreSetPage/VotingActions.tsx | Adds a Neutral action button in the Explore voting actions row. |
| src/pages/ExploreSetPage/VotingActions.test.tsx | Tests Neutral pressed state and click behavior in Explore voting actions. |
| src/pages/ExploreSetPage/useExplorableSets.tsx | Fixes filtering/counting to treat 0 votes as “voted”. |
| src/pages/ExploreSetPage/useExplorableSets.test.ts | Adds coverage for Neutral exclusion and votedCount behavior. |
| src/pages/EditionView/tabs/ScheduleTab/VoteButtons.tsx | Fixes Schedule vote-state detection for 0 votes. |
| src/lib/voteConfig.ts | Registers Neutral in the shared vote-type registry (value, label, icon, classes). |
| src/lib/voteConfig.test.ts | Extends registry tests to cover Neutral mappings and invariants. |
| src/index.css | Adds Neutral CSS variables for light/dark themes. |
| src/api/voting/useVoteMutation.integration.test.ts | Verifies DB persistence of a 0 vote end-to-end under RLS. |
Review details
- Files reviewed: 14/14 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const voteCounts = { | ||
| 2: groupVotes.filter((vote) => vote.vote_type === 2).length, | ||
| 1: groupVotes.filter((vote) => vote.vote_type === 1).length, | ||
| [-1]: groupVotes.filter((vote) => vote.vote_type === -1).length, | ||
| 0: groupVotes.filter((vote) => vote.vote_type === 0).length, |
| ALTER TABLE public.votes DROP CONSTRAINT IF EXISTS votes_type_check; | ||
|
|
||
| ALTER TABLE public.votes | ||
| ADD CONSTRAINT votes_type_check CHECK (vote_type IN (-1, 0, 1, 2)); |
| // "Won't Go" and "Neutral" both settle the decision on this artist, so | ||
| // they advance to the next one, matching the explicit skip action. | ||
| // "Must Go" / "Interested" just cast the vote and stay. |
Playwright test resultsDetails
|
Adds a fourth vote value, Neutral (
vote_type=0), so users can mark a set as indifferent instead of lying with Won't Go or leaving it perpetually unvoted. Registered in the shared vote-type registry so Explore, Schedule filtering, and vote counting pick it up with no per-type branching; naming/iconography is a placeholder pending follow-up (UPL-70).Verification
UPL-69
🤖 Generated with Claude Code
https://claude.ai/code/session_016SYQVVndoRodmvSVNL3dmJ
Generated by Claude Code