From b563e96f82f8c5953430c1df3354ea4557b31be4 Mon Sep 17 00:00:00 2001 From: Disco DeDisco Date: Thu, 28 May 2026 14:01:57 -0400 Subject: [PATCH] =?UTF-8?q?RWS=20deck:=20flip=20has=5Fcard=5Fimages=3DTrue?= =?UTF-8?q?=20to=20light=20up=20image-mode=20rendering=20=E2=80=94=20TDD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 79 resized + pngquant'd RWS card-face PNGs at cards-faces/english/rider-waite-smith/ are now in place (commit 1e1a0a5). This data migration sets the `tarot-rider-waite-smith` DeckVariant's `has_card_images` flag to True so the existing image-mode branches across all 6 card+stat-block surfaces (sprint A.0-A.8 of [[project-image-based-deck-face-rendering]]) light up for RWS the same way they already do for Minchiate: - card face becomes the .png; rank + suit + name + qualifier + arcana all migrate to the adjacent stat block - deck-stack icon (_deck_stack_icon.html) uses the RWS card-back PNG instead of the SCSS placeholder rect-fill - monodeck collapse still applies (is_polarized stays False, set by 0012); my_sea picker renders a single deck stack instead of dual gravity/levity halves Inverts the IT `test_rws_has_card_images_false` → `test_rws_has_card_images_true`. 1475 ITs green; full epic suite (480) green. No template change needed — the {% if deck.has_card_images %} branches were shipped in sprints A.3-A.7.5 for Minchiate and are deck-agnostic. Code architected by Disco DeDisco Git commit message Co-Authored-By: Claude Opus 4.7 --- .../0014_rws_has_card_images_true.py | 35 +++++++++++++++++++ src/apps/epic/tests/integrated/test_models.py | 7 ++-- 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 src/apps/epic/migrations/0014_rws_has_card_images_true.py diff --git a/src/apps/epic/migrations/0014_rws_has_card_images_true.py b/src/apps/epic/migrations/0014_rws_has_card_images_true.py new file mode 100644 index 0000000..d8173cc --- /dev/null +++ b/src/apps/epic/migrations/0014_rws_has_card_images_true.py @@ -0,0 +1,35 @@ +"""Flip RWS `has_card_images` to True now that the 79 RWS card-face PNGs are +installed + resized + pngquant'd at `cards-faces/english/rider-waite-smith/`. +Light up the existing image-mode rendering branches (already shipped for +Minchiate) for the RWS deck too — the card face becomes the image; the text +metadata moves to the adjacent stat block; the deck-stack icon uses the +RWS card-back PNG instead of the generic SCSS placeholder rect-fill. + +`is_polarized` stays False (set by 0012). RWS was always a monodeck — flip-to- +back FLIP renders the card-back image instead of cycling gravity/levity halves. + +The is_default flag stays False (Earthman remains the default-equipped deck for +new users); explicit equip via Game Kit is required to put RWS on the table. +""" +from django.db import migrations + + +def forward(apps, schema_editor): + DeckVariant = apps.get_model("epic", "DeckVariant") + DeckVariant.objects.filter(slug="tarot-rider-waite-smith").update( + has_card_images=True, + ) + + +def backward(apps, schema_editor): + DeckVariant = apps.get_model("epic", "DeckVariant") + DeckVariant.objects.filter(slug="tarot-rider-waite-smith").update( + has_card_images=False, + ) + + +class Migration(migrations.Migration): + dependencies = [ + ("epic", "0013_seed_minchiate_fiorentine_1860_1890"), + ] + operations = [migrations.RunPython(forward, backward)] diff --git a/src/apps/epic/tests/integrated/test_models.py b/src/apps/epic/tests/integrated/test_models.py index 1d70f86..6e67b60 100644 --- a/src/apps/epic/tests/integrated/test_models.py +++ b/src/apps/epic/tests/integrated/test_models.py @@ -996,9 +996,12 @@ class DeckSchemaA0Test(TestCase): rws = DeckVariant.objects.get(slug="tarot-rider-waite-smith") self.assertEqual(rws.family, "english") - def test_rws_has_card_images_false(self): + def test_rws_has_card_images_true(self): + """Flipped 2026-05-28 by 0014 — the 79 resized + pngquant'd RWS + face PNGs are installed at `cards-faces/english/rider-waite-smith/`, + so the RWS variant joins Minchiate in image-rendering mode.""" rws = DeckVariant.objects.get(slug="tarot-rider-waite-smith") - self.assertFalse(rws.has_card_images) + self.assertTrue(rws.has_card_images) def test_rws_is_polarized_false(self): rws = DeckVariant.objects.get(slug="tarot-rider-waite-smith")