feat(admin): ranked mod policy — banned/approved list with categories#44
Open
ChronoFinale wants to merge 2 commits into
Open
feat(admin): ranked mod policy — banned/approved list with categories#44ChronoFinale wants to merge 2 commits into
ChronoFinale wants to merge 2 commits into
Conversation
0011_snapshot.json reused 0010's snapshot id as its own id (and prevId), so 0011 and 0012 pointed at a colliding parent and `drizzle-kit generate` aborted with a collision error. Give 0011 a fresh id and point 0012's prevId at it, restoring a linear 0010 -> 0011 -> 0012 chain. Snapshot ids are dev-time bookkeeping for drizzle-kit only (db:migrate never reads them), so this changes no schema and no applied migration. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Staff-managed banned/approved mod list, served to the game server which polls it and colours opponents' mods red/green/white in the lobby. - mod_policy_entries + mod_policy_categories + many-to-many join (mod_policy_entry_categories): a mod can be in multiple categories - mod_policy.manage permission; tRPC CRUD (entries + categories) as modPolicy - public GET /api/mod-policy: normalized record array the game server polls - admin page /admin/mod-policy: add form + inline row editing, manageable categories (add/rename/delete), grouped banned/approved tables - mod-policy-utils (id normalization + zod schema; id & name required) with bun:test coverage - migration 0014_mod_policy Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b8be821 to
b70c10f
Compare
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.
What this adds
A staff-managed banned/approved mod list for ranked play. The game server polls it and colours opponents' mods red (banned) / green (approved) / white (unknown) in the lobby — automating the manual "check your opponent's mods against the banned list" workflow.
This PR is the website piece only. The game-server poller and the client-mod rendering are separate, forthcoming changes to their repos. The design:
GET /api/mod-policy, caches in memory, and sends the policy to a client when it joins/creates a lobby.What's in here
0014_mod_policy):mod_policy_entries+mod_policy_categories+ a many-to-many join (mod_policy_entry_categories) — a mod can belong to multiple categories.mod_policy.manage— granted to admin + owner; wired into the admin nav and the permissions-manager UI.modPolicyrouter — CRUD for entries and categories; every procedure is permission-gated.GET /api/mod-policy— a normalized record array[{ modId, name, url, status, versions, categories }]that the game server polls (Cache-Control: public, max-age=30)./admin/mod-policy— add form + inline row editing, manageable categories (add/rename/delete), grouped banned/approved tables.mod-policy-utils— id normalization (case-insensitive, punctuation-significant) + zod schema (id & name required), withbun:testcoverage.Note for reviewers — the
fix(drizzle)commitThe first commit (
fix(drizzle): repair 0011/0012 snapshot id collision) is a small, independent fix.0011is a data-only migration (no schema change), so drizzle-kit reused0010's snapshotidfor it — leaving0011/0012pointing at a colliding parent, which madedrizzle-kit generateabort. This was pre-existing onmain, unrelated to the feature, and blocked generating this migration's snapshot.The fix re-mints
0011'sidand repoints0012.prevId. These ids are dev-time bookkeeping fordrizzle-kitonly —db:migratenever reads them — so no schema and no applied migration changes. Happy to split it into its own PR if you'd prefer.Verification
tsc --noEmit, Biome, andbun test(10/10) all clean.0000 → 0014migration chain applied on a fresh database; all tables present.Testing
When a user has a banned mod
UX for adding/remove banned approved mods
Display when user clicks on profile to see mods
🤖 Generated with Claude Code