A.7-polish-2 Sea Stage modal img scaffold — TDD. User-reported bug 2026-05-25 PM after the my_sea polish commit (15025b4): drawing a card manually opens the Sea Stage modal but the card area is blank instead of showing the v2-convention card image (or the old text fallback). Root cause: stage-card.js's _setImageMode (added in A.3) correctly adds the .sig-stage-card--image class to the modal's .sig-stage-card.sea-stage-card when the drawn card has a non-empty image_url payload (now flowing through from A.7-polish's card_dict update), and the shared SCSS rule (_card-deck.scss .sig-stage-card.sig-stage-card--image) correctly hides the text scaffold children (.fan-card-corner / .fan-card-face) via display:none. But — the modal's HTML scaffold in _sea_stage.html was missing the <img class="sig-stage-card-img"> slot that the JS expects to populate. _setImageMode queries stageCard.querySelector('.sig-stage-card-img'), gets null, and silently falls through — leaving the modal w. the text scaffold hidden + no img element to show. Net: blank card. Fix: add the same hidden <img class="sig-stage-card-img" alt="" style="display:none"> slot to _sea_stage.html that already lives in my_sign.html's stage card scaffold (the contract the stage-card.js module assumes). Matches the my_sign pattern: inline style="display:none" is cleared by JS via img.style.display = '' when image mode activates (vs. the my_sign template back-img which uses pure CSS-toggled visibility — different contract since the back-img is server-rendered conditionally). No SCSS / JS changes — the shared image-mode SCSS rule already covers the modal's .sig-stage-card.sig-stage-card--image selector (lifted to top-level in A.5 commit 82813e9 specifically so non-.sig-stage-nested cards like the my_sea central sig + Sea Stage modal both work). Also memory-updated: noted the pre-existing AUTO DRAW bug (only works on default SAO spread; other 5 spreads silently fail). Bug pre-dates the image-rendering sprint per user — likely a hardcoded position-list or pile-slice assumption in sea.js's auto-draw handler. Not blocking A.8; flagged in [[project-image-based-deck-face-rendering]] follow-ups. Tests: 1306/1306 IT+UT total green (74s, unchanged — pure template scaffold extension, no test surface). Visual verify: refresh /gameboard/my-sea/ + draw a Minchiate card manually → modal should now show the actual Minchiate card image w. contour stroke + depth shadow, NOT the previous blank state

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-05-25 02:21:31 -04:00
parent 15025b4188
commit 26cdf0d38b

View File

@@ -10,6 +10,13 @@
<div class="sea-stage-backdrop"></div> <div class="sea-stage-backdrop"></div>
<div class="sea-stage-content"> <div class="sea-stage-content">
<div class="sig-stage-card sea-stage-card"> <div class="sig-stage-card sea-stage-card">
{# Sprint A.7-polish — image-mode slot, populated by stage-card.js #}
{# `_setImageMode` from the drawn card's `image_url` payload field. #}
{# Hidden by default; CSS `.sig-stage-card.sig-stage-card--image` #}
{# rule (lifted to top-level in A.5) flips visibility on/off. JS #}
{# clears the inline `style="display:none"` when activating image #}
{# mode (mirrors the my_sign.html stage-card scaffold contract). #}
<img class="sig-stage-card-img" alt="" style="display:none">
<div class="fan-card-corner fan-card-corner--tl"> <div class="fan-card-corner fan-card-corner--tl">
<span class="fan-corner-rank"></span> <span class="fan-corner-rank"></span>
<i class="fa-solid stage-suit-icon" style="display:none"></i> <i class="fa-solid stage-suit-icon" style="display:none"></i>