Local-first batch sessions and judging hub#49
Merged
kronosapiens merged 1 commit intomainfrom Feb 24, 2026
Merged
Conversation
Restructure judging flow to use batch sessions with localStorage persistence: - Fetch 10 pairs upfront; votes stored locally; batch submit when session complete - Anyone can judge without auth; only authenticated judges can submit to DB - New GET/POST /:slug/session endpoints replace old per-vote /:slug/pair and /:slug/vote - Removed per-vote round-trip model; back button now trivial array navigation - Sessions persist across tab close with 24h TTL and cross-user session guards Add new judging hub page at /judge listing all game jams with stats (entry/judge/vote counts). Add homepage CTA button to make judging more discoverable. Add proper validations and edge case fixes (NaN/Infinity checks, session TTL preservation). Backend: selectSessionPairs() samples without replacement using variance weighting. Client: useJudging hook rewritten as local-first reducer with useState for auth. Co-Authored-By: Claude Haiku 4.5 <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
Restructured judging to use batch sessions with local-first state and added a public-facing judging hub.
Implementation Details
Backend:
selectSessionPairs()generates 10 pairs using Beta-distribution uncertainty sampling (authenticated judges) or random selection (anonymous). Cross-user session guards prevent submitting another user's votes.Client: Rewrote
useJudginghook as local-first reducer with localStorage persistence and proper TTL management. Removed login gate; review screen shows submit button for authenticated users or login nudge for guests.Quality: Fixed 5 edge cases including fetchedAt TTL reset, cross-user guard false negative, NaN validation, startNewSession screen flash, and sessions count persistence.
Test Plan
🤖 Generated with Claude Code