feat(voting): add quick vote to synergy detail modal (#212)#262
Open
feat(voting): add quick vote to synergy detail modal (#212)#262
Conversation
Brainstormed and documented UI/UX design for synergy modal quick vote feature including state machine, distribution bar, mobile layout, animation specs, and Supabase migration plan. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6-task TDD plan: Supabase migration, distribution query, DistributionBar component, useQuickVote hook, QuickVoteControl component, modal integration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…#212) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix silent localStorage error handling (getStoredVote/storeVote) - Add try-catch to vote callback and .catch() to useEffect - Fix fontSize to use template literal px strings (project convention) - Fix aria-pressed to use undefined instead of false for idle state - Export Accuracy type, use in QuickVoteControlProps - Add error logging in generic error branch - Add 5 missing tests: retry from error, reversed card order lookup, rate-limited buttons disabled, result with null distribution, rounding correction sum-to-100 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Critical: add security_invoker to migration, optimistic userChoice, useEffect cancellation guard. Important: double-submit useRef guard, DistributionBar two-phase animation, loading indicator for null distribution, getAccuracyDistribution test coverage. Suggestions: safe removeItem, Record<Accuracy>, rename error→submission_failed, consolidate Accuracy type, rate-limit auto-recovery. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
size-limit report 📦
|
⚡ Lighthouse Results
Median of 3 runs. 🟢 ≤75% of limit · 🟠 within limit · 🔴 over limit · 🚫 merge-blocking · |
The shared/hooks mock only provided useTransitionPresence, leaving useResponsive and useScrollLock undefined. On Linux CI (identical path resolution), QuickVoteControl's useResponsive import hits the same mock and crashes. On Windows, different path canonicalization meant the mock didn't intercept the child component's import. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mock paths in __tests__/ must account for being one directory deeper than the component. Add missing shared/components stubs (RenderProfiler, CardLightbox, StrengthBadge). On Windows, wrong paths silently fell through to real modules; on Linux CI, Vitest correctly resolves and intercepts them, requiring complete mock factories. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
pair_scoresview extended with accuracy distribution columnsuseQuickVote) manages full vote lifecycle: hidden → ready → submitting → result → errorNew Components
DistributionBar— three-segment animated percentage bar with rounding correctionQuickVoteControl— vote UI rendering 5 states with accessibility (aria-pressed, role="alert")useQuickVote— state machine hook with double-submit guard, optimistic UI, useEffect cancellationSecurity
security_invoker = trueonpair_scoresview (RLS enforced)useRefguard prevents concurrent double-submissionTest plan
Closes #212
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com