My Sign: Brief banner + Earthman [Shabby Cardstock] backup deck when no equipped — TDD
User-reported gap on /billboard/my-sign/ — admin user's only deck was in-use as `TableSeat.deck_variant` in another room (Wonderbeard) → `equipped_deck` cleared → previous my-sign template showed "Equip a card deck first…" w. no actionable next step. User scoped fix: don't force equip, just nudge via a Brief banner "Look!—no deck is equipped. Navigate to the Game Kit to equip one (FYI) or (NVM) proceed with the Earthman [Shabby Cardstock] deck.", title "Default deck warning". NVM dismisses + picker proceeds against an Earthman card pile labeled in-copy as the temporary backup; FYI links to /gameboard/ (Game Kit equip). User-modified line text in template: "Paperboard" → "Cardstock" mid-session ; **helper fallback** (epic/models.py): `personal_sig_cards(user)` now falls back to `DeckVariant.objects.filter(slug='earthman').first()` when `user.equipped_deck` is None — same 16-or-18 card pile, just sourced from the canonical Earthman deck rather than the empty FK. No new DeckVariant row needed; "Shabby Cardstock" is purely UX framing (cards are the same TarotCard records the room sig-select uses). Preserves the existing helper signature so no callers had to change ; **view + template** (billboard/views.py + my_sign.html): view passes `no_equipped_deck` + `show_backup_intro_banner` flags. Template removes the old `{% if not equipped_deck %}` forced-equip branch — picker now renders unconditionally w. cards from the backup helper when no deck is equipped. Brief banner fires via `Brief.showBanner({...})` on DOMContentLoaded when `show_backup_intro_banner` is true — gets h2-overlay positioning + NVM behavior + portal styling for free (per [[sprint-baltimorean-note-unlock-may18]] portrait h2 measurement in note.js's `_alignToH2`). Added `<script src="note.js">` to my_sign.html since the page didn't load it before. Post-render JS tags the Brief w. a `.my-sign-intro-banner` class so FTs (and any future my-sign-specific styling) can distinguish this nudge from other Briefs on the page ; **TDD trail** — 4 new FTs in `MySignBackupDeckTest` (test_bill_my_sign.py): T1 banner renders w. "Default deck warning" title + "no deck is equipped" + "Shabby Cardstock" copy + both action btns visible; T2 picker still populates 16 cards from backup; T3 NVM click removes the banner from the DOM; T4 FYI href ends w. /gameboard/. Initial reds (`NoSuchElementException` on all 4) confirmed before implementation. Plus 1 new IT in `PersonalSigCardsTest` pinning the helper fallback (16 cards w. all `c.deck_variant.slug == "earthman"`) ; pre-existing change picked up: `static_src/scss/rootvars.scss` (user-modified mid-session) ; 1020 IT/UT green; 7 FTs green (3 picker happy-path + 4 backup deck) in 56s. Sprint 4a-follow complete — primary deferral from Sprint 4a (deck-source fallback UX) now landed. Unblocks Sprint 4b (My Sea gating w. --terUser link to /billboard/my-sign/ when no sig set)
Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -268,14 +268,21 @@ def doff_title(request, slug):
|
||||
def my_sign(request):
|
||||
"""Render the picker — same 18-card pile as room sig-select (16 middle
|
||||
arcana courts + Major 0 & 1), pulled from the user's equipped deck.
|
||||
Polarity is determined post-hoc by the FLIP btn (significator_reversed)."""
|
||||
Polarity is determined post-hoc by the FLIP btn (significator_reversed).
|
||||
|
||||
Backup-deck branch: if the user has no equipped_deck AND no saved sig,
|
||||
`personal_sig_cards` falls back to the Earthman pile and the template
|
||||
renders an intro Brief banner labeling the backup as "Earthman [Shabby
|
||||
Paperboard]" with FYI (→ Game Kit) + NVM (dismiss + proceed) actions."""
|
||||
from apps.epic.models import personal_sig_cards
|
||||
deck = request.user.equipped_deck
|
||||
cards = personal_sig_cards(request.user) if deck else []
|
||||
cards = personal_sig_cards(request.user)
|
||||
no_equipped_deck = request.user.equipped_deck is None
|
||||
sig = request.user.significator
|
||||
return render(request, "apps/billboard/my_sign.html", {
|
||||
"cards": cards,
|
||||
"equipped_deck": deck,
|
||||
"current_significator": request.user.significator,
|
||||
"no_equipped_deck": no_equipped_deck,
|
||||
"show_backup_intro_banner": no_equipped_deck and sig is None,
|
||||
"current_significator": sig,
|
||||
"current_significator_reversed": request.user.significator_reversed,
|
||||
"page_class": "page-billboard page-my-sign",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user