Skip to content

Add private challenges with invitation-only access#1

Merged
prazgaitis merged 10 commits intomainfrom
fixes
Feb 8, 2026
Merged

Add private challenges with invitation-only access#1
prazgaitis merged 10 commits intomainfrom
fixes

Conversation

@prazgaitis
Copy link
Copy Markdown
Owner

Summary

  • Private challenge visibility: Challenges can now be marked as private, hiding them from the public browse list (/challenges) and requiring an admin-created invitation to join
  • Admin settings toggle: Challenge admins can switch between Public and Private visibility from the admin settings page
  • Join gating: Users attempting to join a private challenge see an "Invitation Required" button instead of "Join Challenge", and the backend rejects self-join attempts with a clear error
  • Additional fixes: admin tools, participant page, resend email config, dev script improvements

How it works

  • New visibility field on challenges ("public" | "private", optional — existing challenges default to public with no migration needed)
  • listPublic query filters out private challenges
  • join mutation blocks self-join for private challenges (admins can still add participants via userChallenges records)
  • Challenge header shows a disabled "Invitation Required" button for non-participants viewing a private challenge
  • Zod validation schema updated for the new field

Test plan

  • Unit tests added for all visibility scenarios (9 new tests, all passing):
    • listPublic excludes private, includes public and legacy challenges
    • createChallenge persists visibility field
    • updateChallenge toggles visibility in both directions
    • join rejects private challenges, allows public and legacy
  • Manual: toggle challenge to Private in admin settings, verify it disappears from /challenges browse list
  • Manual: navigate directly to a private challenge URL — join button shows "Invitation Required"
  • Manual: toggle back to Public — challenge reappears and join works

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 8, 2026

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

Project Deployment Actions Updated (UTC)
march-fitness-2025 Error Error Feb 8, 2026 7:55pm

Request Review

prazgaitis and others added 2 commits February 8, 2026 13:47
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
prazgaitis and others added 2 commits February 8, 2026 13:52
The client was created at module scope, causing build failures when
NEXT_PUBLIC_CONVEX_URL is not set in Vercel preview environments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@prazgaitis prazgaitis merged commit b30ba9a into main Feb 8, 2026
3 of 4 checks passed
prazgaitis added a commit that referenced this pull request Mar 8, 2026
Preview and apply weekly bonus points to #1 category leaders.
Idempotent via externalId pattern, with tie detection and week tracking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
prazgaitis added a commit that referenced this pull request Mar 8, 2026
…d revoke

- Award top 3 placements per category (1st/2nd/3rd) instead of just #1
- Escalating points by week (week × [10, 5, 3] multipliers)
- Cumulative awards support (weekNumber=0)
- Revoke mutation to undo awards and reverse points
- Shared placement point calculations in lib/categoryLeaderPoints.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
prazgaitis added a commit that referenced this pull request Mar 16, 2026
The #1 player has no prey to hunt, but per the rules they should earn
the full catch bonus (+75) for successfully defending their position.
Previously they always got 0 since caughtPrey was always false when
preyUserId was undefined.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant