Add community leaderboards (plan 0005)#306
Merged
Merged
Conversation
Build a public leaderboards feature on top of lap snapshots, mostly inside the cloud-sync plugin + admin panel + a new /leaderboards route. - Data model: leaderboard_entries + engine_classes tables with public-read RLS, allow-by-default moderation, per-user content-hash anti-resubmit, automatic keyword classification (admin-overridable) + reclassify RPC. - Submission: Profile-tab panel + dialog; GPS/engine/listed-weight public, setup and engine-telemetry channels private by default. Vehicle weight is now frozen into snapshots as the default listed weight. - Browse: /leaderboards page (shared SiteHeader) with a Track -> Course -> engine/weight accordion, Group-by-weight + Show-top controls. - Read-only viewer: a group transposes into one synthetic session (fastest = lap 1) handed off into Index.tsx, which flips a read-only mode (alert header, no Coach/Tools/Setups/video/weather/snapshots, laps labelled by submitter). - Admin: Leaderboards tab to approve/deny, override engine class, edit notes, and manage engine classes. Pure logic (session transpose, browse tree, submission privacy/hashing, handoff, snapshot weight) is unit-tested. Docs + CHANGELOG (2.10.0) updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RXC54QHvgfZce87ohuMHcz
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
lapwing | 70dfab8 | Commit Preview URL Branch Preview URL |
Jun 26 2026, 03:47 AM |
|
Updates to Preview Branch (claude/leaderboards-feature-yf36wl) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
Coverage SummaryLines: 58.71% (6227/10605) · Statements: 57.66% · Functions: 55.97% · Branches: 53.75% Per-file coverage
|
Replace the English placeholder values added with the leaderboards feature with real translations for the plugins, landing, leaderboard and admin namespaces. Placeholders + key parity preserved (i18n parity test green). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RXC54QHvgfZce87ohuMHcz
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
Builds a public Leaderboards feature on top of lap snapshots — mostly inside the cloud-sync plugin + admin panel + a new
/leaderboardsroute, reusing the modular session/viewer pipeline. Plan:docs/plans/0005-leaderboards.md.Anyone (signed in or not) can browse fastest community laps by track → course → engine class, then open a group in a new read-only viewer. Signed-in users submit their snapshots from the Profile tab; admins moderate and manage engine classification.
What's included
supabase/migrations/20260626000000_leaderboards.sql):leaderboard_entries+engine_classes. Public-read RLS (anonymous browse), allow-by-default moderation (statusdefaults toapproved),unique(user_id, content_hash)anti-resubmit, an automatic keyword classifier (BEFORE-INSERT trigger, admin-overridable via a separate column), and areclassify_entries()admin RPC. No edge function — submission is a direct RLS insert likelap_snapshots.weight/weightUnitis now frozen into snapshots as the default listed weight./leaderboards): a reusableSiteHeader(sponsor/settings/profile; supported-files/about hidden), a Track → Course → engine/weight accordion with data bubbles, a Group by weight toggle and a Show top selector (3/10/25/50/100/All, default 50). Linked from a new landing-page tile.Index.tsx, which flips areadOnlymode — alert-coloured header + Exit, Coach/Tools/Setups + video/weather/snapshots hidden, laps labelled by submitter name, and a course/engine/weight descriptor above the lap table.Tests / checks
bun run lint,bun run typecheck,bun run test:run(2018 passing), andbun run buildall green. Coverage 58.7% lines (floor 50%).bun run i18n:seedtranslates them.🤖 Generated with Claude Code
Generated by Claude Code