dubbodeck per-card FLIP back: the sig stage FLIPs each card to its OWN deck's back, not the seat's — finishes the cross-deck story — TDD

Pairs with the dubbodeck assembly: a mixed pile can now hold cards from up to three decks per polarity, so the single server-rendered back (the viewer's seat deck) was wrong for any cross-deck card. Now per-card: each .sig-card thumbnail carries data-back-image-url (its OWN deck back, only for non-polarized image decks; empty otherwise); stage-card.js fromDataset reads back_image_url + _setImageMode repoints the stage .sig-stage-card-back-img at the FOCUSED card's back and shows/hides the FLIP affordance per card (a backless card in the pile hides FLIP + drops any flipped state).

- _sig_select_overlay.html: the stage back-img + FLIP now render on sig_pile_has_backs (ANY pile card is a non-polarized image deck) instead of the viewer's-seat-deck gate, so an RWS grails/blades card in a PC-earthman viewer's pile can FLIP. Initial src dropped (JS sets it on first focus). epic/views.py computes the flag where sig_cards is set; _court_cards/_major_cards gained select_related(deck_variant) to keep the per-card deck access N+1-free.

TDD: 3 ITs in SigSelectUnifiedStageTest (non-polarized image deck -> per-card /static back url + sig_pile_has_backs + stage back-img/FLIP rendered; polarized deck -> empty back + no FLIP element; text-only deck -> empty back). 562 epic view+model ITs green. The JS repoint/hide is the stage-Jasmine debt (deferred) — manually verified.

- bundled (parallel work): rootvars.scss ongoing palette tuning.

[[project-deck-segment-model]] [[project-image-based-deck-face-rendering]]

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-06-08 20:32:47 -04:00
parent 034639d335
commit 4aee5016c1
6 changed files with 114 additions and 38 deletions

View File

@@ -648,6 +648,17 @@ def _role_select_context(room, user, seat_param=None):
ctx["sig_cards"] = gravity_sig_cards(room, user)
else:
ctx["sig_cards"] = []
# Per-card FLIP-to-back (dubbodeck): the stage back-img + FLIP affordance
# render when ANY card in the (possibly mixed-deck) pile has a
# non-polarized image-deck back; stage-card.js then points the back-img at
# the FOCUSED card's OWN deck. Was gated on the viewer's seat deck only —
# wrong once a pile mixes decks (an RWS card in a PC-earthman viewer's pile
# could never FLIP). select_related on the assembly keeps this N+1-free.
ctx["sig_pile_has_backs"] = any(
c.deck_variant_id and c.deck_variant.has_card_images
and not c.deck_variant.is_polarized
for c in ctx["sig_cards"]
)
if room.table_status == Room.SKY_SELECT:
# CARTE seat-switch: the sky/sea state is per-SEAT (Character.seat), so key