Skip to content

feat(voting): add neutral vote type - #505

Open
chiptus wants to merge 2 commits into
mainfrom
claude/natural-vote-option-q1wxio
Open

chiptus wants to merge 2 commits into
mainfrom
claude/natural-vote-option-q1wxio

Conversation

@chiptus

@chiptus chiptus commented Sep 17, 2026

Copy link
Copy Markdown
Owner

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

  • On Explore, vote Neutral on a set: it advances to the next set and never reappears in the queue.
  • Change a Neutral vote to Must Go/Interested/Won't Go and back; each change persists and the toggle-off (tap same vote again) removes the vote.
  • On the group Schedule view, use the new Neutral filter chip to show/hide sets voted Neutral.
  • On a Set Details page, cast/toggle a Neutral vote and confirm the group voting summary tile shows the correct count.
  • Confirm Must Go/Interested/Won't Go behavior is unchanged (score totals, Explore exclusion, Schedule filters).

UPL-69


🤖 Generated with Claude Code

https://claude.ai/code/session_016SYQVVndoRodmvSVNL3dmJ


Generated by Claude Code

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
Copilot AI lite review requested due to automatic review settings September 17, 2026 15:55
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
upline Ready Ready Preview Sep 17, 2026 3:55pm UTC

@github-actions

Copy link
Copy Markdown

Deploy → stagingworkflow run
Last updated: 2026-09-17 15:56:17 UTC

  • ⏭️ DB migrations skipped (no changes)
  • ⏭️ Edge functions skipped (no changes)
  • ⏭️ Type generation skipped (no changes)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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_TYPES to include Neutral and updates UI to render/select it.
  • Fixes “falsy vote value” handling so 0 is 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.

Comment on lines 48 to +52
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,
Comment on lines +5 to +8
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));
Comment on lines +143 to +145
// "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.
@github-actions

Copy link
Copy Markdown

Playwright test results

passed  65 passed

Details

stats  65 tests across 21 suites
duration  1 minute, 15 seconds
commit  5ccf724

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants