Sea Select FLIP: source the card-back from the seat's deck, not equipped_deck — TDD

The sea-stage FLIP no-op'd in the gameroom because `_sea_stage.html` rendered
the back-img from `request.user.equipped_deck.back_image_url` — but
`select_role` NULLS OUT the user's equipped_deck once it's contributed to the
room's seats (views.py:1148), so in the Sea Select phase the deck was None →
no back-img element → sea.js's FLIP handler short-circuits on the missing
`.sig-stage-card-back-img` sibling. (my_sea worked: solo, no contribution.)

- `_sea_stage.html` now renders the back-img from a `sea_back_image_url` ctx var
  instead of `request.user.equipped_deck`
- gameroom: `_role_select_context` sets it from the SEAT's contributed deck
  (`_canonical_seat.deck_variant`, when it has card images)
- my_sea: the my_sea view sets it from the user's own equipped deck
- ITs: image seat-deck renders `.sig-stage-card-back-img`; text seat-deck omits it

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-06-07 22:03:19 -04:00
parent ab00774a49
commit de59cb7e69
4 changed files with 40 additions and 19 deletions

View File

@@ -680,6 +680,15 @@ def _role_select_context(room, user, seat_param=None):
)
# 6-card Celtic Cross is complete at 6 placed cards.
ctx["hand_complete"] = len(_sea_hand) >= 6
# Sea-stage FLIP card-back — sourced from the SEAT's contributed deck,
# NOT request.user.equipped_deck (which `select_role` nulls out once
# the deck is contributed to the room → the back-img silently never
# rendered in the gameroom + FLIP no-op'd). User-flagged 2026-06-07.
_back_deck = _canonical_seat.deck_variant if _canonical_seat else None
ctx["sea_back_image_url"] = (
_back_deck.back_image_url
if (_back_deck and _back_deck.has_card_images) else ""
)
return ctx