feat: Werewolf / Resistance / Avalon role presets + customcards persistence#28
Open
taleodor-claude wants to merge 1 commit into
Open
feat: Werewolf / Resistance / Avalon role presets + customcards persistence#28taleodor-claude wants to merge 1 commit into
taleodor-claude wants to merge 1 commit into
Conversation
…stence Feature-complete port of upstream relizaio/card-shuffle PR #13 (same content as #12). The fork was missing the customcards-persistence prereq that PR #13 builds on, so this PR carries both. Server (mafia-express/index.js): - new socket events: addcustomcard, setgametype - new per-room state fields: customCards (already implicit, now initialized) and gameType (default 'classic-mafia') - on requestroom, replay gametype + customcards to the rejoining socket so a refresh / reconnect repaints the right preset - setgametype clears customCards on a preset switch (custom roles were preset-specific) and broadcasts both new states Client (mafia-vue/src/components/CardShuffle.vue): - PRESETS const + clonePresetCards helper covering four presets (classic-mafia, werewolf, resistance, avalon) — each role mapped to one of the four CloudFront image themes (sheriff / godfather / mafia / villager) since no other artwork exists - Game-type selector in the admin panel - gametype + customcards socket handlers (server is source of truth; merge custom roles on top of the preset base) - addRoleSubmit now emits addcustomcard so the role survives reload / propagates to other admins - .preset-control CSS rule for the selector Tests (test-harness/smoke.mjs): - 5 new Puppeteer checks: default preset, switch to Werewolf, switch to Avalon, persistence across reload, and the 'switching clears custom roles' contract ReARM-Agentic-Session: game-presets-1779459983 ReARM-Agent: 324b2ca3-403e-4126-b353-4787140daa65
ReARM: card-shuffle-claude-mafia-express — 2026-05-game-presets.0Lifecycle: Vulnerabilities (0)
Policy Violations (0)
Last scanned: 2026-05-22T14:31:50.261429Z PR ConditionsReject on Disapproval → ✅ PASSReady to Ship on All Approvals → ⚪ NOT METAny agent session has FAILED policy → ✅ PASS |
ReARM: card-shuffle-claude-mafia-vue — 2026-05-game-presets.0Lifecycle: Vulnerabilities (0)
Policy Violations (0)
Last scanned: 2026-05-22T14:32:50.683565400Z PR ConditionsReject on Disapproval → ✅ PASSReady to Ship on All Approvals → ⚪ NOT METAny agent session has FAILED policy → ✅ PASS |
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
Feature-complete port of upstream
relizaio/card-shufflePR #13 (identical content to PR #12, just re-opened). PR #13 alone assumed acustomcards-persistence prereq that wasn't on this fork's main, so this PR carries both layers.Server (
mafia-express/index.js)addcustomcard,setgametypecustomCards: {},gameType: 'classic-mafia'requestroom, replaygametype+customcardsto the rejoining socket so a refresh / reconnect repaints the right presetsetgametypeclearscustomCardson a preset switch and broadcasts both new statesClient (
mafia-vue/src/components/CardShuffle.vue)PRESETSconst +clonePresetCardshelper covering four presets (classic-mafia,werewolf,resistance,avalon)gametype+customcardssocket handlers (server is source of truth; merge custom roles on top)addRoleSubmitnow emitsaddcustomcardso the role persists per roomTests (
test-harness/smoke.mjs)ReARM session
7b5d89f6-03ad-4d79-9733-24f3476bed8egame-presets-1779459983Test plan
card-shuffle.psclaude.rearmhq.comFS to this branch; smoke that the preset selector exists in the served bundle and the server broadcasts work end-to-end