Skip to content

feat(gamemode): edit per-gamemode config from the admin panel - #824

Open
garrappachc wants to merge 1 commit into
feat/gamemode-configfrom
feat/gamemode-admin-config
Open

garrappachc wants to merge 1 commit into
feat/gamemode-configfrom
feat/gamemode-admin-config

Conversation

@garrappachc

Copy link
Copy Markdown
Member

Part of the multi-gamemode (5.0.0) stack. Base: #823. Follow-up to #823 (which made the 3 keys per-gamemode at runtime).

Why

#823 made games.whitelist_id, queue.player_skill_threshold, games.default_player_skill per-gamemode at runtime, but the admin panel could still only edit the default gamemode. This adds per-gamemode editing.

What

  • GamemodeTabs (html/components/gamemode-tabs.tsx) — a reusable tab strip that renders nothing on single-gamemode instances; in fragment mode the tabs hx-get a fragment and swap it into a target without touching the URL.
  • Each of the three fields becomes a self-contained fragment (whitelist-id.tsx, player-skill-threshold.tsx, default-player-skill.tsx) with its own tabs, an id for swapping, and a hidden gamemode input. Switching a tab fetches that gamemode's values (GET …?gamemode=) and swaps in place; the surrounding mixed form still submits each field with its own gamemode, so globals and per-gamemode fields coexist.
  • configuration.set(key, value, actor, gamemode?) gains the gamemode argument; the admin routes save each per-gamemode field under its submitted gamemode.

Scope

  • Single-gamemode instances render and behave exactly as before (tabs hidden, hidden fields default to the instance default → bare storage key). Existing admin e2e (label/name/id selectors) is unaffected.

Verified: net-new tsc = 0, unit suite green without .env (438), lint clean.

Let admins set the three per-gamemode keys — games.whitelist_id,
queue.player_skill_threshold, games.default_player_skill — independently for
each gamemode. Each field becomes a self-contained fragment with its own
gamemode tabs (GamemodeTabs) that hx-swap it in place and a hidden gamemode
input, so the surrounding mixed form still saves each field to the right
gamemode; `configuration.set` gains the matching gamemode argument.

The tabs render nothing on single-gamemode instances, so those pages look and
behave exactly as before.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Playwright test results

passed  251 passed
flaky  1 flaky

Details

stats  252 tests across 48 suites
duration  13 minutes, 55 seconds
commit  0c0b853

Flaky tests

chromium › 20-game/21-handle-straddled-match-start.spec.ts › handles a match start doubled across a second boundary @6v6 @9v9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant